git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cherry-pick fail when a symbolic link has been changed into a file or directory
@ 2010-11-04 11:56 Camille Moncelier
  2010-11-04 13:55 ` Christian Couder
  0 siblings, 1 reply; 10+ messages in thread
From: Camille Moncelier @ 2010-11-04 11:56 UTC (permalink / raw)
  To: git

I'm reposting this since I didn't get any responses and I think my
message didn't contained enought context.

I think I may have spotted a bug, or a unhandled case when doing a
cherry-pick

Consider a repository like this:

# Initialize a dummy repository
    mkdir -p repo1 ; cd repo1
    git init .

# Create a new directory `dir1' and a link to it `dir2'
    mkdir dir1
    echo file1 > dir1/file1
    ln -s dir1 dir2
    git add dir1 dir2
    git commit -m "Initial status: dir2 -> dir1"

# Create a branch named `test1' remove the `dir2' link and
# replace it by a new directory
    git checkout -b test1
    git rm dir2
    mkdir dir2
    touch file2 > dir2/file1
    git add dir2/file1
    git commit -m "Removing link: dir1/ and dir2/"

# Now create a new file in `test1' branch
    message="New file in test1"
    echo $message > new_file_test1
    git add new_file_test1
    git commit -m "$message"

# Now try to cherry-pick last commit from `test1' into master
    git co master
    git cherry-pick test1

The cherry-pick fails saying if failed to merge `dir2' despite the fact
that the commit doesn't affect `dir2' and 

git diff test1~..test1 | git apply

is working. Am I doing something wrong ?

-- 
Camille Moncelier
http://devlife.org

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 11:56 cherry-pick fail when a symbolic link has been changed into a file or directory Camille Moncelier
@ 2010-11-04 13:55 ` Christian Couder
  2010-11-04 13:58   ` Christian Couder
  2010-11-04 14:16   ` Camille Moncelier
  0 siblings, 2 replies; 10+ messages in thread
From: Christian Couder @ 2010-11-04 13:55 UTC (permalink / raw)
  To: Camille Moncelier; +Cc: git

Could you try to cherry-pick with other strategies?
For example with:

git cherry-pick --strategy resolve test1

I remember there were some problems with the default "recursive"
strategy and I am not sure they were fixed.
By the way could you tell which version of git you are using?

Thanks,
Christian.

On Thu, Nov 4, 2010 at 12:56 PM, Camille Moncelier
<moncelier@devlife.org> wrote:
> I'm reposting this since I didn't get any responses and I think my
> message didn't contained enought context.
>
> I think I may have spotted a bug, or a unhandled case when doing a
> cherry-pick
>
> Consider a repository like this:
>
> # Initialize a dummy repository
>    mkdir -p repo1 ; cd repo1
>    git init .
>
> # Create a new directory `dir1' and a link to it `dir2'
>    mkdir dir1
>    echo file1 > dir1/file1
>    ln -s dir1 dir2
>    git add dir1 dir2
>    git commit -m "Initial status: dir2 -> dir1"
>
> # Create a branch named `test1' remove the `dir2' link and
> # replace it by a new directory
>    git checkout -b test1
>    git rm dir2
>    mkdir dir2
>    touch file2 > dir2/file1
>    git add dir2/file1
>    git commit -m "Removing link: dir1/ and dir2/"
>
> # Now create a new file in `test1' branch
>    message="New file in test1"
>    echo $message > new_file_test1
>    git add new_file_test1
>    git commit -m "$message"
>
> # Now try to cherry-pick last commit from `test1' into master
>    git co master
>    git cherry-pick test1
>
> The cherry-pick fails saying if failed to merge `dir2' despite the fact
> that the commit doesn't affect `dir2' and
>
> git diff test1~..test1 | git apply
>
> is working. Am I doing something wrong ?
>
> --
> Camille Moncelier
> http://devlife.org
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 13:55 ` Christian Couder
@ 2010-11-04 13:58   ` Christian Couder
  2010-11-04 14:16   ` Camille Moncelier
  1 sibling, 0 replies; 10+ messages in thread
From: Christian Couder @ 2010-11-04 13:58 UTC (permalink / raw)
  To: Camille Moncelier; +Cc: git

On Thu, Nov 4, 2010 at 2:55 PM, Christian Couder
<christian.couder@gmail.com> wrote:
> Could you try to cherry-pick with other strategies?
> For example with:
>
> git cherry-pick --strategy resolve test1
>
> I remember there were some problems with the default "recursive"
> strategy and I am not sure they were fixed.
> By the way could you tell which version of git you are using?

PS: Sorry for top-posting. Please don't answer like I just did.

> On Thu, Nov 4, 2010 at 12:56 PM, Camille Moncelier
> <moncelier@devlife.org> wrote:
>> I'm reposting this since I didn't get any responses and I think my
>> message didn't contained enought context.
>>
>> I think I may have spotted a bug, or a unhandled case when doing a
>> cherry-pick
>>
>> Consider a repository like this:
>>
>> # Initialize a dummy repository
>>    mkdir -p repo1 ; cd repo1
>>    git init .
>>
>> # Create a new directory `dir1' and a link to it `dir2'
>>    mkdir dir1
>>    echo file1 > dir1/file1
>>    ln -s dir1 dir2
>>    git add dir1 dir2
>>    git commit -m "Initial status: dir2 -> dir1"
>>
>> # Create a branch named `test1' remove the `dir2' link and
>> # replace it by a new directory
>>    git checkout -b test1
>>    git rm dir2
>>    mkdir dir2
>>    touch file2 > dir2/file1
>>    git add dir2/file1
>>    git commit -m "Removing link: dir1/ and dir2/"
>>
>> # Now create a new file in `test1' branch
>>    message="New file in test1"
>>    echo $message > new_file_test1
>>    git add new_file_test1
>>    git commit -m "$message"
>>
>> # Now try to cherry-pick last commit from `test1' into master
>>    git co master
>>    git cherry-pick test1
>>
>> The cherry-pick fails saying if failed to merge `dir2' despite the fact
>> that the commit doesn't affect `dir2' and
>>
>> git diff test1~..test1 | git apply
>>
>> is working. Am I doing something wrong ?
>>
>> --
>> Camille Moncelier
>> http://devlife.org
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 13:55 ` Christian Couder
  2010-11-04 13:58   ` Christian Couder
