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

Re: how to show log for only one branch

From
LYLiu Yubao <yubao.liu@gmail.com>
Date
Nov 6, 2006, 10:41 UTC
Message-ID
<454F1175.9080506@gmail.com>
In-Reply-To
<7vk629f6is.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Liu Yubao <yubao.liu@gmail.com> writes:
> 

Snip many great detailed description, thank you very much, I have a question about the way git treats fast forwarding but that will be another topic.

Show 24 quoted lines
> What's mainline is _not_ important, and which parent is first is
> even less so.  It solely depends on what you are looking for
> which branch matters more.  Putting too much weight on the
> difference between HEAD^1 vs HEAD^2 statically does not make any
> sense.
> 
> Reflecting this view of history, git log and other history
> traversal commands treat merge parents more or less equally, and
> _how_ you ask your question affects what branches are primarily
> followed.  For example, if somebody is interested in your device
> driver work, this command:
> 
> 	git log -- drivers/liu-s-device/
> 
> would follow your side branch.  On the other hand,
> 
> 	git log -- fs/
> 
> would follow Linus's development track while you were forked, if
> you did not do any fs/ work while on that side branch and
> Linus's development track had works in that area, _despite_ the
> merge you gave Linus has your development track as its first
> parent.
> 
This is perfect and enough for two branches that work on different
files, but if two branches modify same files, "git log" can't separate
commits clearly. For example, I want to know what happened in your
git's "next" branch, I hope to get logs like this:
     Merge branch 'jc/pickaxe' into next
     Merge branch 'master' into next
     Merge branch 'js/modfix' into next
     ...
     some good work
     ...
     Merge branch ....

I just want to *outline* what happened in "next" branch, if I am interested in what have been merged from 'jc/pickaxe' I can follow the merge point again or use something like "git log --follow-all-parents".

Instead, "git log" interlaces logs from many branches, I find it's a little confused: why does "git log" of current branch contain many logs from other branches? (This is not a real question, I know the reason)

I indeed understand that HEAD^1 is not always the commit that my work bases on before a merge (thanks for your detailed description again:-), it doesn't make sense to show HEAD~1, HEAD~2, HEAD~3 and so on, that's to say 'git log' will never meet my requirement.

Maybe reflog is what I need, I want to know which commits "next" have pointed to, but reflog is only for local purpose, it's not downloaded by 'git clone'

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 35 in “how to show log for only one branch”
  1. Liu YubaoNov 6, 2006
  2. Junio C HamanoNov 6, 2006
  3. Liu YubaoNov 6, 2006
  4. Junio C HamanoNov 6, 2006
  5. Liu YubaoNov 7, 2006
  6. Jakub NarebskiNov 7, 2006
  7. If merging that is really fast forwarding creates new commit [Was: Re: how to show log for only one branch]Liu Yubao, Nov 6, 2006
  8. Rocco RutteNov 6, 2006
  9. Liu YubaoNov 7, 2006
  10. Andreas EricssonNov 6, 2006
  11. Liu YubaoNov 7, 2006
  12. Andy WhitcroftNov 7, 2006
  13. Liu YubaoNov 7, 2006
  14. Jakub NarebskiNov 7, 2006
  15. Linus TorvaldsNov 6, 2006
  16. Martin LanghoffNov 6, 2006
  17. Linus TorvaldsNov 6, 2006
  18. Liu YubaoNov 7, 2006
  19. Linus TorvaldsNov 7, 2006
  20. Junio C HamanoNov 7, 2006
  21. Eran TromerNov 7, 2006
  22. Liu YubaoNov 7, 2006
  23. Andy WhitcroftNov 7, 2006
  24. Liu YubaoNov 7, 2006
  25. Andy WhitcroftNov 7, 2006
  26. Linus TorvaldsNov 7, 2006
  27. Jakub NarebskiNov 7, 2006
  28. Junio C HamanoNov 7, 2006
  29. Planned new release of git [was: Re: If merging that is really fast forwarding creates new commit]Jakub Narebski, Nov 7, 2006
  30. Linus TorvaldsNov 7, 2006
  31. Junio C HamanoNov 7, 2006
  32. Junio C HamanoNov 7, 2006
  33. Jakub NarebskiNov 6, 2006
  34. Liu YubaoNov 7, 2006
  35. Jakub NarebskiNov 7, 2006

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.