git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Rename handling
Date: Wed, 21 Mar 2007 01:21:31 +0100	[thread overview]
Message-ID: <etptkp$2uo$1@sea.gmane.org> (raw)
In-Reply-To: slrnevtdfh.v0v.jgoerzen@katherina.lan.complete.org

John Goerzen wrote:

> I've read the FAQ and Linus' philosophy on this topic, and have some
> questions still.  I'm considering using Git and its philosophy on
> renames is troubling me.
> 
> My use for version control presently has most changes being written and
> committed by me directly, with occasional patches coming in from random
> others.  As such, running something like 'git mv' when a rename occurs
> is not a problem.
> 
> My main concerns with Git are:
> 
> 1) git log does not show complete history of files that have been
>    renamed or copied.
> 
>    If I have foo.txt, and rename it to bar.txt, the liberal use of -M
>    can tease out a proper patch from a number of places.  But
>    git log bar.txt, with any set of options I can possibly come up with,
>    absolutely refuses to show me the history of bar.txt before it was
>    renamed to bar.txt.  git log foo.txt also does not show me the old
>    history for the file.

That is because "bar.txt" in "git log bar.txt" is not file name to show
history of, but path limiter (BTW. it is not output filter, as it also
simplifies history). And you can say for example "git log Documentation/"
which I guess is not available in any other SCM beside Git.

There were at least two attempts to provide a kind of --follow=<filename>
to the git-log family of commands, to track/show history of a given file
across renames. See "Why does git not track renames?" entry in GitFaq
(http://git.or.cz/gitwiki/GitFaq) for some history; lately Linus has
send prototype of blame engine based implementation of --follow option.

> 2) For me, a rename is a logical change to the source tree that I want
>    to be recorded with absolute certainty, not guessed about later.
>    Sometimes I may make API changes and it is useful to see how module
>    names changed, with complete precision, later.  I do not want to be
>    victim to an incorrect guess, which could be possible.

This is much against Git philosophy of "tracking contents", although there
was talk allowing recording some optional _helper_ information about file
renames, in the proposed 'note' field (header) in commits, but it never
materialized.

You can always say that there was rename (or that file was split into two,
or that file was refactores) in the commit message.

Besides, the place where you want renames detection to work is during
merge. I don't know what would happen if merge base is so far back that
git doesn't recognize rename; on the other hand you get huge conflict
to resolve anyway.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

      parent reply	other threads:[~2007-03-21  0:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 16:10 Rename handling John Goerzen
2007-03-19 18:14 ` Steven Grimm
2007-03-19 18:35   ` Nicolas Pitre
2007-03-19 18:48     ` Linus Torvalds
2007-03-19 19:57       ` Steven Grimm
2007-03-19 20:19         ` Martin Langhoff
2007-03-20  8:33           ` Junio C Hamano
2007-03-19 20:22         ` Linus Torvalds
2007-03-19 20:02       ` Robin Rosenberg
2007-03-19 20:34         ` Linus Torvalds
2007-03-19 19:36     ` Steven Grimm
2007-03-19 19:45       ` Steven Grimm
2007-03-19 20:07         ` Linus Torvalds
2007-03-19 20:17       ` Nicolas Pitre
2007-03-19 20:44       ` Daniel Barkalow
2007-03-19 19:03   ` Andy Parkins
2007-03-19 19:21     ` Steven Grimm
2007-03-21  0:06       ` Jakub Narebski
2007-03-21  0:25         ` Johannes Schindelin
2007-03-21 22:28           ` Steven Grimm
2007-03-21 23:01             ` Johannes Schindelin
2007-03-21 23:10               ` Linus Torvalds
2007-03-22  0:10             ` Martin Langhoff
2007-03-22  2:01               ` Jakub Narebski
2007-03-22  2:39                 ` Martin Langhoff
2007-03-22  3:32                   ` Jakub Narebski
2007-03-22  3:53                     ` Linus Torvalds
2007-03-19 19:15   ` Daniel Barkalow
2007-03-19 19:49   ` John Goerzen
2007-03-19 22:27     ` Junio C Hamano
2007-03-21  0:21 ` Jakub Narebski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='etptkp$2uo$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).