git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Effectively navigating branch history

From
SBStephen Bash <bash@genarts.com>
Date
May 31, 2011, 18:51 UTC
Message-ID
<21849336.45230.1306867875224.JavaMail.root@mail.hq.genarts.com>
In-Reply-To
<7vtycaiuh9.fsf@alter.siamese.dyndns.org>
----- Original Message -----
Show 24 quoted lines
> From: "Junio C Hamano" <gitster@pobox.com>
> Sent: Tuesday, May 31, 2011 2:40:50 PM
> Subject: Re: Effectively navigating branch history
> 
> >> Yeah, I think it was 1f9a980636 which was a merge between fb674d7
> >> and 73546c0. I just compared the output between these two:
> >>
> >> $ git diff fb674d7...73546c0 -- config.c ;# what the topic did
> >> $ git diff fb674d7 1f9a980 -- config.c ;# what was merged
> >
> > I often find myself wanting to do the "what the topic did" operation
> > but once the branch is merged and deleted, I have difficulty finding
> > useful SHAs to diff.
> >
> > So in an attempt to educate myself, I tried to track down fb674d7
> > and 1f9a980 (and failed miserably).
> 
> I just did
> 
> $ git log --first-parent master -- config.c
> 
> which was sufficient for my workflow as most of the commits on master
> are merges from topics and I can see what each topic did from the merge
> commit summary message.
Ah, if only our workflow made it that easy... unfortunately it does not ;)
Show 12 quoted lines
> If I were doing this on a codebase I am not very familiar with, I
> probably I would have first narrowed things down a bit by
> 
> $ git grep -n -e NOGLOBAL -- config.c ;# to learn the line number 830
> $ git blame -L825,835 -- config.c
> 
> to learn where the offending NOGLOBAL came from (it is from ab88c363)
> so that I can say
> 
> $ git log -m -p -GNOGLOBAL ab88c363.. -- config.c
> 
> to find that 1f9a980 reintroduced it by mistake.
Ah, I was missing the -m!  At one point I realized pickaxe was only showing me non-merge commits and skimmed the log manpage to see if there was an option that would enable it but apparently missed -m.
Thanks!
Stephen
Previous: Junio C Hamano
Message 5 of 5 in “config.c: Remove unused git_config_global() function”
  1. config.c: Remove unused git_config_global() functionRamsay Jones, May 31, 2011
  2. Junio C HamanoMay 31, 2011
  3. Effectively navigating branch history (was: Re: [PATCH] config.c: Remove unused git_config_global() function)Stephen Bash, May 31, 2011
  4. Junio C HamanoMay 31, 2011
  5. Stephen BashMay 31, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.