From: Jakub Narebski <jnareb@gmail.com>
To: Matthew Clemence <matthew.clemence@virgin.net>
Cc: git@vger.kernel.org
Subject: Re: Suggested workflow for frequent directory renames.
Date: Tue, 26 May 2009 02:24:16 -0700 (PDT) [thread overview]
Message-ID: <m37i04cj45.fsf@localhost.localdomain> (raw)
In-Reply-To: <4A1B352C.9030409@virgin.net>
Matthew Clemence <matthew.clemence@virgin.net> writes:
> I am working with an externally supplied code tree (some 2000 files,
> which gets passed to me without any SCM) and have multiple users
> working on their own individual branched versions under git
> control. The problem I am facing is that there are frequenct directory
> renames when the code updates which I need to find a relatively
> painless way of bringing the users branches up to date.
Hmmm... are you sure you are solving the correct problem? Can't you
avoid directory renames, e.g. by munging position of files before
entering them into SCM?
> From reading
> the lists and faq, there seems to be problems (and strong opinions)
> with this, and I am struggling to find an effcient model to manage
> this merging - either git loses track of the users changed files (and
> so have to be manually merged from diff files and usually lose
> history) or git loses track of everything else (and I end up manually
> adding files from the new tree to get out of merge conflict).
>
> I would be very interested to hear if anyone has a suggestion on how
> this could best be handled.
Git, contrary to other version control systems such as Mercurial or
Bazaar, doesn't use tracking of renames (either via recording rename
event, or by using file identities / inodes), but heuristic similarity
based rename _detection_. If the files are of sufficient size
compared to changes, rename detection should work well and when
merging changes should be applied to correct files / correct files
would be renamed. Changing directory the file resides in is currently
in Git just the form of changing pathname of a file, i.e. renaming of
a file. Rename detection uses similarity of filename as one of
factors so if basename didn't change git should correctly pair files.
The problem currently is when one side renames directory, and other
side creates new file in the old-name directory. Rename tracking
would not help here unless SCM track also directory renames, like
Bazaar reportedly does.
But the problem is not impossible to overcome using rename detection
like in git. There were even patches adding detection of wholesame
directory renaming (factoring out directory renames out of set of
detected file renames) by Yann Dirson, but they were not accepted for
some reason. You migh want to either contact author, or clean up the
series and send them yourself (if possibly with use cases and success
stories):
http://thread.gmane.org/gmane.comp.version-control.git/99529
See also directory rename detection script (in Perl) in
http://permalink.gmane.org/gmane.comp.version-control.git/81547
BTW. This issue was discussed extensively on git mailing list...
--
Jakub Narebski
Poland
prev parent reply other threads:[~2009-05-26 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 0:17 Suggested workflow for frequent directory renames Matthew Clemence
2009-05-26 9:24 ` 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=m37i04cj45.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=matthew.clemence@virgin.net \
/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).