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

Odd problems trying to build an orphaned branch

From
Aalan@clueserver.org <alan@clueserver.org>
Date
Nov 5, 2015, 21:16 UTC
Message-ID
<1bf03e2146ceb5bb36b81f1ce64354b0.squirrel@clueserver.org>

I am trying to create an orphaned branch that contains the linux-3.12.y branch from linux-stable. Each time I try a method to make this work I encounter a blocker that halts my progress.

I expect that at least one of these is a bug, but I am not sure.

Here is what I did. I have read the docs and tried a huge pile of suggestions. How is this supposed to be done?

I am using git version 2.6.2.402.g2635c2b. It passes all the tests.

I created an orphan branch from 3.12-rc1. I then used git format-patch to generate patches from 3.12-rc1 to HEAD. (Over 7000 patches.) I use git am to apply them to the orphan branch. At patch 237 it fails to apply. (It appears the patch is from a block of code added with a merge commit, but it is somewhere in the middle of the block.)

Are merge commits supposed to screw up git-format-patch?

I also tried using clone with depth and --single-branch set. It ignored the depth setting and gave me the whole branch all the way back to 2.6.x.

All the examples of shallow clones use depth=1. Is it broken for values bigger than 1 or am I missing something?

I tried using graft and filter-branch. None of the descriptions are very clear. None of them worked either. Filter-branch died on a commit somewhere in 2.6 land that had no author. (Which is outside of the commits I want to keep.)

I tried creating an orphan branch and using cherry-pick v3.12-rc1..linux-3.12.y. It blew up on the first merge commit it hit. I tried adding in "-m 1" to try to get it to pick a parent, but then it died on the first commit because it was not a merge.

Why is this so hard?

All I want to do is take a branch from linux-stable and create a branch that contains just the commits from where it was branched off of master until it hits HEAD. That is it. All the scripts that I have seen that claim to do just what I want break when it hits a merge or a bogus author. (How that got into linux-stable, I have no idea. The commit is 10 year old!)

Ideas? Do I need to create a new command? ("cake-cutter". Cut from commit..commit and make a new branch out of it.)

Next: Jeff King
Message 1 of 6 in “Odd problems trying to build an orphaned branch”
  1. alan@clueserver.orgNov 5, 2015
  2. Jeff KingNov 6, 2015
  3. Jeff KingNov 6, 2015
  4. filter-branch: skip index read/write when possibleJeff King, Nov 6, 2015
  5. alan@clueserver.orgNov 6, 2015
  6. Jeff KingNov 6, 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.