git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cherry-pick fail when a symbolic link has been changed into a file or directory

From
Christian Couder <christian.couder@gmail.com>
Date
Nov 4, 2010, 13:58 UTC
Message-ID
<AANLkTinSxO+UOmY-34wd6ubkc4FffJaxcMWJOKitmGj0@mail.gmail.com>
In-Reply-To
<AANLkTimq8SP-gxZQiXW3Pxg3-1Z98zyPAoNA8JDn0=6A@mail.gmail.com>

On Thu, Nov 4, 2010 at 2:55 PM, Christian Couder <christian.couder@gmail.com> wrote:

Show 8 quoted lines
> 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.
Show 57 quoted lines
> 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
>>
>
Previous: Christian CouderNext: Camille Moncelier
Message 3 of 10 in “cherry-pick fail when a symbolic link has been changed into a file or directory”
  1. Camille MoncelierNov 4, 2010
  2. Christian CouderNov 4, 2010
  3. Christian CouderNov 4, 2010
  4. Camille MoncelierNov 4, 2010
  5. Christian CouderNov 4, 2010
  6. Camille MoncelierNov 4, 2010
  7. Christian CouderNov 5, 2010
  8. Christian CouderNov 5, 2010
  9. Camille MoncelierNov 7, 2010
  10. Andreas SchwabNov 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.