Thread (1 message) 1 message, 1 author, 2016-06-15
  • (off-list ancestor, not in this archive)
  • Re: What's in git.git · Junio C Hamano <hidden> · 2016-06-15

Re: What's in git.git

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:17

Santi Bejar [off-list ref] writes:
Junio C Hamano [off-list ref] writes:
...
quoted
        $ git whatchanged --cc --abbrev pu
...
      Then some comments :)

      * There is an extra space between the +- and the content.
Thanks for noticing.  Fixed.
      * I think the "diff command" could be just "diff --git".  And
        "diff --git --cc" for the "dense combined diff".
I chose not say "--git" because I wanted to make sure people
would not run "git apply" by mistake.  I replaced them
with "--combined" and "--cc" to make the differences clearer.
      * I miss the index lines
That would probably be easy to add in the later rounds if you
really want them, but I consider it lower priority for now.
This is designed to be human readable and not necessarily
machine applicable, so I do not see much point in showing them.

Mode changes, creation, deletion, rename, and copy may need to
be there, though.  The code currently punts on them.  Patches
welcome.
      * In the case of 3 and more parents I find uninteresting the hunk
        where the merge is equal to one (or more) of its children and
        the rest are equal. For example the first hunk in 22573dd, where
        all the children are equal expect the picked one:

diff-tree 22573dd... (from parents)
Merge: 92643a2 0359fe8 a428965 4aa079f
Author: Junio C Hamano [off-list ref]
Date:   Wed Jan 25 03:51:37 2006 -0800

    Merge lt/revlist,jc/diff,jc/bind

diff --combined rev-list.c
@@@@@ +37,7 @@@@@
     static int dense = 1;
     static int unpacked = 0;
     static int bisect_list = 0;
---  static int tag_objects = 0;
---  static int tree_objects = 0;
---  static int blob_objects = 0;
+++  static int list_objects = 0;
     static int verbose_header = 0;
     static int show_parents = 0;
     static int hdr_termination = 0;
I noticed it and found it somewhat less interesting than others,
but left it the way.  It is "changed the same way from all of
these parents except this one", which is different from what I
culled in the version you are commenting on, i.e. "changed only
from one parent".

I've since updated the logic to drop these hunks as well.
Please take a look at the tip of "pu".
      * Like you said in another thread, the line numbers of all the
        files.
This is left as an exercise for the reader ;-)
So, at the end, I suggest this output for the diff:
...
and this for the diff-raw:

:100644 100644 56505b4... 538d21d... M  Makefile
:100644 100644 30479b4... 538d21d... M  Makefile
I do not find this to be so interesting.  diff-raw is primarily
for quick sanity check and machine processing, so I'd rather not
play games when generating diff-raw in order to keep the latter
form of users sane.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help