cherry-pick applies some other changes than the specified one?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]