@ 2010-11-04 14:16   ` Camille Moncelier
  2010-11-04 17:03     ` Christian Couder
  1 sibling, 1 reply; 10+ messages in thread
From: Camille Moncelier @ 2010-11-04 14:16 UTC (permalink / raw)
  To: git; +Cc: Christian Couder

On Thu, 4 Nov 2010 14:55:12 +0100
Christian Couder <christian.couder@gmail.com> wrote:

> Could you try to cherry-pick with other strategies?
> For example with:
> 
> git cherry-pick --strategy resolve test1

~/repo1$ git --version
git version 1.7.3.1

~/repo1$ git cherry-pick --strategy resolve test1
Trying simple merge.
Simple merge failed, trying Automatic merge.
[master da2d5bf] New file in test1
 1 files changed, 1 insertions(+), 
 create mode 100644 new_file_test1

Seems it is working using the resolve strategy. I may have found a
message on this list posted a while ago:

"cherry-picking a commit clobbers a file which is a directory in the
target commit"

Which seems to deal with the same kind of problems maybe something is
missing in the patch in order to handle this particular case.

> I remember there were some problems with the default "recursive"
> strategy and I am not sure they were fixed.
> By the way could you tell which version of git you are using?

I'm using ubuntu's 1.7.1 version on my laptop which doesn't support
--strategy and a v1.7.3.1 on another computer, both expose the same
problem.

> 
> Thanks,
> Christian.

