Thread (139 messages) 139 messages, 5 authors, 2021-04-30

Re: [PATCH 23/30] subtree: add comments and sanity checks

From: Eric Sunshine <hidden>
Date: 2021-04-23 20:58:49

On Fri, Apr 23, 2021 at 3:43 PM Luke Shumaker [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Signed-off-by: Luke Shumaker <redacted>
---
diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
@@ -248,17 +263,22 @@ rev_exists () {
+# Usage: try_remove_previous REV
+#
 # if a commit doesn't have a parent, this might not work.  But we only want
s/if/If/ perhaps
quoted hunk ↗ jump to hunk
 # to remove the parent from the rev-list, and since it doesn't exist, it won't
 # be there anyway, so do nothing in that case.
@@ -302,10 +322,12 @@ find_latest_squash () {
+# Usage: find_existing_splits DIR REV
 find_existing_splits () {
+       assert test $# = 2
        debug "Looking for prior splits..."
        dir="$1"
-       revs="$2"
+       rev="$2"
@@ -314,7 +336,7 @@ find_existing_splits () {
        git log --grep="$grep_format" \
-               --no-show-signature --pretty=format:'START %H%n%s%n%n%b%nEND%n' $revs |
+               --no-show-signature --pretty=format:'START %H%n%s%n%n%b%nEND%n' "$rev" |
The caller of this function is passing in "$revs". Did you make this
semantic change because the caller's `revs` is guaranteed to be a
single rev? In any case, this change may deserve mention in the commit
message so readers don't have to wonder about it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help