git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hakim Cassimally <hakim.cassimally@gmail.com>
To: git@vger.kernel.org, Sam Vilain <sam@vilain.net>
Subject: Re: git-cherry-pick problem - directory not touched by commit is  marked "added by us"
Date: Wed, 6 Jan 2010 11:28:44 +0000	[thread overview]
Message-ID: <82cfa8031001060328r21aa8de3s5c2dd5dac005b679@mail.gmail.com> (raw)
In-Reply-To: <1262727434.22597.8.camel@denix>

2010/1/5 Sam Vilain <sam@vilain.net>:
> On Tue, 2010-01-05 at 12:33 +0000, Hakim Cassimally wrote:
>> I got into a bit of trouble with a git-cherry-pick last night, and
>> though mugwump
>> and others on #git helped me as far as a workaround,
> Yes, that was me.  I'm very confused by the bug, too.
>
>  [...]
>> WHAT HAPPENS
>> ============
>>
>> When I'm in (stable), and try to cherry-pick the change from (experimental),
>> git thinks that I'm making a massive number of changes in a directory that
>> wasn't touched by the relevant commit.
>  [...]
>>     (stable) $ git --version
>>     git version 1.6.6
>>     # I tried previously on 1.6.0.4 but upgraded in case it helped
>>
>>     (stable) $ git status
>>     # On branch stable
>>     # nothing to commit (working directory clean)
>>
>>     (stable) $ git show --stat 301afce1
>>     commit 301afce1c78380276d208077ef4ec76b469c1024
>>     Author: osfameron <...>
>>     Date:   Wed Dec 23 23:45:20 2009 +0000
>>
>>         Proof of concept for import module (parse Excel)
>>
>>      bin/upload_module.pl |  142
>> ++++++++++++++++++++++++++++++++++++++++++++++++++
>>      1 files changed, 142 insertions(+), 0 deletions(-)
>>
>>     (stable) $ git whatchanged -1 301afce1
>>     commit 301afce1c78380276d208077ef4ec76b469c1024
>>     Author: osfameron <...>
>>     Date:   Wed Dec 23 23:45:20 2009 +0000
>>
>>         Proof of concept for import module (parse Excel)
>>
>>     :000000 100644 0000000... c90e261... A  bin/upload_module.pl
>
> So by here, we know that the commit only affects that single file.  No
> funny stuff like mode changes of other files.
>
>>     (stable) $ git cherry-pick 301afce1
>>     Finished one cherry-pick.
>>     www/client/css/admin.css: needs merge
>>         <...snip>
>>     www/client/css/admin.css: unmerged
>> (8e7cd850bf40d1a921b1f62ce0945abd374fa55d)
>>         <...snip>
>>     ...
>>     error: Error building trees
>
> Then, wham, these files want to be changed.  What is the diff-tree
> inside revert/cherry-pick doing differently to the one in log?

> Hakim, one more useful thing in this situation would be to show the
> state of these files in the index;
>
>  git ls-files -s -u

 $ git ls-files -s -u www/client/css/admin.css # only staged/unmerged
  100755 8e7cd850bf40d1a921b1f62ce0945abd374fa55d 2
www/client/css/admin.css

(i.e. when run after the failed cherry-pick)

> Also take the 'git ls-tree -r HEAD', 'git ls-tree -r 301afce1' and 'git
> ls-tree -r 301afce1^' output, and grep for the files in question.  The
> answer (or at least a bug triage) should be in the output of those
> commands.

  $ git ls-tree HEAD | grep www/client/css/admin.css
  100755 blob 8e7cd850bf40d1a921b1f62ce0945abd374fa55d
www/client/css/admin.css

There's no entry in git ls-tree 301afce1 or 301afce1^1 though.  I'd
guess that's significant, but I don't know what answer it suggests...

(However the file exists in both (stable) and (experimental)...
and is identical in both).

> You can reproduce exactly the merge by making a new branch at the
> position where you were attempting to land the cherry pick before, and
> checking that branch out.

I actually did

  $ cd ..
  $ git clone repo/ repo_backup_4Jan

beforehand, so this should also be an exact reproduction, I think?

> One last test, would be to check that it happens on a clean clone of the
> repository.  I don't think that you're hitting any repository-local
> behaviour (eg, the ability to mark certain files as "always ignore") but
> you never know.  These commands are all being run on the same working
> copy, right?

And see above, should be an entirely clean clone.

Thanks for the suggestions!

Hakim / osfameron

  reply	other threads:[~2010-01-06 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05 12:33 git-cherry-pick problem - directory not touched by commit is marked "added by us" Hakim Cassimally
2010-01-05 21:37 ` Sam Vilain
2010-01-06 11:28   ` Hakim Cassimally [this message]
2010-01-07  3:30     ` Junio C Hamano
2010-01-07  3:35       ` Junio C Hamano
2010-01-08 22:29         ` Hakim Cassimally

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=82cfa8031001060328r21aa8de3s5c2dd5dac005b679@mail.gmail.com \
    --to=hakim.cassimally@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sam@vilain.net \
    /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).