All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] subtree: fix argument handling in check_parents
@ 2021-12-01  2:06 James Limbouris via GitGitGadget
  2021-12-01 23:04 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: James Limbouris via GitGitGadget @ 2021-12-01  2:06 UTC (permalink / raw)
  To: git; +Cc: James Limbouris, James Limbouris

From: James Limbouris <james@digitalmatter.com>

check_parents was taking all of its arguments as a single string,
and erroneously passing them to cache_miss as a single string.
cache_miss would then fail, and the spurious cache misses it produced
would hurt performance.

For consistency, take multiple arguments in check_parents,
and pass all of them to cache_miss separately.

Signed-off-by: James Limbouris <james@digitalmatter.com>
---
    subtree: fix argument handling in check_parents
    
    Hello git developers. Please consider this small patch that fixes a bug
    introduced during a coding style cleanup of the subtree command. Changes
    to the argument handling were causing check_parents to fail when more
    than one parent was supplied, which led to a small loss of performance.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1086%2Fjamesl-dm%2Fmaint-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1086/jamesl-dm/maint-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1086

 contrib/subtree/git-subtree.sh | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7f767b5c38f..56f24000c2c 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -296,10 +296,9 @@ cache_miss () {
 	done
 }
 
-# Usage: check_parents PARENTS_EXPR
+# Usage: check_parents [REVS...]
 check_parents () {
-	assert test $# = 1
-	missed=$(cache_miss "$1") || exit $?
+	missed=$(cache_miss $*) || exit $?
 	local indent=$(($indent + 1))
 	for miss in $missed
 	do
@@ -753,7 +752,7 @@ process_split_commit () {
 	fi
 	createcount=$(($createcount + 1))
 	debug "parents: $parents"
-	check_parents "$parents"
+	check_parents $parents
 	newparents=$(cache_get $parents) || exit $?
 	debug "newparents: $newparents"
 

base-commit: e9d7761bb94f20acc98824275e317fa82436c25d
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-01-04 20:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  2:06 [PATCH] subtree: fix argument handling in check_parents James Limbouris via GitGitGadget
2021-12-01 23:04 ` Junio C Hamano
2021-12-02  5:51 ` [PATCH v2] " James Limbouris via GitGitGadget
2021-12-06  2:45   ` [PATCH v3] " James Limbouris via GitGitGadget
2021-12-08  2:11     ` [PATCH v4] " James Limbouris via GitGitGadget
2022-01-04 12:21       ` Johannes Schindelin
2022-01-04 20:04         ` Junio C Hamano
2021-12-03 15:22 ` [PATCH] " Johannes Schindelin
2021-12-03 20:02   ` Junio C Hamano
2021-12-07 21:45   ` Johannes Schindelin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.