From: "Jason Pyeron" <jpyeron@pdinc.us>
To: <git@vger.kernel.org>
Subject: Importing history to show up in a blame
Date: Wed, 18 Jun 2014 16:09:33 -0400 [thread overview]
Message-ID: <24554E1EBCD64D04B2B2B5E1A6280DF1@black> (raw)
[-- Attachment #1: Type: text/plain, Size: 4442 bytes --]
The only way I have found so far to do this is to merge the branch on to a tmp
branch and then back!
The only other way I found seems real bad:
http://stackoverflow.com/questions/16473363/tell-git-blame-to-use-imported-histo
ry
And the way below does not work if there are edits already on master (that is
non-identical files).
Is there a better way?
-Jason
jpyeron@black /tmp/foo
$ git --version
git version 1.8.4.21.g992c386
jpyeron@black /tmp/foo
$ git init history
Initialized empty Git repository in /tmp/foo/history/.git/
jpyeron@black /tmp/foo
$ cd history
jpyeron@black /tmp/foo/history
$ #make source.txt and commit ...
jpyeron@black /tmp/foo/history
$ git checkout --orphan HISTORICAL
Switched to a new branch 'HISTORICAL'
jpyeron@black /tmp/foo/history
$ # import each historical version and commit ...
jpyeron@black /tmp/foo/history
$ git log --oneline --graph && git blame source.txt && sha1sum.exe source.txt
* 2889460 v6 - latest
* 62e4a90 v5
* bfdf128 v4
* 416d32a v3
* 241a7dc v2
* 7ef41ad v1
^7ef41ad (Jason Pyeron 2014-06-18 13:47:57 -0400 1) 1 the
241a7dc5 (Jason Pyeron 2014-06-18 13:48:53 -0400 2) 2 quick
62e4a90e (Jason Pyeron 2014-06-18 13:50:44 -0400 3) 3 brown
bfdf1285 (Jason Pyeron 2014-06-18 13:49:55 -0400 4) 4 fox
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 5) 5 jumped
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 6) 6 over
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 7) 7 the
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 8) 8 lazy
28894602 (Jason Pyeron 2014-06-18 13:51:03 -0400 9) 9 dogs
cd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt
jpyeron@black /tmp/foo/history
$ git checkout master
Switched to branch 'master'
jpyeron@black /tmp/foo/history
$ git log --oneline --graph && git blame source.txt && sha1sum.exe source.txt
* f25b132 import of latest source
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 1) 1 the
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 2) 2 quick
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 3) 3 brown
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 4) 4 fox
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 5) 5 jumped
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 6) 6 over
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 7) 7 the
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 8) 8 lazy
^f25b132 (Jason Pyeron 2014-06-18 13:45:56 -0400 9) 9 dogs
cd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt
jpyeron@black /tmp/foo/history
$ git checkout HISTORICAL
Switched to branch 'HISTORICAL'
jpyeron@black /tmp/foo/history
$ git branch historymerge
jpyeron@black /tmp/foo/history
$ git checkout historymerge
Switched to branch 'historymerge'
jpyeron@black /tmp/foo/history
$ git merge master
Merge made by the 'recursive' strategy.
jpyeron@black /tmp/foo/history
$ git checkout master
Switched to branch 'master'
jpyeron@black /tmp/foo/history
$ git merge historymerge
Updating f25b132..5a9408a
Fast-forward
jpyeron@black /tmp/foo/history
$ git branch -d historymerge
Deleted branch historymerge (was 5a9408a).
jpyeron@black /tmp/foo/history
$ git log --oneline --graph && git blame source.txt && sha1sum.exe source.txt
* 5a9408a Merge branch 'master' into historymerge
|\
| * f25b132 import of latest source
* 2889460 v6 - latest
* 62e4a90 v5
* bfdf128 v4
* 416d32a v3
* 241a7dc v2
* 7ef41ad v1
^7ef41ad (Jason Pyeron 2014-06-18 13:47:57 -0400 1) 1 the
241a7dc5 (Jason Pyeron 2014-06-18 13:48:53 -0400 2) 2 quick
62e4a90e (Jason Pyeron 2014-06-18 13:50:44 -0400 3) 3 brown
bfdf1285 (Jason Pyeron 2014-06-18 13:49:55 -0400 4) 4 fox
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 5) 5 jumped
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 6) 6 over
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 7) 7 the
416d32a4 (Jason Pyeron 2014-06-18 13:49:34 -0400 8) 8 lazy
28894602 (Jason Pyeron 2014-06-18 13:51:03 -0400 9) 9 dogs
cd49f005ab64dac61b2d420a7903fcd02b5f373f *source.txt
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Principal Consultant 10 West 24th Street #100 -
- +1 (443) 269-1555 x333 Baltimore, Maryland 21218 -
- -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.
[-- Attachment #2: history.bundle --]
[-- Type: application/octet-stream, Size: 1880 bytes --]
reply other threads:[~2014-06-18 20:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=24554E1EBCD64D04B2B2B5E1A6280DF1@black \
--to=jpyeron@pdinc.us \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox