# git history and file moves

7 messages from 2008-10-22 to 2008-10-24. Participants: Lin Ming, Alex Riesen, Michael J Gruber, Moore, Robert, Jakub Narebski.
Thread: https://gitlist.dev/t/16000

## Lin Ming, 2008-10-22 02:02

Subject: git history and file moves
Message-ID: <1224640967.14280.0.camel@minggr.sh.intel.com>
URL: https://gitlist.dev/e/1224640967.14280.0.camel%40minggr.sh.intel.com

```
﻿I'm looking for a way to move files to a new directory and have the
full history follow the file automatically. Is this possible?

I know about --follow, but I want the history to just follow the file
transparently. Also, we have a git web interface and we want the full
history for the moved files to be available.

Thanks,
Lin Ming

```

## Alex Riesen, 2008-10-22 11:19

Subject: Re: git history and file moves
Message-ID: <81b0412b0810220419q43f6985fs1c608e3d3cbcf8f3@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0810220419q43f6985fs1c608e3d3cbcf8f3%40mail.gmail.com
In-Reply-To: <1224640967.14280.0.camel@minggr.sh.intel.com>

```
2008/10/22 Lin Ming <ming.m.lin@intel.com>:
> I'm looking for a way to move files to a new directory and have the
> full history follow the file automatically. Is this possible?
>
> I know about --follow, but I want the history to just follow the file
> transparently. ...

Of all Git tools, what does not do this "transparently" or "automatically"?
How more transparent do you imagine this?
What do you think should follow what?

I ask, because it is hard to understand what exactly is it you're missing:
merge support (which we have), git log listing the files as copied/renamed
(which is what --follow is for, and the suggestion for you is to make an
alias or something), git blame (ever looked at git gui blame?) or gitk
(which follows renames in default configuration)

> Also, we have a git web interface and we want the full
> history for the moved files to be available.

It is available. Whether it is shown is another question. git-web can
be improved (or just configured?)

```

## Michael J Gruber, 2008-10-22 12:38

Subject: Re: git history and file moves
Message-ID: <48FF1EDB.8010503@drmicha.warpmail.net>
URL: https://gitlist.dev/e/48FF1EDB.8010503%40drmicha.warpmail.net
In-Reply-To: <81b0412b0810220419q43f6985fs1c608e3d3cbcf8f3@mail.gmail.com>

```
Alex Riesen venit, vidit, dixit 10/22/08 13:19:
> 2008/10/22 Lin Ming <ming.m.lin@intel.com>:
>> I'm looking for a way to move files to a new directory and have the
>> full history follow the file automatically. Is this possible?
>>
>> I know about --follow, but I want the history to just follow the file
>> transparently. ...
> 
> Of all Git tools, what does not do this "transparently" or "automatically"?
> How more transparent do you imagine this?
> What do you think should follow what?
> 
> I ask, because it is hard to understand what exactly is it you're missing:
> merge support (which we have), git log listing the files as copied/renamed
> (which is what --follow is for, and the suggestion for you is to make an
> alias or something), git blame (ever looked at git gui blame?) or gitk
> (which follows renames in default configuration)
> 
>> Also, we have a git web interface and we want the full
>> history for the moved files to be available.
> 
> It is available. Whether it is shown is another question. git-web can
> be improved (or just configured?)

By default, gitweb uses "-M" for diff. You can specify all options (-C,
-CC, -B) using  "@diff_opts" in the config file for gitweb.cgi - if that
is what you are using. Is it?

Anyways, using default configs for git log and gitweb.cgi both of them
show the full history (renames, history before and after) for me here,
using current git (1.6.0.3.514.g2f91b). What is your setup?

Michael

```

## Moore, Robert, 2008-10-24 21:30

Subject: RE: git history and file moves
Message-ID: <4911F71203A09E4D9981D27F9D8308580AA7FFFB@orsmsx503.amr.corp.intel.com>
URL: https://gitlist.dev/e/4911F71203A09E4D9981D27F9D8308580AA7FFFB%40orsmsx503.amr.corp.intel.com
In-Reply-To: <48FF1EDB.8010503@drmicha.warpmail.net>

```
Here's what we have:

/var/www/cgi-bin/gitweb.acpica/gitweb.conf

Containts this : GITWEB_CSS = "/icons/gitweb.css";


What should we add to automatically get all file history?

Thanks,
Bob

>-----Original Message-----
>From: Michael J Gruber [mailto:git@drmicha.warpmail.net]
>Sent: Wednesday, October 22, 2008 5:39 AM
>To: Lin, Ming M
>Cc: Alex Riesen; git@vger.kernel.org; Moore, Robert
>Subject: Re: git history and file moves
>
>Alex Riesen venit, vidit, dixit 10/22/08 13:19:
>> 2008/10/22 Lin Ming <ming.m.lin@intel.com>:
>>> I'm looking for a way to move files to a new directory and have the
>>> full history follow the file automatically. Is this possible?
>>>
>>> I know about --follow, but I want the history to just follow the file
>>> transparently. ...
>>
>> Of all Git tools, what does not do this "transparently" or
>"automatically"?
>> How more transparent do you imagine this?
>> What do you think should follow what?
>>
>> I ask, because it is hard to understand what exactly is it you're
>missing:
>> merge support (which we have), git log listing the files as
>copied/renamed
>> (which is what --follow is for, and the suggestion for you is to make an
>> alias or something), git blame (ever looked at git gui blame?) or gitk
>> (which follows renames in default configuration)
>>
>>> Also, we have a git web interface and we want the full
>>> history for the moved files to be available.
>>
>> It is available. Whether it is shown is another question. git-web can
>> be improved (or just configured?)
>
>By default, gitweb uses "-M" for diff. You can specify all options (-C,
>-CC, -B) using  "@diff_opts" in the config file for gitweb.cgi - if that
>is what you are using. Is it?
>
>Anyways, using default configs for git log and gitweb.cgi both of them
>show the full history (renames, history before and after) for me here,
>using current git (1.6.0.3.514.g2f91b). What is your setup?
>
>Michael

```

