From: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Subject: "git rm" is not a valid merge resolution?
Date: Mon, 21 Mar 2011 19:27:14 +0100 [thread overview]
Message-ID: <4D879882.4070608@gmail.com> (raw)
Hi,
git-status shows a hint that says
use "git add/rm <file>..." as appropriate to mark resolution
But if I "git rm file" the file gets deleted. Is this really the
appropriate merge resolution?
I would expect "git rm" to maybe reset all the merge changes but
it seems to just delete the file.
I doubt that when you get merge conflicts you would like to delete
the file. That might be the case when in one of merge parents
the file was deleted, but not if both files existed.
When deleting the file it shows a message "needs merge", perhaps
the intention was to not delete the file in such case?
So maybe:
- don't list "rm" as appropriate to mark resolution, or
- list it only if the files was deleted on one parent
Example:
$ git init
$ echo a > a
$ git add a
$ git commit -a -m a
$ echo b > a
$ git commit -a -m b
$ git checkout -b topic HEAD^
$ echo c > a
$ git commit -a -m c
$ git merge master
Auto-merging a
CONFLICT (content): Merge conflict in a
Automatic merge failed; fix conflicts and then commit the result.
$ git status
# On branch topic
# Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: a
#
no changes added to commit (use "git add" and/or "git commit -a")
$ git rm a
a: needs merge
rm 'a'
$ git status
# On branch topic
# Changes to be committed:
#
# deleted: a
#
--
Piotr Krukowiecki
next reply other threads:[~2011-03-21 18:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 18:27 Piotr Krukowiecki [this message]
2011-03-21 18:35 ` "git rm" is not a valid merge resolution? Matthieu Moy
2011-03-21 19:56 ` Piotr Krukowiecki
2011-03-21 19:32 ` Junio C Hamano
2011-03-21 20:01 ` Piotr Krukowiecki
2011-03-21 20:24 ` Junio C Hamano
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=4D879882.4070608@gmail.com \
--to=piotr.krukowiecki@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).