threads / discuss / 13227

history of a renamed file

Subject: history of a renamed file

## tl;dr

4 messages between Apr 23, 2008 and Apr 23, 2008.

replies: 3people: 3as markdown or json

Christoph Duelli· Apr 23, 2008, 13:02 UTC · lore

Given a repo that contains a file x.c that got renamed from some/path/x.c to new/location/x.c

Is it possible (ideally with gitk) to view the complete history of what is now new/location/x.c *including* the history of changes that occurred when it stil was some/path/x.c? When I say "gitk new/location/x.c" I get just the changes made starting with the rename. When I call "gitk" and look for the changeset, the rename is detected, though. Therefore I hope that it is somehow possible to obtain the complete file-specific history without truncation at renames.

Any ideas?

Thank you, best regards Christoph

Jakub Narebski· Apr 23, 2008, 13:25 UTC · re: Christoph Duelli · lore

Re: history of a renamed file

Christoph Duelli <duelli@melosgmbh.de> writes:
Show 16 quoted lines
> Given a repo that contains a file x.c
> that got renamed from
>   some/path/x.c
> to
>   new/location/x.c
> 
> Is it possible (ideally with gitk) to view the complete history of
> what is now new/location/x.c *including* the history of changes that
> occurred when it stil was some/path/x.c?
> When I say "gitk new/location/x.c" I get just the changes made
> starting with the rename.
> When I call "gitk" and look for the changeset, the rename is detected,
> though. Therefore I hope that it is somehow possible to obtain the
> complete file-specific history without truncation at renames.
> 
> Any ideas?

Try --follow option, see git-log(1), although I'm not sure if gitk supports it (it should).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Christoph Duelli· Apr 23, 2008, 13:45 UTC · re: Jakub Narebski · lore

Re: history of a renamed file

Jakub Narebski schrieb:
Show 21 quoted lines
> Christoph Duelli <duelli@melosgmbh.de> writes:
> 
>> Given a repo that contains a file x.c
>> that got renamed from
>>   some/path/x.c
>> to
>>   new/location/x.c
>>
>> Is it possible (ideally with gitk) to view the complete history of
>> what is now new/location/x.c *including* the history of changes that
>> occurred when it stil was some/path/x.c?
>> When I say "gitk new/location/x.c" I get just the changes made
>> starting with the rename.
>> When I call "gitk" and look for the changeset, the rename is detected,
>> though. Therefore I hope that it is somehow possible to obtain the
>> complete file-specific history without truncation at renames.
>>
>> Any ideas?
> 
> Try --follow option, see git-log(1), although I'm not sure if gitk
> supports it (it should).
Works, thank you!
-- 
Christoph Duelli
Teemu Likonen· Apr 23, 2008, 14:05 UTC · re: Jakub Narebski · lore

Re: history of a renamed file

Jakub Narebski wrote (2008-04-23 06:25 -0700):
Show 5 quoted lines
> Christoph Duelli <duelli@melosgmbh.de> writes:
> 
> > Is it possible (ideally with gitk) to view the complete history of
> > what is now new/location/x.c *including* the history of changes that
> > occurred when it stil was some/path/x.c?
> Try --follow option, see git-log(1), although I'm not sure if gitk
> supports it (it should).

gitk certainly accepts '--follow' but the option does not work as expected. For example try

  gitk --follow -- utf8.c
in the Git repository and get surprised. :-)

I noticed the problem two weeks ago and Adam Simpkins elaborated it a bit. See http://thread.gmane.org/gmane.comp.version-control.git/79008

← back to recent threads