git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Grimm <koreth@midwinter.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jakub Narebski <jnareb@gmail.com>, git@vger.kernel.org
Subject: Re: Rename handling
Date: Wed, 21 Mar 2007 15:28:41 -0700	[thread overview]
Message-ID: <4601B199.9060300@midwinter.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0703210120230.22628@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin wrote:
> P.S.: It would be so nice if somebody (preferably someone who previously 
> thought manual renames were a pretty clever thing) to write up the 
> arguments, and add that to the "why automatic renaming?" section of the 
> FAQ...
>   

I completely understand the arguments in favor of automatic renaming. I 
have never once advocated getting rid of it. It is useful and valuable 
and works well within its constraints.

For some reason whenever I try to argue that we need, IN ADDITION to the 
automatic rename detection, a way to provide hints to the merge engine 
that a non-auto-detectable rename has occurred, the responses I get back 
are mostly of the form, "But the automatic rename detection handles all 
these cases that wouldn't be handled with manual rename marking!" It's 
as if one can either think autodetection is a good idea, or manual 
flagging is a good idea, but under no circumstances could they both be 
good ideas at the same time. (As evidenced by the comment above about 
"someone who previously thought manual renames were a pretty clever 
thing.") But they are not in fact mutually exclusive.

Say you're tracking a directory full of video files. Even a slight tweak 
to one of them (to put a logo in the corner, say, while moving it into 
an "accessible by the public" directory) will result in a file that has 
no content in common at all if you look at it as purely a stream of 
bytes. Short of decoding the thing to video frames and looking for 
similarities in the images, there's no way any merge tool will ever be 
able to tell the two versions are the same file unless the user 
indicates it. Any tool that saves its files in compressed form will have 
a similar problem: unless git knows how to uncompress the tool's files, 
a content comparison will often be useless to detect similarities.

Of course, git actually does give you a way to mark renames manually: 
commit them by themselves without changing the content. The problem is 
that that overloads the "record this snapshot of the tree for posterity" 
command purely for the purpose of working around the merge tool's 
inability to detect the rename. If other people are like me, when they 
record a rename-only commit immediately followed by a content-change 
commit on the same files, the intermediate state of the tree (with just 
the renames) is not actually an interesting point in the history of the 
project. It's not a revision in anything but an internal git sense. It 
probably doesn't even compile or work correctly. It exists only because 
I'm forced to create it if I want to be 100% certain my renames will be 
tracked accurately. It is, in short, pollution in the history of my project.

It also means that if I want reliable renames, I can no longer impose 
the requirement that my project be in a buildable state at each commit. 
That doesn't seem like all that unreasonable a thing to want (but maybe 
it is?) -- I don't want to be in the situation where I say, e.g. "git 
checkout -b testbranch '@{1 day ago}'" and get a broken working copy 
because I happened to do it at just the wrong time of day. But with the 
"just commit your renames separately" approach, that's exactly what can 
happen.

Now, once again, none of the above is an argument against the automatic 
rename detection. For cases where renames are automatically detectable, 
it works fine and will continue to do so, and in fact doesn't have the 
problem of committing broken builds. I am not arguing it should be 
replaced or that the user should be required to tell git about every 
rename. But the lack of an additional manual option forces me into a 
particular workflow that I wouldn't otherwise use and prevents me from 
imposing the workflow rules I *do* want.

Hopefully that shed a little light on why I think manual rename support 
is not a totally idiotic idea.

-Steve

  reply	other threads:[~2007-03-21 22:28 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 [this message]
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

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=4601B199.9060300@midwinter.com \
    --to=koreth@midwinter.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /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).