git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Anders Melchiorsen <mail@cup.kalibalik.dk>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Tuncer Ayaz <tuncer.ayaz@gmail.com>,
	git@vger.kernel.org
Subject: Re: correct git merge behavior or corner case?
Date: Mon, 20 Apr 2009 22:51:07 -0400	[thread overview]
Message-ID: <20090421025107.GD14479@coredump.intra.peff.net> (raw)
In-Reply-To: <20090421024433.GC14479@coredump.intra.peff.net>

On Mon, Apr 20, 2009 at 10:44:33PM -0400, Jeff King wrote:

> This is _exactly_ what git's rename detection is designed to do. Yes, it
> seems horribly confusing in this toy example, but that is because it is
> a toy example: both 'date' and 'LICENSE' are empty files. But with real
> files, if a source file has actual content but is deleted, there is a
> new filename with the identical or near-identical content, and the patch
> applies to the new content without conflicts, then applying it there is
> probably exactly what you want.

Looking back over the blog post, it seems that the original question was
not about a toy example, but what looks like some boilerplate that
involved empty files.

Maybe git should refuse to detect exact renames between empty files.
That is easy enough to special-case, and would help people who have
these sorts of boilerplate hierarchies. It would mean that we fail to
automatically resolve something like:

  $ touch foo && git add foo && git commit -m boilerplate
  $ git branch other
  $ echo content >foo && git commit -m 'fill in boilerplate'
  $ git checkout other
  $ git mv foo bar && git commit -m reorganize
  $ git merge master

But the failure case is actually quite reasonable. We just mark it as a
conflict, which is of course trivial for the user to resolve because the
ancestor, by definition, had nothing in it.

-Peff

  reply	other threads:[~2009-04-21  2:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-19 22:40 correct git merge behavior or corner case? Tuncer Ayaz
2009-04-20  3:19 ` Shawn O. Pearce
2009-04-20  9:49 ` Johannes Schindelin
2009-04-20 10:10   ` Anders Melchiorsen
2009-04-21  2:44     ` Jeff King
2009-04-21  2:51       ` Jeff King [this message]
2009-04-21  3:09       ` Junio C Hamano
2009-04-21  8:48         ` Sverre Rabbelier
2009-04-21  8:56           ` Johannes Schindelin
2009-04-21  9:00             ` Sverre Rabbelier
2009-04-21  9:04               ` Johannes Schindelin
2009-04-21  9:01             ` Johannes Schindelin
2009-04-21 17:27               ` Michał Kiedrowicz
2009-04-21 17:54               ` Michał Kiedrowicz
2009-04-21 18:05                 ` Jeff King
2009-04-21 18:47                   ` Michał Kiedrowicz
2009-04-21 19:11                     ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2009-04-20 14:50 François Beausoleil
2009-04-21 19:27 ` Jeff King

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=20090421025107.GD14479@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=mail@cup.kalibalik.dk \
    --cc=tuncer.ayaz@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).