From: Philippe Blain <levraiphilippeblain@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"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>
Subject: Re: [PATCH 9/9] subtree: fix split after annotated tag was squashed merged
Date: Wed, 26 Oct 2022 17:26:55 -0400 [thread overview]
Message-ID: <b83b8c41-07c9-ba5a-93a0-ed0ae4c9d3cd@gmail.com> (raw)
In-Reply-To: <221021.86mt9pdtcw.gmgdl@evledraar.gmail.com>
Le 2022-10-21 à 12:37, Ævar Arnfjörð Bjarmason a écrit :
>
> 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...
>
I did not know it was not portable, in fact I used this form because while
reading the rest of the script I found that was the style used already.
So I guess I would leave this as a further cleanup for someone wishing to make
'git subtree' more POSIX...
prev parent reply other threads:[~2022-10-26 21:27 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
2022-10-21 18:24 ` Eric Sunshine
2022-10-26 21:26 ` Philippe Blain [this message]
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=b83b8c41-07c9-ba5a-93a0-ed0ae4c9d3cd@gmail.com \
--to=levraiphilippeblain@gmail.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=james@digitalmatter.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).