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

Re: file disappears after git rebase (missing one commit)

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 18, 2007, 20:01 UTC
Message-ID
<alpine.LFD.0.999.0708181247330.30176@woody.linux-foundation.org>
In-Reply-To
<e7bda7770708181237u34253bf1h7c3fe0987d13d3b3@mail.gmail.com>
On Sat, 18 Aug 2007, Torgil Svensson wrote:
Show 5 quoted lines
>
> $ git rebase devel
> First, rewinding head to replay your work on top of it...
> HEAD is now at 57aa840... Add disk summarize tool (du.exe)
> Nothing to do.
Ok. "git rebase" really does believe that there's nothing to do.

The reason, I think, is that I suspect that the newly added file is a binary file, no? That, in turn, will mean that the *patch* will have no patch ID (or rather, it will have an empty patch ID) - which in turn will make it invisible to "--ignore-if-in-upstream" if there are already some *other* patches that also just adds a binary file (which I think there is: I think upstream has "Add disk summarize tool (du.exe)" which I assume has exactly the same patch fingerprint).

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.

Try this patch - see if it helps. Totally untested! It will enable patch ID's on binary diffs too, which should avoid this issue.

		Linus
---
diff --git a/patch-ids.c b/patch-ids.c
index a288fac..4a3432e 100644
--- a/patch-ids.c
+++ b/patch-ids.c
@@ -122,6 +122,7 @@ int init_patch_ids(struct patch_ids *ids)
 	memset(ids, 0, sizeof(*ids));
 	diff_setup(&ids->diffopts);
 	ids->diffopts.recursive = 1;
+	ids->diffopts.binary = 1;
 	if (diff_setup_done(&ids->diffopts) < 0)
 		return error("diff_setup_done failed");
 	return 0;
Previous: Torgil SvenssonNext: Torgil Svensson
Message 2 of 6 in “file disappears after git rebase (missing one commit)”
  1. Torgil SvenssonAug 18, 2007
  2. Linus TorvaldsAug 18, 2007
  3. Torgil SvenssonAug 18, 2007
  4. Linus TorvaldsAug 18, 2007
  5. Torgil SvenssonAug 18, 2007
  6. Take binary diffs into account for "git rebase"Linus Torvalds, Aug 18, 2007

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.