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

Re: [PATCH] git-subtree.sh: Use --allow-unrelated-histories when splitting with --rejoin

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 22, 2016, 08:11 UTC
Message-ID
<alpine.DEB.2.20.1607220954470.14111@virtualbox>
In-Reply-To
<CAMaPC4JTerX7TSg5_M=DOztyaGUVd5_kK8cmTJuWrCekGgSodw@mail.gmail.com>
Hi Brett,
On Thu, 21 Jul 2016, Brett Cundal wrote:
> [re-sending as plain-text so the list software doesn't reject as
> spam... what decade is this?]

I know it feels good to get frustration off of your chest by ranting. I am very sympathetic to that. Please note, however, that it puts the people who are ready to help you immediately into a defensive corner. Probably unintentional?

> Sorry about the empty commit message... there was one originally (albeit
> not as detailed as the pull request), but I guess it got stripped? As
> you have probably guessed, I have no idea how you guys do patch
> submission.

It is okay. For historical reasons, the patch submission is a bit more involved than simply opening a Pull Request. We also frown upon top-posting, among other rules of netiquette. You may dislike it, but you would have to build more of a "street cred" if you truly wanted to try to convince the Git developers to change it.

Back to the patch you wanted to submit: since this is an important bug fix, I spent the time to clean it up. The only missing bit that requires further effort from your side is that we need your Sign-off. See https://github.com/git/git/blob/v2.9.2/Documentation/SubmittingPatches#L239-L291 for an explanation. Essentially, you are stating explicitly that you are not legally prohibited from contributing this patch. If you can say that, simply reply with a

	Signed-off-by: Brett Cundal <brett.cundal@iugome.com>
We can take it from there by inserting it into the following patch:
-- snipsnap --
From: Brett Cundal <brett.cundal@iugome.com>
Subject: [PATCH] subtree: allow unrelated histories when splitting with --rejoin
Git 2.9 added a check against merging unrelated histories, which is
exactly what git subtree with --rejoin does. Adding the
--allow-unrelated-histories flag to merge will override this check.
---
 contrib/subtree/git-subtree.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7a39b30..556cd92 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -661,7 +661,7 @@ cmd_split()
 	if [ -n "$rejoin" ]; then
 		debug "Merging split branch into HEAD..."
 		latest_old=$(cache_get latest_old)
-		git merge -s ours \
+		git merge -s ours --allow-unrelated-histories \
 			-m "$(rejoin_msg "$dir" $latest_old $latest_new)" \
 			$latest_new >&2 || exit $?
 	fi
-- 
2.9.0.281.g286a8d9
Previous: Brett CundalNext: Brett Cundal
Message 5 of 6 in “git-subtree.sh: Use --allow-unrelated-histories when splitting with --rejoin”
  1. git-subtree.sh: Use --allow-unrelated-histories when splitting with --rejoinBrett Cundal, Jul 21, 2016
  2. David AguilarJul 21, 2016
  3. Johannes SchindelinJul 21, 2016
  4. Brett CundalJul 21, 2016
  5. Johannes SchindelinJul 22, 2016
  6. Brett CundalJul 22, 2016

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.