All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Andreas Krey <a.krey@gmx.de>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>, git@vger.kernel.org
Subject: Re: Branch merge bug
Date: Tue, 19 Jan 2010 14:58:35 +0100	[thread overview]
Message-ID: <4B55BA8B.5010600@drmicha.warpmail.net> (raw)
In-Reply-To: <20100119123915.GB28667@inner.home.ulmdo.de>

Andreas Krey venit, vidit, dixit 19.01.2010 13:39:
> On Tue, 19 Jan 2010 13:07:28 +0000, Michael J Gruber wrote:
> ...
>> If you really mean to modify and rename an existing file, then tell Git so:
>>
>> git mv fil fila
>> git commit -m 'we need a new name'
>>
>> instead of your 'git rm fil' will record your intentions (not only for
>> Git, but also for everyone else reading your log, such as you a year
>> from now) and will make the merge succeed.
> 
> The intention would only be known informally in the commit message,
> as 'git mv' just removes the old and adds the new file, and still
> leave the work to the rename detection.
> 
> Indeed, changing
>   >: git rm fil
>   >: echo asjhdajkhsdkajhs >fila
>   >: git add fila
> to
>   >: git mv fil fila
>   >: echo asjhdajkhsdkajhs >fila
>   >: git add fila
> and even to
>   >: git mv fil fila
>   >: git cm 'other mv'
>   >: echo asjhdajkhsdkajhs >fila
>   >: git add fila
> still gives the same rename/delete conflict because the rename
> detection does not look at every single commit but only at
> the total changes.

Well, the solution I proposed (mv + commit rather than rm) certainly
works for me, I tested it before. I have diff.renames=copies in my
config but I don't think it should matter.

Michael

      parent reply	other threads:[~2010-01-19 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19  7:22 Branch merge bug Ramkumar Ramachandra
2010-01-19 12:07 ` Michael J Gruber
2010-01-19 12:39   ` Andreas Krey
2010-01-19 13:22     ` Ramkumar Ramachandra
2010-01-19 13:58     ` Michael J Gruber [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=4B55BA8B.5010600@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=a.krey@gmx.de \
    --cc=artagnon@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.