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

Salvaging borked project history

From
MMason <slash.tmp@free.fr>
Date
Feb 23, 2015, 17:05 UTC
Message-ID
<54EB5DD7.7050202@free.fr>
Hello everyone,
Here's the situation:

Back in 2012, we cloned a MIPS repo, which was itself a clone of a 3.4.2 kernel with ~40 MIPS-specific patches applied.

Then the devs started pushing patches; and once in a while, the maintainer would "sync" with the mainline kernel. I don't know what tool he used to sync, but he discarded the original patches doing so, and git blame now shows him as the author of every mainline change since the clone.

Now that we are moving to a more recent kernel, I'm trying to "fix" this situation, i.e. I'd like kernel code to have proper attribution in git blame, while keeping intact the information for "internal" commits.

While I'm at it, I want to minimize history by ignoring patches that are now irrelevant:

1) we don't support MIPS anymore, I want to ignore any internal
change we made in the arch/mips directory
2) for some reason, there was a large amount of create/delete churn
in arch/arm/configs; so I want to ignore our changes, and I'll commit
an acceptable config when the process is complete.
3) ignore some internal platform-specific patches
(NB: All these "ignores" are for internal patches, not mainline patches)

Sooo, using git log and grep, I came up with a list of ~300 patches I'd like to apply on top of the latest 3.14 kernel. For testing purposes, I used git format-patch on the oldest of my 300 patches.

I then made a shiny new clone of linux-stable.git, and tried using git am to apply that patch to the tip of linux-stable, expecting having to solve a few dozens conflicts, and move on (hoping to automate it at some point).

But 'git am' just gave up. Small sample of errors:
error: patch failed: drivers/block/Kconfig:411
error: drivers/block/Kconfig: patch does not apply
error: drivers/tty/serial/8250/8250.c: does not exist in index
error: patch failed: drivers/tty/serial/8250/8250_early.c:121
error: drivers/tty/serial/8250/8250_early.c: patch does not apply
error: patch failed: drivers/video/Kconfig:101
error: drivers/video/Kconfig: patch does not apply
...
Patch failed at 0001 Commit for supporting Sigma Designs' SoCs.
The copy of the patch that failed is found in:
    .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
How do I "resolve this problem".

I suppose I am doing this the wrong way. What is the correct way to do it? (I'm using git 2.3)

Should I use git am -3 in the original repo?
Regards.
Next: Junio C Hamano
Message 1 of 9 in “Salvaging borked project history”
  1. MasonFeb 23, 2015
  2. Junio C HamanoFeb 23, 2015
  3. MasonFeb 26, 2015
  4. Junio C HamanoFeb 26, 2015
  5. MasonFeb 26, 2015
  6. Junio C HamanoFeb 26, 2015
  7. MasonFeb 26, 2015
  8. Junio C HamanoFeb 26, 2015
  9. MasonMar 4, 2015

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.