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

Re: Git log can not show history before rename

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 30, 2009, 12:25 UTC
Message-ID
<m33af1x9od.fsf@localhost.localdomain>
In-Reply-To
<adf1fd3d0901300329y53e46d91xda75799ce1244ddd@mail.gmail.com>
Santi Béjar <santi@agolina.net> writes:
> 2009/1/30 Frank Li <lznuaa@gmail.com>:
Show 29 quoted lines
> > mkdir tt3
> > cd tt3
> > git init-db
> 
> "git init"
> 
> > touch a.c
> > git add a.c
> > git commit -a -m "test1"
> >
> > git mv a.c b.c
> > git commit -a -m "rename"
> >
> > modify b.c
> > git commit -a -m "test2"
> >
> > git log -C -M -- b.c
> [...]
> > I can't get history before rename.
> 
> You asked to restrict the search to the b.c path.
> 
> You want:
> 
> git log --follow -- b.c
> 
> Man git-log:
>        --follow
>            Continue listing the history of a file beyond renames.
Or use
  $ git log -C -- b.c a.c
(you don't need '-M' option, as '-C' is superset of it).

Note that '--follow' works for simple histories, but (as it is quite new invention) doesn't work yet for all cases, like for example subtree merge or equivalent.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Santi BéjarNext: Frank Li
Message 3 of 9 in “Git log can not show history before rename”
  1. Frank LiJan 30, 2009
  2. Santi BéjarJan 30, 2009
  3. Jakub NarebskiJan 30, 2009
  4. Frank LiJan 30, 2009
  5. Santi BéjarJan 30, 2009
  6. Thomas RastJan 30, 2009
  7. Jeff KingJan 31, 2009
  8. Linus TorvaldsJan 30, 2009
  9. Linus TorvaldsJan 30, 2009

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.