Re: file disappears after git rebase (missing one commit)
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Aug 18, 2007, 20:55 UTC
- Message-ID
- <alpine.LFD.0.999.0708181334200.30176@woody.linux-foundation.org>
- In-Reply-To
- <e7bda7770708181329i7a64e613y88187a608c323a07@mail.gmail.com>
On Sat, 18 Aug 2007, Torgil Svensson wrote:
Show 7 quoted lines
> > > In other words, "git rebase" really is just a series of cherry-picks, > > but it avoids patches that have the same patch ID as something that is > > already upstream. That helps *enormously*, but it so happens that the > > patch ID's don't work really well for binary diffs. > > Git cherry-pick seems to work on that particular patch:
Yes, cherry-picking itself works, it's just that "git rebase" probably won't even *try* to cherry-pick it because it thinks it is already applied.
> > Try this patch - see if it helps. Totally untested! It will enable > > patch ID's on binary diffs too, which should avoid this issue. > > That didn't help. Same symptom.
Yeah, I was thinking about the external "git-patch-id" program, which actually takes the diff and looks at it from there. But "--ignore-if-in-upstream" does its own binary file testing, and doesn't use the generic diff code at all.
So the following patch is likely much better..
Linus
--- diff.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/diff.c b/diff.c index 97cc5bc..a7e7671 100644 --- a/diff.c +++ b/diff.c @@ -2919,10 +2919,6 @@ static int diff_get_patch_id(struct diff_options *options, unsigned char *sha1) fill_mmfile(&mf2, p->two) < 0) return error("unable to read files to diff"); - /* Maybe hash p->two? into the patch id? */ - if (diff_filespec_is_binary(p->two)) - continue; - len1 = remove_space(p->one->path, strlen(p->one->path)); len2 = remove_space(p->two->path, strlen(p->two->path)); if (p->one->mode == 0)