git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git rm" is not a valid merge resolution?
@ 2011-03-21 18:27 Piotr Krukowiecki
  2011-03-21 18:35 ` Matthieu Moy
  2011-03-21 19:32 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Piotr Krukowiecki @ 2011-03-21 18:27 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-03-21 20:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 18:27 "git rm" is not a valid merge resolution? Piotr Krukowiecki
2011-03-21 18:35 ` 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

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).