git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Directory replaced with a file confuses cherry-pick
@ 2011-02-18 14:06 Alexey Feldgendler
  2011-02-18 14:44 ` Johan Herland
  2011-02-18 15:30 ` Nick
  0 siblings, 2 replies; 8+ messages in thread
From: Alexey Feldgendler @ 2011-02-18 14:06 UTC (permalink / raw)
  To: git


Hello!

I think I've found a bug. Here is how to reproduce.

1. Create an empty repo.
2. Add the following: file.txt containing "before" and directory problem/  
with file problem/content containing "data". Commit this.
3. From here, create a branch and commit a change to file.txt: change it  
to say "after".
4. Checkout master.
5. Remove directory problem/ and add a file with the same name (problem)  
containing "newdata". Commit this.
6. Try to cherry-pick the commit you made on the side branch on step 3.

Here is what you see:

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 64f21a85fa3deb4d3952b0471f442a76e5147b05

And git-status says:

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

Expected result: the cherry-pick goes smoothly. The change I'm  
cherry-picking (modification of file.txt) has nothing to do with the  
problem file/directory. Trying to cherry-pick anything from branches that  
stem off from before the change of a directory to a file fails like this.

Known? Is replacing directories with files maybe a taboo?


-- 
Alexey Feldgendler
Software Developer, Desktop Team, Opera Software ASA
[ICQ: 115226275] http://my.opera.com/feldgendler/

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

* Directory replaced with a file confuses cherry-pick
@ 2011-02-18 14:24 Alexey Feldgendler
  2011-02-18 14:27 ` Alexey Feldgendler
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Feldgendler @ 2011-02-18 14:24 UTC (permalink / raw)
  To: git


Hello!

I think I've found a bug. Here is how to reproduce.

1. Create an empty repo.
2. Add the following: file.txt containing "before" and directory problem/
with file problem/content containing "data". Commit this.
3. From here, create a branch and commit a change to file.txt: change it
to say "after".
4. Checkout master.
5. Remove directory problem/ and add a file with the same name (problem)
containing "newdata". Commit this.
6. Try to cherry-pick the commit you made on the side branch on step 3.

Here is what you see:

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 64f21a85fa3deb4d3952b0471f442a76e5147b05

And git-status says:

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

Expected result: the cherry-pick goes smoothly. The change I'm
cherry-picking (modification of file.txt) has nothing to do with the
problem file/directory. Trying to cherry-pick anything from branches that
stem off from before the change of a directory to a file fails like this.

Known? Is replacing directories with files maybe a taboo?


-- 
Alexey Feldgendler
Software Developer, Desktop Team, Opera Software ASA
[ICQ: 115226275] http://my.opera.com/feldgendler/

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 14:24 Directory replaced with a file confuses cherry-pick Alexey Feldgendler
@ 2011-02-18 14:27 ` Alexey Feldgendler
  0 siblings, 0 replies; 8+ messages in thread
From: Alexey Feldgendler @ 2011-02-18 14:27 UTC (permalink / raw)
  To: git

On Fri, 18 Feb 2011 15:24:14 +0100, Alexey Feldgendler <alexeyf@opera.com>  
wrote:

> I think I've found a bug. Here is how to reproduce.

Sorry for the dupe. Mailer screwup.


-- 
Alexey Feldgendler
Software Developer, Desktop Team, Opera Software ASA
[ICQ: 115226275] http://my.opera.com/feldgendler/

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 14:06 Alexey Feldgendler
@ 2011-02-18 14:44 ` Johan Herland
  2011-02-18 14:49   ` Alexey Feldgendler
  2011-02-18 15:30 ` Nick
  1 sibling, 1 reply; 8+ messages in thread
From: Johan Herland @ 2011-02-18 14:44 UTC (permalink / raw)
  To: Alexey Feldgendler; +Cc: git

On Friday 18 February 2011, Alexey Feldgendler wrote:
> Hello!
> 
> I think I've found a bug. Here is how to reproduce.
> 
> 1. Create an empty repo.
> 2. Add the following: file.txt containing "before" and directory problem/
> with file problem/content containing "data". Commit this.
> 3. From here, create a branch and commit a change to file.txt: change it
> to say "after".
> 4. Checkout master.
> 5. Remove directory problem/ and add a file with the same name (problem)
> containing "newdata". Commit this.
> 6. Try to cherry-pick the commit you made on the side branch on step 3.
> 
> Here is what you see:
> 
> Automatic cherry-pick failed.
> [...]

Unable to reproduce. Here are the commands I used (please post yours):

$ git init
$ echo before > file.txt
$ mkdir problem
$ echo data > problem/content
$ git add .
$ git commit -m first
$ git checkout -b side
$ echo after > file.txt 
$ git commit -a -m side-commit
$ git checkout master
$ git rm -r problem # or: rm -rf problem
$ echo newdata > problem
$ git add problem # this is important!
$ git commit -m second
$ git cherry-pick side
[master b975587] side-commit
 1 files changed, 1 insertions(+), 1 deletions(-)

No conflict in the cherry-pick.

> And git-status says:
> 
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #       modified:   file.txt
> #
> # Unmerged paths:
> #   (use "git reset HEAD <file>..." to unstage)
> #   (use "git add/rm <file>..." as appropriate to mark resolution)
> #
> #       added by us:        problem
> #
> # Untracked files:
> #   (use "git add <file>..." to include in what will be committed)
> #
> #       problem~HEAD

I cannot easily see how you got into this state. Maybe you forgot to 'git 
add' the "problem" file before making the second commit?

> Expected result: the cherry-pick goes smoothly. The change I'm
> cherry-picking (modification of file.txt) has nothing to do with the
> problem file/directory.

Agreed. And that's exactly what I'm seeing above.

> Trying to cherry-pick anything from branches that
> stem off from before the change of a directory to a file fails like this.

This should not be the case. Which Git version are you using?

> Known? Is replacing directories with files maybe a taboo?

Nope. dir->file replacements should not be problematic.


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 14:44 ` Johan Herland
@ 2011-02-18 14:49   ` Alexey Feldgendler
  2011-02-18 15:17     ` Johan Herland
  0 siblings, 1 reply; 8+ messages in thread