--
Camille Moncelier
http://devlife.org

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 14:16   ` Camille Moncelier
@ 2010-11-04 17:03     ` Christian Couder
  2010-11-04 17:15       ` Camille Moncelier
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Couder @ 2010-11-04 17:03 UTC (permalink / raw)
  To: Camille Moncelier; +Cc: git, Elijah Newren, Nick

On Thu, Nov 4, 2010 at 3:16 PM, Camille Moncelier <moncelier@devlife.org> wrote:
> On Thu, 4 Nov 2010 14:55:12 +0100
> Christian Couder <christian.couder@gmail.com> wrote:
>
>> Could you try to cherry-pick with other strategies?
>> For example with:
>>
>> git cherry-pick --strategy resolve test1
>
> ~/repo1$ git --version
> git version 1.7.3.1
>
> ~/repo1$ git cherry-pick --strategy resolve test1
> Trying simple merge.
> Simple merge failed, trying Automatic merge.
> [master da2d5bf] New file in test1
>  1 files changed, 1 insertions(+),
>  create mode 100644 new_file_test1
>
> Seems it is working using the resolve strategy. I may have found a
> message on this list posted a while ago:
>
> "cherry-picking a commit clobbers a file which is a directory in the
> target commit"
>
> Which seems to deal with the same kind of problems maybe something is
> missing in the patch in order to handle this particular case.

Please reply not only to me but also to the list and add relevant
people in Cc: like I did.

Elijah Newren sent a patch series around September the 20th but I did
not check to see if this series was merged into pu, next or master.
And I don't know if it fixes your problem.
Could you have a look?

Thanks,
Christian.

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 17:03     ` Christian Couder
@ 2010-11-04 17:15       ` Camille Moncelier
  2010-11-05  8:33         ` Christian Couder
       [not found]         ` <AANLkTimDWM69qvY5wdyzFu=g6htg12-K542PRR4bdDYq@mail.gmail.com>
  0 siblings, 2 replies; 10+ messages in thread
From: Camille Moncelier @ 2010-11-04 17:15 UTC (permalink / raw)
  To: git; +Cc: Christian Couder, Elijah Newren, Nick

On Thu, 4 Nov 2010 18:03:39 +0100
Christian Couder <christian.couder@gmail.com> wrote:

> Please reply not only to me but also to the list and add relevant
> people in Cc: like I did.
It replied to the list[1] and CC'ed you. I use claws mail + gmane NNTP
gateway. Maybe I did something wrong but it seems that the message has
been successfully delivered to the list.

[1] http://article.gmane.org/gmane.comp.version-control.git/160722 
> 
> Elijah Newren sent a patch series around September the 20th but I did
> not check to see if this series was merged into pu, next or master.
> And I don't know if it fixes your problem.
> Could you have a look?
I think I already took a look last week, and I think they were merged
in 1.7.1 or 1.7.2 although I'm not sure. I'll take another look. This
evening or maybe tomorrow.

> 
> Thanks,
> Christian.

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-04 17:15       ` Camille Moncelier
@ 2010-11-05  8:33         ` Christian Couder
       [not found]         ` <AANLkTimDWM69qvY5wdyzFu=g6htg12-K542PRR4bdDYq@mail.gmail.com>
  1 sibling, 0 replies; 10+ messages in thread
From: Christian Couder @ 2010-11-05  8:33 UTC (permalink / raw)
  To: Camille Moncelier; +Cc: Elijah Newren, Nick, git

On Thu, Nov 4, 2010 at 6:15 PM, Camille Moncelier <moncelier@devlife.org> wrote:
> On Thu, 4 Nov 2010 18:03:39 +0100
> Christian Couder <christian.couder@gmail.com> wrote:
>
>> Please reply not only to me but also to the list and add relevant
>> people in Cc: like I did.
> It replied to the list[1] and CC'ed you. I use claws mail + gmane NNTP
> gateway. Maybe I did something wrong but it seems that the message has
> been successfully delivered to the list.
>
> [1] http://article.gmane.org/gmane.comp.version-control.git/160722

Yeah, sorry, I use gmail and I don't know why but it doesn't show the
list in "To:" or "Cc:".

