See my answer in context

On 7/29/15 8:10 AM, Konstantin Khomoutov wrote:
On Wed, 29 Jul 2015 07:48:10 -0700
Ying Huang <huangyi...@gmail.com> 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?
        Yes, I want to see all 3 of them, each one diff against its parent.
        Say, we have these 3 commits, just for easy:
        commit1
        commit2
        commit3
        I am expecting the following diff running:
        git difftool commit1^! "$1"
        git difftool commit2^! "$1"
        git difftool commit3^! "$1"
        While, only these two are running:
        git difftool commit1^! "$1"
        git difftool commit3^! "$1"
        commit2 is not run. That's my problem, and I don't know why......



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.
        Sure, I understand this.

--
Best Regards,

Ying

--
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 git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to