## Alex Riesen, 2008-10-24 21:43

Subject: Re: git history and file moves
Message-ID: <81b0412b0810241443t75e2022fg984df400585cb254@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0810241443t75e2022fg984df400585cb254%40mail.gmail.com
In-Reply-To: <4911F71203A09E4D9981D27F9D8308580AA7FFFB@orsmsx503.amr.corp.intel.com>

```
2008/10/24 Moore, Robert <robert.moore@intel.com>:
> Here's what we have:
>
> /var/www/cgi-bin/gitweb.acpica/gitweb.conf
>
> Containts this : GITWEB_CSS = "/icons/gitweb.css";
>
> What should we add to automatically get all file history?
>

Nothing. It is the default. You can change the variable Michael
mentioned to use "-M -M -C -C" but it is very-very slow on any
kind of history worth its commits.

And you almost never talk about _file_ history in Git. It is all
_project_ history, filtered for commits which touch the file you're
interested in at the moment of looking.

```

## Moore, Robert, 2008-10-24 22:01

Subject: RE: git history and file moves
Message-ID: <4911F71203A09E4D9981D27F9D8308580AA80062@orsmsx503.amr.corp.intel.com>
URL: https://gitlist.dev/e/4911F71203A09E4D9981D27F9D8308580AA80062%40orsmsx503.amr.corp.intel.com
In-Reply-To: <81b0412b0810241443t75e2022fg984df400585cb254@mail.gmail.com>

```
What we are seeing is an issue after we do a file move to a new directory. Once moved, the previous history of the file is not readily available. One needs to know to use --follow on the command line, and worse, gitweb does not show the full history at all.

We have almost a decade of history on the project, from several different source control systems. We often find it useful to go back and find out when something changed, so we want to keep it and have it easily available.

>-----Original Message-----
>From: Alex Riesen [mailto:raa.lkml@gmail.com]
>Sent: Friday, October 24, 2008 2:43 PM
>To: Moore, Robert
>Cc: Michael J Gruber; Lin, Ming M; git@vger.kernel.org
>Subject: Re: git history and file moves
>
>2008/10/24 Moore, Robert <robert.moore@intel.com>:
>> Here's what we have:
>>
>> /var/www/cgi-bin/gitweb.acpica/gitweb.conf
>>
>> Containts this : GITWEB_CSS = "/icons/gitweb.css";
>>
>> What should we add to automatically get all file history?
>>
>
>Nothing. It is the default. You can change the variable Michael
>mentioned to use "-M -M -C -C" but it is very-very slow on any
>kind of history worth its commits.
>
>And you almost never talk about _file_ history in Git. It is all
>_project_ history, filtered for commits which touch the file you're
>interested in at the moment of looking.

```

## Jakub Narebski, 2008-10-24 22:13

Subject: Re: git history and file moves
Message-ID: <m3vdvhhc5s.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3vdvhhc5s.fsf%40localhost.localdomain
In-Reply-To: <4911F71203A09E4D9981D27F9D8308580AA7FFFB@orsmsx503.amr.corp.intel.com>

```
"Moore, Robert" <robert.moore@intel.com> writes:

> 
> Thanks,
> Bob
> 
> >-----Original Message-----
>Michael J Gruber wrote:
>>Alex Riesen venit, vidit, dixit 10/22/08 13:19:
>>> 2008/10/22 Lin Ming <ming.m.lin@intel.com>:

>>>> I'm looking for a way to move files to a new directory and have the
>>>> full history follow the file automatically. Is this possible?
>>>>
>>>> I know about --follow, but I want the history to just follow the file
>>>> transparently. ...
>>>
>>> Of all Git tools, what does not do this "transparently" or "automatically"?
[...]

>>>> Also, we have a git web interface and we want the full
>>>> history for the moved files to be available.
>>>
>>> It is available. Whether it is shown is another question. git-web can
>>> be improved (or just configured?)
>>
>> By default, gitweb uses "-M" for diff. You can specify all options (-C,
>> -CC, -B) using  "@diff_opts" in the config file for gitweb.cgi - if that
>> is what you are using. Is it?
>>
>> Anyways, using default configs for git log and gitweb.cgi both of them
>> show the full history (renames, history before and after) for me here,
>> using current git (1.6.0.3.514.g2f91b). What is your setup?
>
> Here's what we have:
> 
> /var/www/cgi-bin/gitweb.acpica/gitweb.conf
> 
> Containts this : GITWEB_CSS = "/icons/gitweb.css";

This fragment has nothing to do with rename (file movement) detection.

> 
> What should we add to automatically get all file history?

While the 'commitdiff' view would, in default gitweb configuration,
contain information about file renames, currently 'history' view does
not support '--follow' option to git-log.  It wouldn't be too hard to
add it, but it just wasn't done (well, add to this the fact that
--follow works only for simple cases).

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
