On Wed, 29 Jul 2015 07:48:10 -0700 Ying Huang <[email protected]> wrote:
> Hi, > great thanks for your attention, > Yes, git log --oneline --format %H --follow -- hello.txt is > better than using awk. > > git log --oneline --format %H --follow -- hello.txt \ > | while read name; do > git difftool "$name" "$name^1" > done > > Unfortunately, if you observe carefully, you will soon find that > *_it skipped some commits_*. I strongly doubt the fault is the ^ git > operator. > My solution is using an array to save the output first: see my > script bellow: I'm afraid I don't "get" your problem statement. As I understood it, you told that, 1) say, let the history of hello.txt includes 3 commits, and 2) you'd like to see three diff views -- one for each of those commits, and 3) each such diff view should display the changes between the indicated commit and its parent commit. Is that correct? If yes, then if a commit has a name (its sha-1 hash sum) <rev>, then the name of its first (or sole) parent commit is <rev>^1, and the way to get a difference between them is by passing these two arguments to a difftool. Just in case (to remove the possibility of a certain common misunderstanding), a diff view is always generated between a pair of commits ignoring any commits which might naturally form a chain between those commits in that pair. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
