git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cherry-pick applies some other changes than the specified one?
@ 2011-03-21  9:27 Piotr Krukowiecki
  2011-03-21 16:09 ` Junio C Hamano
  0 siblings, 1 reply; 13+ messages in thread
From: Piotr Krukowiecki @ 2011-03-21  9:27 UTC (permalink / raw)
  To: Git Mailing List

Hi,

I'm cherry-picking one commint between branches. The commit is a simple
one-line addition, something like:

--- a/etc/file
+++ b/etc/file
@@ -2613,6 +2613,7 @@
line1
line2
+   line3
line4
line5


There's a conflict during the cherry-pick. git status shows:

$ git status
# On branch 9_0
# Unmerged paths:
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#	both modified:      etc/file
#
no changes added to commit (use "git add" and/or "git commit -a")

git diff shows a lot of changes:

diff --cc etc/file
index 815c28f,b8a48da..0000000
--- a/etc/file
+++ b/etc/file
@@@ -2700,83 -2611,10 +2700,89 @@@
[...]
++<<<<<<< HEAD
 +    line
 +    line
[...]
++=======
+     here I basically can see what's code
+     look like in the commit I want to merge
++>>>>>>> c64e8ca...
       line
 +    line
[...]


If I edit the file and remove the "<<<< HEAD" marked and code
between "===" and ">>>"  then

1. git status shows there are unmerged files:

$ git status
# On branch 9_0
# Unmerged paths:
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#	both modified:      etc/file
#
no changes added to commit (use "git add" and/or "git commit -a")

2. git diff shows nothing:

$ git diff
diff --cc etc/file
index 815c28f,b8a48da..0000000
--- a/etc/file
+++ b/etc/file

3. git diff --cached shows error? warning? info?

$ git diff --cached
* Unmerged path etc/file

4. When I git add the file then git status, git diff, git diff
--cached shows nothing:

$ git add etc/file
$ git status
# On branch 9_0
nothing to commit (working directory clean)
$ git diff
$ git diff --cached


But when I take a different approach, and in addition to this:

> If I edit the file and remove the "<<<< HEAD" marked and code
> between "===" and ">>>"  then

I also manually add the "+line" which is the change done in the cherry-picked
commit, git diff shows a lot of other changes in unrelated lines
(which lie close
but still were not modified by the patch, nor were shown previously by
git diff).


This is very weird. I understand the information I provided was very scarce,
but does anyone know what could be happening?
Or do I have to try to reproduce this behaviour and post the steps to do so?

It might be somehow related to git-svn or git-new-workdir ...

-- 
Piotr Krukowiecki

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

end of thread, other threads:[~2011-03-22  8:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21  9:27 cherry-pick applies some other changes than the specified one? Piotr Krukowiecki
2011-03-21 16:09 ` Junio C Hamano
2011-03-21 16:41   ` Johannes Sixt
2011-03-21 18:12     ` Piotr Krukowiecki
2011-03-21 19:47       ` Junio C Hamano
2011-03-21 20:06         ` Piotr Krukowiecki
2011-03-21 19:58       ` Jonathan Nieder
2011-03-21 20:07         ` Piotr Krukowiecki
2011-03-21 20:21           ` Junio C Hamano
2011-03-21 20:54             ` Junio C Hamano
2011-03-22  5:27               ` Jonathan Nieder
2011-03-22  6:37                 ` Junio C Hamano
2011-03-22  8:04       ` Piotr Krukowiecki

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