From: Alexey Feldgendler @ 2011-02-18 14:49 UTC (permalink / raw)
  To: git

On Fri, 18 Feb 2011 15:44:05 +0100, Johan Herland <johan@herland.net>  
wrote:

> Unable to reproduce. Here are the commands I used (please post yours):

I tried your exact script now, line by line, and it failed in the way I  
described.

> This should not be the case. Which Git version are you using?

git is from Debian testing, package version 1:1.7.2.3-2.2.


-- 
Alexey Feldgendler
Software Developer, Desktop Team, Opera Software ASA
[ICQ: 115226275] http://my.opera.com/feldgendler/

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 14:49   ` Alexey Feldgendler
@ 2011-02-18 15:17     ` Johan Herland
  0 siblings, 0 replies; 8+ messages in thread
From: Johan Herland @ 2011-02-18 15:17 UTC (permalink / raw)
  To: Alexey Feldgendler; +Cc: git

(please don't cull the CC list when replying)

On Friday 18 February 2011, Alexey Feldgendler wrote:
> On Fri, 18 Feb 2011 15:44:05 +0100, Johan Herland <johan@herland.net>
> 
> wrote:
> > Unable to reproduce. Here are the commands I used (please post yours):
> I tried your exact script now, line by line, and it failed in the way I
> described.
> 
> > This should not be the case. Which Git version are you using?
> 
> git is from Debian testing, package version 1:1.7.2.3-2.2.

I'm going away for the weekend, so I can't investigate this right now. Could 
you please retry with a more recent Git? Maybe someone else already knows 
which patch might have fixed this issue?


Have fun! :)

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 14:06 Alexey Feldgendler
  2011-02-18 14:44 ` Johan Herland
@ 2011-02-18 15:30 ` Nick
  2011-02-18 20:00   ` Junio C Hamano
  1 sibling, 1 reply; 8+ messages in thread
From: Nick @ 2011-02-18 15:30 UTC (permalink / raw)
  To: Alexey Feldgendler; +Cc: git

On 18/02/11 14:06, Alexey Feldgendler wrote:
> I think I've found a bug. Here is how to reproduce.

It looks like one I found in 1.7.0.4 - for which Elijah Newren submitted some
patches, although I don't happen to know what their current status is.

  http://comments.gmane.org/gmane.comp.version-control.git/155147

N

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

* Re: Directory replaced with a file confuses cherry-pick
  2011-02-18 15:30 ` Nick
@ 2011-02-18 20:00   ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2011-02-18 20:00 UTC (permalink / raw)
  To: Nick; +Cc: Alexey Feldgendler, git

Nick <oinksocket@letterboxes.org> writes:

> On 18/02/11 14:06, Alexey Feldgendler wrote:
>> I think I've found a bug. Here is how to reproduce.
>
> It looks like one I found in 1.7.0.4 - for which Elijah Newren submitted some
> patches, although I don't happen to know what their current status is.
>
>   http://comments.gmane.org/gmane.comp.version-control.git/155147

Isn't v1.7.4-rc0~101 a polished version of that one?

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

end of thread, other threads:[~2011-02-18 20:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-18 14:24 Directory replaced with a file confuses cherry-pick Alexey Feldgendler
2011-02-18 14:27 ` Alexey Feldgendler
  -- strict thread matches above, loose matches on Subject: below --
2011-02-18 14:06 Alexey Feldgendler
2011-02-18 14:44 ` Johan Herland
2011-02-18 14:49   ` Alexey Feldgendler
2011-02-18 15:17     ` Johan Herland
2011-02-18 15:30 ` Nick
2011-02-18 20:00   ` Junio C Hamano

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