Thread (1 message) 1 message, 1 author, 2016-06-15

Re: How to say HEAD~"all the way back - 1"

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

Bill Lear [off-list ref] writes:
% git log -p HEAD~"All the way back" update

or something similar.
But in that use case "root" commit is not necessarily what you
wanted to say, isn't it?  It is more like "I want *earlier*
history, not latest ones as the command usually gives, of this
file".

$ git log --reverse -p HEAD -- update

would give you the changes that touch the path in the reverse
order than usual (I think this was merged post 1.5.0).

But my point is, you may happen to know it was in your root
commit, but that is a special case.  You may happen to know
other things to limit the output.  The timeperiod you made that
change (e.g. --until=2006-05-31), for example.

By the way, on the face of it:

$ git log --reverse -4 -p HEAD -- update

(or whatever number of commits you are interested in viewing)
might be closer to what you want to express, but the --reverse
option does not work like that, unfortunately for this
particular use case, because the way the semantics of
interaction between --reverse and --max-count is defined.

Given the above command line, the current implementation limits
the traversal to four items and then reverses the output,
instead of traversing normally as if --max-count limitation is
not there, reversing the result and then limiting the output to
four items, which would have made the sample command line above
a bit more useful.

But I would recommend against changing it.  Being able to view
the latest four commits in reverse is much more useful in
practice than being able to view the four commits at the
beginning of time in reverse.  Having both options is certainly
a possibility but I doubt it is worth it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help