git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gladysh <agladysh@gmail.com>
To: git@vger.kernel.org
Subject: Cherry-pick with symlinks fails horribly
Date: Tue, 9 Mar 2010 04:28:30 +0300	[thread overview]
Message-ID: <c6c947f61003081728u48292de4x6f2c26e1ea9c1756@mail.gmail.com> (raw)

Hi, list!

OS X 10.6.2
Git 1.7.0.2

I'm complaining about Git symlink handling again. This time it is cherry-pick.

In my repo I have a symlink pointing to a directory.

I swap symlink with the directory in a single commit.

Now, if I try to cherry-pick any later commit from the branch that has
that swap commit to a branch that have not, cherry-pick fails
horribly.

See script to reproduce the bug below (run it in a clean directory).

Output example:

$ git cherry-pick <SHA>

Automatic cherry-pick failed.  After resolving the conflicts,
mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
and commit the result with:

        git commit -c 6a398597ce7a00fe05f43ff88808303eb151dfb5

$ git status # Note the "Untracked files" section

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	renamed:    a/f -> f1
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#	added by us:        b/a
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#	b/a~HEAD

(Also I've seen git reset --hard to fail afterwards, complaining it
can't delete a directory, but I can't reproduce it now.)

I see a similar behaviour if I try to do interactive rebase accross
symlink swap commit.

Alexander.

#! /bin/bash

git init

mkdir a
touch a/f
git add a
git commit -m "a"

mkdir b
ln -s ../a b/a
git add b
git commit -m "b"

git checkout -b branch
rm b/a
mv a b/
ln -s b/a a
git add .
git commit -m "swap"

touch f1
git add f1
git commit -m "f1"

git checkout master

git cherry-pick `git rev-parse branch` # This one breaks horribly

             reply	other threads:[~2010-03-09 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09  1:28 Alexander Gladysh [this message]
2010-03-10 18:54 ` Cherry-pick with symlinks fails horribly Alexander Gladysh
2010-03-11  4:57 ` Christian Couder
2010-03-11 12:16   ` Alexander Gladysh
2010-03-12  3:48     ` Christian Couder
2010-03-12  5:49       ` Junio C Hamano
2010-03-25  5:01         ` Christian Couder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6c947f61003081728u48292de4x6f2c26e1ea9c1756@mail.gmail.com \
    --to=agladysh@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).