diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-03 11:08:12 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-03 11:08:12 -0800 |
| commit | 2f9980cfebad39326546e4db1f614bdaf783f51b (patch) | |
| tree | 3be0135619aeffd14dc91e1ca0459770506794c8 /contrib/subtree/git-subtree.sh | |
| parent | 4805bb993087cb1fb9a81470aaa238123c0ed6e2 (diff) | |
| parent | 1f70684b517f4fcfeb7b998b0b7f3146ee8a8c75 (diff) | |
| download | git-2f9980cfebad39326546e4db1f614bdaf783f51b.tar.xz | |
Merge branch 'cs/subtree-split-fixes'
An earlier attempt to optimize "git subtree" discarded too much
relevant histories, which has been corrected.
* cs/subtree-split-fixes:
contrib/subtree: process out-of-prefix subtrees
contrib/subtree: test history depth
contrib/subtree: capture additional test-cases
Diffstat (limited to 'contrib/subtree/git-subtree.sh')
| -rwxr-xr-x | contrib/subtree/git-subtree.sh | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index d7f9121f2f..791fd8260c 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -788,42 +788,6 @@ ensure_valid_ref_format () { die "fatal: '$1' does not look like a ref" } -# Usage: should_ignore_subtree_split_commit REV -# -# Check if REV is a commit from another subtree and should be -# ignored from processing for splits -should_ignore_subtree_split_commit () { - assert test $# = 1 - - git show \ - --no-patch \ - --no-show-signature \ - --format='%(trailers:key=git-subtree-dir,key=git-subtree-mainline)' \ - "$1" | - ( - have_mainline= - subtree_dir= - - while read -r trailer val - do - case "$trailer" in - git-subtree-dir:) - subtree_dir="${val%/}" ;; - git-subtree-mainline:) - have_mainline=y ;; - esac - done - - if test -n "${subtree_dir}" && - test -z "${have_mainline}" && - test "${subtree_dir}" != "$arg_prefix" - then - return 0 - fi - return 1 - ) -} - # Usage: process_split_commit REV PARENTS process_split_commit () { assert test $# = 2 @@ -1015,19 +979,7 @@ cmd_split () { eval "$grl" | while read rev parents do - if should_ignore_subtree_split_commit "$rev" - then - continue - fi - parsedparents='' - for parent in $parents - do - if ! should_ignore_subtree_split_commit "$parent" - then - parsedparents="$parsedparents$parent " - fi - done - process_split_commit "$rev" "$parsedparents" + process_split_commit "$rev" "$parents" done || exit $? latest_new=$(cache_get latest_new) || exit $? |