Regards,
Christian.

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
       [not found]         ` <AANLkTimDWM69qvY5wdyzFu=g6htg12-K542PRR4bdDYq@mail.gmail.com>
@ 2010-11-05  8:34           ` Christian Couder
  2010-11-07  9:42             ` Camille Moncelier
  0 siblings, 1 reply; 10+ messages in thread
From: Christian Couder @ 2010-11-05  8:34 UTC (permalink / raw)
  To: Elijah Newren; +Cc: Camille Moncelier, Nick, git

On Fri, Nov 5, 2010 at 5:54 AM, Elijah Newren <newren@gmail.com> wrote:
> Hi,
>
> Sorry, I've been missing in action for about a month, but I'll have
> some time this weekend to catch back up on git stuff...
>
> On Thu, Nov 4, 2010 at 11:15 AM, Camille Moncelier
> <moncelier@devlife.org> wrote:
>> On Thu, 4 Nov 2010 18:03:39 +0100
>> Christian Couder <christian.couder@gmail.com> wrote:
>>> Elijah Newren sent a patch series around September the 20th but I did
>>> not check to see if this series was merged into pu, next or master.
>>> And I don't know if it fixes your problem.
>>> Could you have a look?
>> I think I already took a look last week, and I think they were merged
>> in 1.7.1 or 1.7.2 although I'm not sure. I'll take another look. This
>> evening or maybe tomorrow.

Great!

> The patch series I posted in late September post-dates the related
> series of mine that were merged in 1.7.3.
>
> I'd also be happy to take a look and see if my newer merge-recursive
> series fixes your case (or whether one of my other improvements to
> that series since my September posting does).  If not, I'll track it
> down and fix it and add that fix to the series.

Great!

Thanks both,
Christian.

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-05  8:34           ` Christian Couder
@ 2010-11-07  9:42             ` Camille Moncelier
  2010-11-07 10:19               ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Camille Moncelier @ 2010-11-07  9:42 UTC (permalink / raw)
  To: Christian Couder; +Cc: Elijah Newren, Nick, git

> > The patch series I posted in late September post-dates the related
> > series of mine that were merged in 1.7.3.
> >
> > I'd also be happy to take a look and see if my newer merge-recursive
> > series fixes your case (or whether one of my other improvements to
> > that series since my September posting does).  If not, I'll track it
> > down and fix it and add that fix to the series.
> 
It's strange I've just tested on my laptop and it seems fixed in
v1.7.3. I'll redo the test this week on the repository I've first
experienced the problem, just to see if the problem is really gone or 
my testcase isn't sufficient.

I've tried to use git bisect to check the patch which fixed the problem
but, I didn't succeed. 

BTW, Is there a way using git bisect to find the "last bad commit",
or maybe the "first good one" ?

> Great!
> 
> Thanks both,
> Christian.

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

* Re: cherry-pick fail when a symbolic link has been changed into a file or directory
  2010-11-07  9:42             ` Camille Moncelier
@ 2010-11-07 10:19               ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2010-11-07 10:19 UTC (permalink / raw)
  To: Camille Moncelier; +Cc: Christian Couder, Elijah Newren, Nick, git

Camille Moncelier <moncelier@devlife.org> writes:

> BTW, Is there a way using git bisect to find the "last bad commit",
> or maybe the "first good one" ?

It works the same as "find first bad one", you just have to exchange
"good" and "bad" (they really mean "before" and "after").

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

end of thread, other threads:[~2010-11-07 10:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 11:56 cherry-pick fail when a symbolic link has been changed into a file or directory Camille Moncelier
2010-11-04 13:55 ` Christian Couder
2010-11-04 13:58   ` Christian Couder
2010-11-04 14:16   ` Camille Moncelier
2010-11-04 17:03     ` Christian Couder
2010-11-04 17:15       ` Camille Moncelier
2010-11-05  8:33         ` Christian Couder
     [not found]         ` <AANLkTimDWM69qvY5wdyzFu=g6htg12-K542PRR4bdDYq@mail.gmail.com>
2010-11-05  8:34           ` Christian Couder
2010-11-07  9:42             ` Camille Moncelier
2010-11-07 10:19               ` Andreas Schwab

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