emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git apologia


From: Eli Zaretskii
Subject: Re: git apologia
Date: Mon, 17 Nov 2014 18:41:50 +0200

> From: "Stephen J. Turnbull" <address@hidden>
> Cc: address@hidden
> Date: Mon, 17 Nov 2014 09:14:14 +0900
> 
>  > And waddaya know?  HEAD~n etc. seem to _skip_ merge-commits,
> 
> It only seems to do so.  In my (not quite up-to-date) emacs repo,
> "git log @address@hidden" displays no merges, but apparently that's because
> there's a long sequence of non-merges (fast-forwards) on mainline.
> However, "git log @~10..@" displays several, as does
> "git log @address@hidden".
> 
> Or by "merge-commits" do you mean the off-trunk commits?

Yes, it turns out that's what they were, as Andreas pointed out.  I
was fooled by the fact that they are shown by default (unlike what I'm
used to with bzr), and they seem to have no visual cues in the default
output format that they are off-trunk (like, e.g., the indentation
used by "bzr log").

>  > so (a) the counts end up being wrong, and (b) if you want to see
>  > those merge-commits, you need to _know_ they are merge-commits and
>  > then use HEAD^2 etc. (i.e.  explicitly request the 2nd parent).
>  > This is awful.
> 
> If you say so, I guess it is for you.  I'm curious why it's useful to
> you.

Because it is easy enough to count lines in "git log --oneline" or
similar 1-line log format, and then request details about the Nth
line.

When I pull from upstream, I almost always look at the log summary
lines of the last dozen commits, and then frequently examine one or
more of those in detail.  So I need a quick and convenient method of
doing "git show" or its equivalent without the need to type the 7 hex
characters of the SHA1 checksum.  What's more natural than asking for
the Nth previous commit?

I will probably convince myself to add --first-parent to my "git log"
aliases, as Andreas suggested.  After all, that's what "bzr log" does
by default.  Then HEAD~n will work as I expect.  (And don't get me
started on the reader-unfriendly description of --first-parent on the
git-log man page.)

Or maybe I will start using "C-x v L" ;-)

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]