git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Luke Shumaker <lukeshu@datawire.io>,
	Thomas Koutcher <thomas.koutcher@online.fr>,
	James Limbouris <james@digitalmatter.com>,
	Philippe Blain <levraiphilippeblain@gmail.com>
Subject: Re: [PATCH 9/9] subtree: fix split after annotated tag was squashed merged
Date: Fri, 21 Oct 2022 18:37:34 +0200	[thread overview]
Message-ID: <221021.86mt9pdtcw.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <86a842d50345f6d4d0b16c78d565474be6f8068a.1666365220.git.gitgitgadget@gmail.com>


On Fri, Oct 21 2022, Philippe Blain via GitGitGadget wrote:

> From: Philippe Blain <levraiphilippeblain@gmail.com>
>
> The previous commit fixed a failure in 'git subtree merge --squash' when
> the previous squash-merge merged an annotated tag of the subtree
> repository which is missing locally.
>
> The same failure happens in 'git subtree split', either directly or when
> called by 'git subtree push', under the same circumstances: 'cmd_split'
> invokes 'find_existing_splits', which loops through previous commits and
> invokes 'git rev-parse' (via 'process_subtree_split_trailer') on the
> value of any 'git subtree-split' trailer it finds. This fails if this
> value is the hash of an annotated tag which is missing locally.
>
> Add a new optional argument 'repository' to 'cmd_split' and
> 'find_existing_splits', and invoke 'cmd_split' with that argument from
> 'cmd_push'. This allows 'process_subtree_split_trailer' to try to fetch
> the missing tag from the 'repository' if it's not available locally,
> mirroring the new behaviour of 'git subtree pull' and 'git subtree
> merge'.
>
> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
> ---
>  contrib/subtree/git-subtree.sh     | 26 ++++++++++++++++++--------
>  contrib/subtree/git-subtree.txt    |  7 ++++++-
>  contrib/subtree/t/t7900-subtree.sh | 12 ++++++++++++
>  3 files changed, 36 insertions(+), 9 deletions(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index 2c67989fe8a..10c9c87839a 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -453,14 +453,19 @@ find_latest_squash () {
>  	done || exit $?
>  }
>  
> -# Usage: find_existing_splits DIR REV
> +# Usage: find_existing_splits DIR REV [REPOSITORY]
>  find_existing_splits () {
> -	assert test $# = 2
> +	assert test $# = 2 -o $# = 3

This "test" syntax is considered unportable, I'm too lazy to dig up the
reference, but we've removed it in the past. Maybe it's OK with
git-subtree.sh", but anyway, it's esay enough to change...

...but looking at "master" I see one instance of it in git-subtree.sh
already, so maybe nobody cares...

  reply	other threads:[~2022-10-21 16:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 15:13 [PATCH 0/9] subtree: fix split and merge after annotated tag was squash-merged Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 1/9] test-lib-functions: mark 'test_commit' variables as 'local' Philippe Blain via GitGitGadget
2022-10-21 21:06   ` Junio C Hamano
2022-10-26 21:21     ` Philippe Blain
2022-10-26 21:38       ` Junio C Hamano
2022-10-21 15:13 ` [PATCH 2/9] subtree: use 'git rev-parse --verify [--quiet]' for better error messages Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 3/9] subtree: add 'die_incompatible_opt' function to reduce duplication Philippe Blain via GitGitGadget
2022-10-21 16:22   ` Ævar Arnfjörð Bjarmason
2022-10-26 21:23     ` Philippe Blain
2022-10-21 15:13 ` [PATCH 4/9] subtree: prefix die messages with 'fatal' Philippe Blain via GitGitGadget
2022-10-21 16:30   ` Ævar Arnfjörð Bjarmason
2022-10-26 21:24     ` Philippe Blain
2022-10-21 15:13 ` [PATCH 5/9] subtree: define a variable before its first use in 'find_latest_squash' Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 6/9] subtree: use named variables instead of "$@" in cmd_pull Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 7/9] subtree: process 'git-subtree-split' trailer in separate function Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 8/9] subtree: fix squash merging after annotated tag was squashed merged Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 9/9] subtree: fix split " Philippe Blain via GitGitGadget
2022-10-21 16:37   ` Ævar Arnfjörð Bjarmason [this message]
2022-10-21 18:24     ` Eric Sunshine
2022-10-26 21:26     ` Philippe Blain

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=221021.86mt9pdtcw.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=james@digitalmatter.com \
    --cc=levraiphilippeblain@gmail.com \
    --cc=lukeshu@datawire.io \
    --cc=thomas.koutcher@online.fr \
    /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).