git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Brett Cundal <brett.cundal@iugome.com>
Cc: git@vger.kernel.org, Roberto Tyley <roberto.tyley@gmail.com>
Subject: Re: [PATCH] git-subtree.sh: Use --allow-unrelated-histories when splitting with --rejoin
Date: Wed, 20 Jul 2016 22:26:25 -0700	[thread overview]
Message-ID: <20160721052625.GA31423@gmail.com> (raw)
In-Reply-To: <010201560af48050-012ea887-a1e1-4d1b-82d3-4799ac7788bc-000000@eu-west-1.amazonses.com>

[cc'd Roberto for submitGit q's]

On Thu, Jul 21, 2016 at 12:56:51AM +0000, Brett Cundal wrote:
> ---

<emtpy commit message>

The message on the pull request[1] has a better justification
for this change, which would have been nice in the commit
message itself:


	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.


Is it possible that maybe submitGit can detect an empty commit
message for single-commit PRs and transplant that message onto it?

As-is, the commit itself should probably be amended to contain
that information.

>  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
> 
> --

With the above description this change makes more sense,
but it seems that the existing tests do not detect the breakage
fixed by this patch.

Can you please add a test case in t/t7900-subtree.sh
demonstrating the breakage?

Looks good otherwise.

[1] https://github.com/git/git/pull/274
-- 
David

  reply	other threads:[~2016-07-21  5:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21  0:56 [PATCH] git-subtree.sh: Use --allow-unrelated-histories when splitting with --rejoin Brett Cundal
2016-07-21  5:26 ` David Aguilar [this message]
2016-07-21 15:25   ` Johannes Schindelin
2016-07-21 18:09     ` Brett Cundal
2016-07-22  8:11       ` Johannes Schindelin
2016-07-22 17:15         ` Brett Cundal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160721052625.GA31423@gmail.com \
    --to=davvid@gmail.com \
    --cc=brett.cundal@iugome.com \
    --cc=git@vger.kernel.org \
    --cc=roberto.tyley@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).