git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] [OUTREACHY] t1002: modernize outdated conditional
@ 2022-10-14  2:06 nsengaw4c via GitGitGadget
  2022-10-14  5:05 ` Junio C Hamano
  2022-10-14  7:47 ` [PATCH v2] " nsengaw4c via GitGitGadget
  0 siblings, 2 replies; 15+ messages in thread
From: nsengaw4c via GitGitGadget @ 2022-10-14  2:06 UTC (permalink / raw)
  To: git; +Cc: nsengaw4c, wilberforce

From: wilberforce <nsengiyumvawilberforce@gmail.com>

Tests in this script use an unusual and hard to reason about
conditional construct

    if expression; then false; else :; fi

Change them to use more idiomatic construct:

    ! expression

Cc: Christian Couder  <christian.couder@gmail.com>
Cc: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Nsengiyumva  wilberfore <nsengiyumvawilberforce@gmail.com>
---
    [OUTREACHY]cleaning t1002-read-tree-m-u-2way.sh
    
    This is an update in t1002-read-tree-m-u-2way.sh. all the tests that use
    the unusual construct: if read_tree_u_must_succeed -m -u $treeH $treeM;
    then false; else :; fi have been updated to ! read_tree_u_must_succeed
    -m -u $treeH $treeM "I am an outreachy applicant" CC: Christian Couder
    christian.couder@gmail.com, Hariom verma hariom18599@gmail.com
    Signed-off-by: wilberforce nsengiyumvawilberforce@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1362%2Fnsengiyumva-wilberforce%2Ft1002_usual_construct_updated-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1362/nsengiyumva-wilberforce/t1002_usual_construct_updated-v1
Pull-Request: https://github.com/git/git/pull/1362

 t/t1002-read-tree-m-u-2way.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index bd5313caec9..cdc077ce12d 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -154,7 +154,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '9 - conflicting addition.' \
@@ -163,7 +163,7 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
      echo frotz >frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '10 - path removed.' \
@@ -186,7 +186,7 @@ test_expect_success \
      echo rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '12 - unmatching local changes being removed.' \
@@ -194,7 +194,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '13 - unmatching local changes being removed.' \
@@ -203,7 +203,7 @@ test_expect_success \
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 cat >expected <<EOF
 -100644 X 0	nitfol
@@ -251,7 +251,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -260,7 +260,7 @@ test_expect_success \
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
      echo bozbar bozbar bozbar >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '18 - local change already having a good result.' \
@@ -316,7 +316,7 @@ test_expect_success \
      echo bozbar >bozbar &&
      git update-index --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 # Also make sure we did not break DF vs DF/DF case.
 test_expect_success \

base-commit: d420dda0576340909c3faff364cfbd1485f70376
-- 
gitgitgadget

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

* Re: [PATCH] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14  2:06 [PATCH] [OUTREACHY] t1002: modernize outdated conditional nsengaw4c via GitGitGadget
@ 2022-10-14  5:05 ` Junio C Hamano
  2022-10-14  7:47 ` [PATCH v2] " nsengaw4c via GitGitGadget
  1 sibling, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14  5:05 UTC (permalink / raw)
  To: nsengaw4c via GitGitGadget; +Cc: git, nsengaw4c

"nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: wilberforce <nsengiyumvawilberforce@gmail.com>

This name must match ...

> Tests in this script use an unusual and hard to reason about
> conditional construct
>
>     if expression; then false; else :; fi
>
> Change them to use more idiomatic construct:
>
>     ! expression
>
> Cc: Christian Couder  <christian.couder@gmail.com>
> Cc: Hariom Verma <hariom18599@gmail.com>
> Signed-off-by: Nsengiyumva  wilberfore <nsengiyumvawilberforce@gmail.com>

... the name you sign-off your work with.

> -     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
> +     ! read_tree_u_must_succeed -m -u $treeH $treeM'

OK.


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

* [PATCH v2] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14  2:06 [PATCH] [OUTREACHY] t1002: modernize outdated conditional nsengaw4c via GitGitGadget
  2022-10-14  5:05 ` Junio C Hamano
@ 2022-10-14  7:47 ` nsengaw4c via GitGitGadget
  2022-10-14  8:01   ` [PATCH v3] " nsengaw4c via GitGitGadget
  1 sibling, 1 reply; 15+ messages in thread
From: nsengaw4c via GitGitGadget @ 2022-10-14  7:47 UTC (permalink / raw)
  To: git; +Cc: nsengaw4c, Nsengiyumva Wilberforce

From: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>

Tests in this script use an unusual and hard to reason about
conditional construct

    if expression; then false; else :; fi

Change them to use more idiomatic construct:

    ! expression

Cc: Christian Couder  <christian.couder@gmail.com>
Cc: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Nsengiyumva  Wilberfore <nsengiyumvawilberforce@gmail.com>
---
    [OUTREACHY]cleaning t1002-read-tree-m-u-2way.sh
    
    This is an update in t1002-read-tree-m-u-2way.sh. all the tests that use
    the unusual construct: if read_tree_u_must_succeed -m -u $treeH $treeM;
    then false; else :; fi have been updated to ! read_tree_u_must_succeed
    -m -u $treeH $treeM "I am an outreachy applicant" CC: Christian Couder
    christian.couder@gmail.com, Hariom verma hariom18599@gmail.com
    Signed-off-by: wilberforce nsengiyumvawilberforce@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1362%2Fnsengiyumva-wilberforce%2Ft1002_usual_construct_updated-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1362/nsengiyumva-wilberforce/t1002_usual_construct_updated-v2
Pull-Request: https://github.com/git/git/pull/1362

Range-diff vs v1:

 1:  b2ed686bc94 ! 1:  8a9cd66d7d9 [OUTREACHY] t1002: modernize outdated conditional
     @@
       ## Metadata ##
     -Author: wilberforce <nsengiyumvawilberforce@gmail.com>
     +Author: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>
      
       ## Commit message ##
          [OUTREACHY] t1002: modernize outdated conditional
     @@ Commit message
      
          Cc: Christian Couder  <christian.couder@gmail.com>
          Cc: Hariom Verma <hariom18599@gmail.com>
     -    Signed-off-by: Nsengiyumva  wilberfore <nsengiyumvawilberforce@gmail.com>
     +    Signed-off-by: Nsengiyumva  Wilberfore <nsengiyumvawilberforce@gmail.com>
      
       ## t/t1002-read-tree-m-u-2way.sh ##
      @@ t/t1002-read-tree-m-u-2way.sh: test_expect_success \


 t/t1002-read-tree-m-u-2way.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index bd5313caec9..cdc077ce12d 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -154,7 +154,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '9 - conflicting addition.' \
@@ -163,7 +163,7 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
      echo frotz >frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '10 - path removed.' \
@@ -186,7 +186,7 @@ test_expect_success \
      echo rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '12 - unmatching local changes being removed.' \
@@ -194,7 +194,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '13 - unmatching local changes being removed.' \
@@ -203,7 +203,7 @@ test_expect_success \
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 cat >expected <<EOF
 -100644 X 0	nitfol
@@ -251,7 +251,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -260,7 +260,7 @@ test_expect_success \
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
      echo bozbar bozbar bozbar >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '18 - local change already having a good result.' \
@@ -316,7 +316,7 @@ test_expect_success \
      echo bozbar >bozbar &&
      git update-index --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 # Also make sure we did not break DF vs DF/DF case.
 test_expect_success \

base-commit: d420dda0576340909c3faff364cfbd1485f70376
-- 
gitgitgadget

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

* [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14  7:47 ` [PATCH v2] " nsengaw4c via GitGitGadget
@ 2022-10-14  8:01   ` nsengaw4c via GitGitGadget
  2022-10-14 16:15     ` Junio C Hamano
  2022-10-14 18:28     ` [PATCH v4] " nsengaw4c via GitGitGadget
  0 siblings, 2 replies; 15+ messages in thread
From: nsengaw4c via GitGitGadget @ 2022-10-14  8:01 UTC (permalink / raw)
  To: git; +Cc: nsengaw4c, Nsengiyumva Wilberforce

From: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>

Tests in this script use an unusual and hard to reason about
conditional construct

    if expression; then false; else :; fi

Change them to use more idiomatic construct:

    ! expression

Cc: Christian Couder  <christian.couder@gmail.com>
Cc: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>
---
    [OUTREACHY]cleaning t1002-read-tree-m-u-2way.sh
    
    This is an update in t1002-read-tree-m-u-2way.sh. all the tests that use
    the unusual construct: if read_tree_u_must_succeed -m -u $treeH $treeM;
    then false; else :; fi have been updated to ! read_tree_u_must_succeed
    -m -u $treeH $treeM "I am an outreachy applicant" CC: Christian Couder
    christian.couder@gmail.com, Hariom verma hariom18599@gmail.com
    Signed-off-by: wilberforce nsengiyumvawilberforce@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1362%2Fnsengiyumva-wilberforce%2Ft1002_usual_construct_updated-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1362/nsengiyumva-wilberforce/t1002_usual_construct_updated-v3
Pull-Request: https://github.com/git/git/pull/1362

Range-diff vs v2:

 1:  8a9cd66d7d9 ! 1:  d019ce50dc9 [OUTREACHY] t1002: modernize outdated conditional
     @@ Commit message
      
          Cc: Christian Couder  <christian.couder@gmail.com>
          Cc: Hariom Verma <hariom18599@gmail.com>
     -    Signed-off-by: Nsengiyumva  Wilberfore <nsengiyumvawilberforce@gmail.com>
     +    Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>
      
       ## t/t1002-read-tree-m-u-2way.sh ##
      @@ t/t1002-read-tree-m-u-2way.sh: test_expect_success \


 t/t1002-read-tree-m-u-2way.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index bd5313caec9..cdc077ce12d 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -154,7 +154,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '9 - conflicting addition.' \
@@ -163,7 +163,7 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
      echo frotz >frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '10 - path removed.' \
@@ -186,7 +186,7 @@ test_expect_success \
      echo rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '12 - unmatching local changes being removed.' \
@@ -194,7 +194,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '13 - unmatching local changes being removed.' \
@@ -203,7 +203,7 @@ test_expect_success \
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 cat >expected <<EOF
 -100644 X 0	nitfol
@@ -251,7 +251,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -260,7 +260,7 @@ test_expect_success \
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
      echo bozbar bozbar bozbar >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '18 - local change already having a good result.' \
@@ -316,7 +316,7 @@ test_expect_success \
      echo bozbar >bozbar &&
      git update-index --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 # Also make sure we did not break DF vs DF/DF case.
 test_expect_success \

base-commit: d420dda0576340909c3faff364cfbd1485f70376
-- 
gitgitgadget

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14  8:01   ` [PATCH v3] " nsengaw4c via GitGitGadget
@ 2022-10-14 16:15     ` Junio C Hamano
  2022-10-14 16:21       ` Derrick Stolee
  2022-10-14 18:28     ` [PATCH v4] " nsengaw4c via GitGitGadget
  1 sibling, 1 reply; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14 16:15 UTC (permalink / raw)
  To: nsengaw4c via GitGitGadget; +Cc: git, nsengaw4c, Christian Couder, Hariom Verma

"nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>
>
> Tests in this script use an unusual and hard to reason about
> conditional construct
>
>     if expression; then false; else :; fi
>
> Change them to use more idiomatic construct:
>
>     ! expression
>
> Cc: Christian Couder  <christian.couder@gmail.com>
> Cc: Hariom Verma <hariom18599@gmail.com>
> Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>

What are these C: lines for?  I do not think the message I am
responding to is Cc'ed to them.  There may be a special incantation
to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
log message trailer like this does not seem to be it---at least it
appears that it did not work that way.

> ...
> -     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
> +     ! read_tree_u_must_succeed -m -u $treeH $treeM'

Looks good. For the purpose of microproject, I think this is a good
place to stop, as it does not make anything worse and make the code
prettier.

To those more experienced contributors who are watching from
sidelines, and especially to our mentors, it may be worth taking a
look at the implementation of the helper shell function used here,
and think if it makes sense to expect a failure with a simple "!"
prefix (or with the original long hand if/then/else/fi that has
exactly the same issue).

read_tree_u_must_succeed () {
	git ls-files -s >pre-dry-run &&
	git diff-files -p >pre-dry-run-wt &&
	git read-tree -n "$@" &&
	git ls-files -s >post-dry-run &&
	git diff-files -p >post-dry-run-wt &&
	test_cmp pre-dry-run post-dry-run &&
	test_cmp pre-dry-run-wt post-dry-run-wt &&
	git read-tree "$@"
}

What if read-tree segfaults?  This entire function will fail and the
test that runs read_tree_u_must_succeed and negates its result would
be a poor fit here.

Thanks.

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 16:15     ` Junio C Hamano
@ 2022-10-14 16:21       ` Derrick Stolee
  2022-10-14 16:58         ` Eric Sunshine
  0 siblings, 1 reply; 15+ messages in thread
From: Derrick Stolee @ 2022-10-14 16:21 UTC (permalink / raw)
  To: Junio C Hamano, nsengaw4c via GitGitGadget
  Cc: git, nsengaw4c, Christian Couder, Hariom Verma

On 10/14/2022 12:15 PM, Junio C Hamano wrote:
> "nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>
>>
>> Tests in this script use an unusual and hard to reason about
>> conditional construct
>>
>>     if expression; then false; else :; fi
>>
>> Change them to use more idiomatic construct:
>>
>>     ! expression
>>
>> Cc: Christian Couder  <christian.couder@gmail.com>
>> Cc: Hariom Verma <hariom18599@gmail.com>
>> Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>
> 
> What are these C: lines for?  I do not think the message I am
> responding to is Cc'ed to them.  There may be a special incantation
> to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
> log message trailer like this does not seem to be it---at least it
> appears that it did not work that way.

GitGitGadget will read the "cc:" lines from the end of the pull request
description, not the commit messages. I'm pretty sure they will be
ignored if there are other lines after them.

Thanks,
-Stolee

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 16:21       ` Derrick Stolee
@ 2022-10-14 16:58         ` Eric Sunshine
  2022-10-14 17:54           ` Derrick Stolee
  2022-10-14 19:06           ` Junio C Hamano
  0 siblings, 2 replies; 15+ messages in thread
From: Eric Sunshine @ 2022-10-14 16:58 UTC (permalink / raw)
  To: Derrick Stolee
  Cc: Junio C Hamano, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

On Fri, Oct 14, 2022 at 12:35 PM Derrick Stolee
<derrickstolee@github.com> wrote:
> On 10/14/2022 12:15 PM, Junio C Hamano wrote:
> > "nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >> Cc: Christian Couder  <christian.couder@gmail.com>
> >> Cc: Hariom Verma <hariom18599@gmail.com>
> >
> > What are these C: lines for?  I do not think the message I am
> > responding to is Cc'ed to them.  There may be a special incantation
> > to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
> > log message trailer like this does not seem to be it---at least it
> > appears that it did not work that way.
>
> GitGitGadget will read the "cc:" lines from the end of the pull request
> description, not the commit messages. I'm pretty sure they will be
> ignored if there are other lines after them.

For Wilberforce's edification for future submissions, presumably the
reason that the CC: in the pull-request's description didn't work is
because the CC: line wasn't the last line in the description? Does
there need to be a blank line before the CC: line? Is it okay to list
multiple people on the same CC: line as done in this case, or is that
also a problem?

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 16:58         ` Eric Sunshine
@ 2022-10-14 17:54           ` Derrick Stolee
  2022-10-14 18:57             ` Junio C Hamano
  2022-10-14 19:06           ` Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: Derrick Stolee @ 2022-10-14 17:54 UTC (permalink / raw)
  To: Eric Sunshine
  Cc: Junio C Hamano, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

On 10/14/2022 12:58 PM, Eric Sunshine wrote:
> On Fri, Oct 14, 2022 at 12:35 PM Derrick Stolee
> <derrickstolee@github.com> wrote:
>> On 10/14/2022 12:15 PM, Junio C Hamano wrote:
>>> "nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>>> Cc: Christian Couder  <christian.couder@gmail.com>
>>>> Cc: Hariom Verma <hariom18599@gmail.com>
>>>
>>> What are these C: lines for?  I do not think the message I am
>>> responding to is Cc'ed to them.  There may be a special incantation
>>> to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
>>> log message trailer like this does not seem to be it---at least it
>>> appears that it did not work that way.
>>
>> GitGitGadget will read the "cc:" lines from the end of the pull request
>> description, not the commit messages. I'm pretty sure they will be
>> ignored if there are other lines after them.
> 
> For Wilberforce's edification for future submissions, presumably the
> reason that the CC: in the pull-request's description didn't work is
> because the CC: line wasn't the last line in the description? Does
> there need to be a blank line before the CC: line? Is it okay to list
> multiple people on the same CC: line as done in this case, or is that
> also a problem?

Looking at the PR (https://github.com/git/git/pull/1362) it seems
there was no "cc:" lines in the PR description (until GitGitGadget
added them due to our replies).

Nsengiyumva: you'll want to be careful to edit your pull request
description on GitHub before running the "/submit" chatop. Your
current description has a paste of your commit message followed by
the contributing template. The pull request description becomes
your cover letter (in the case of multiple patches) or a commentary
section after the commit message (in this case of a single patch).

The description is a good place to say things like "I started
working on this because of a mailing list thread..." or "I'm not
sure if I've tested everything enough".

The "cc:" lines should _not_ be in the commit message at all, which
is what's visible in the patch.

Thanks,
-Stolee

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

* [PATCH v4] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14  8:01   ` [PATCH v3] " nsengaw4c via GitGitGadget
  2022-10-14 16:15     ` Junio C Hamano
@ 2022-10-14 18:28     ` nsengaw4c via GitGitGadget
  1 sibling, 0 replies; 15+ messages in thread
From: nsengaw4c via GitGitGadget @ 2022-10-14 18:28 UTC (permalink / raw)
  To: git; +Cc: Derrick Stolee, Eric Sunshine, nsengaw4c, Nsengiyumva Wilberforce

From: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com>

Tests in this script use an unusual and hard to reason about
conditional construct

    if expression; then false; else :; fi

Change them to use more idiomatic construct:

    ! expression

Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>
---
    [OUTREACHY]cleaning t1002-read-tree-m-u-2way.sh
    
    This is an update in t1002-read-tree-m-u-2way.sh. all the tests that use
    the unusual construct: if read_tree_u_must_succeed -m -u $treeH $treeM;
    then false; else :; fi have been updated to ! read_tree_u_must_succeed
    -m -u $treeH $treeM "I am an outreachy applicant" CC: Christian Couder
    christian.couder@gmail.com, Hariom verma hariom18599@gmail.com
    Signed-off-by: wilberforce nsengiyumvawilberforce@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1362%2Fnsengiyumva-wilberforce%2Ft1002_usual_construct_updated-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1362/nsengiyumva-wilberforce/t1002_usual_construct_updated-v4
Pull-Request: https://github.com/git/git/pull/1362

Range-diff vs v3:

 1:  d019ce50dc9 ! 1:  c0109d947d4 [OUTREACHY] t1002: modernize outdated conditional
     @@ Commit message
      
              ! expression
      
     -    Cc: Christian Couder  <christian.couder@gmail.com>
     -    Cc: Hariom Verma <hariom18599@gmail.com>
          Signed-off-by: Nsengiyumva  Wilberforce <nsengiyumvawilberforce@gmail.com>
      
       ## t/t1002-read-tree-m-u-2way.sh ##


 t/t1002-read-tree-m-u-2way.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t1002-read-tree-m-u-2way.sh b/t/t1002-read-tree-m-u-2way.sh
index bd5313caec9..cdc077ce12d 100755
--- a/t/t1002-read-tree-m-u-2way.sh
+++ b/t/t1002-read-tree-m-u-2way.sh
@@ -154,7 +154,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '9 - conflicting addition.' \
@@ -163,7 +163,7 @@ test_expect_success \
      echo frotz frotz >frotz &&
      git update-index --add frotz &&
      echo frotz >frotz &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '10 - path removed.' \
@@ -186,7 +186,7 @@ test_expect_success \
      echo rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '12 - unmatching local changes being removed.' \
@@ -194,7 +194,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '13 - unmatching local changes being removed.' \
@@ -203,7 +203,7 @@ test_expect_success \
      echo rezrov rezrov >rezrov &&
      git update-index --add rezrov &&
      echo rezrov >rezrov &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 cat >expected <<EOF
 -100644 X 0	nitfol
@@ -251,7 +251,7 @@ test_expect_success \
      read_tree_u_must_succeed --reset -u $treeH &&
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '17 - conflicting local change.' \
@@ -260,7 +260,7 @@ test_expect_success \
      echo bozbar bozbar >bozbar &&
      git update-index --add bozbar &&
      echo bozbar bozbar bozbar >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 test_expect_success \
     '18 - local change already having a good result.' \
@@ -316,7 +316,7 @@ test_expect_success \
      echo bozbar >bozbar &&
      git update-index --add bozbar &&
      echo gnusto gnusto >bozbar &&
-     if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
+     ! read_tree_u_must_succeed -m -u $treeH $treeM'
 
 # Also make sure we did not break DF vs DF/DF case.
 test_expect_success \

base-commit: d420dda0576340909c3faff364cfbd1485f70376
-- 
gitgitgadget

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 17:54           ` Derrick Stolee
@ 2022-10-14 18:57             ` Junio C Hamano
  0 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14 18:57 UTC (permalink / raw)
  To: Derrick Stolee
  Cc: Eric Sunshine, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

Derrick Stolee <derrickstolee@github.com> writes:

> Nsengiyumva: you'll want to be careful to edit your pull request
> description on GitHub before running the "/submit" chatop. Your
> current description has a paste of your commit message followed by
> the contributing template. The pull request description becomes
> your cover letter (in the case of multiple patches) or a commentary
> section after the commit message (in this case of a single patch).
>
> The description is a good place to say things like "I started
> working on this because of a mailing list thread..." or "I'm not
> sure if I've tested everything enough".

Good advice.

> The "cc:" lines should _not_ be in the commit message at all, which
> is what's visible in the patch.

I agree that it would probably be better without CC: in the trailer
in this case.  Some projects seem to use the CC: in the trailer to
signal that these people have been notified, without implying
anything about their reaction (i.e. when the author cannot use
reviewed-by or acked-by).  We are not that large a community, so I
personally do not see a need to use such a trailer around here.  But
that is only a local convention in this project.

Thanks.


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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 16:58         ` Eric Sunshine
  2022-10-14 17:54           ` Derrick Stolee
@ 2022-10-14 19:06           ` Junio C Hamano
  2022-10-14 19:14             ` Eric Sunshine
  2022-10-14 20:19             ` Philip Oakley
  1 sibling, 2 replies; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14 19:06 UTC (permalink / raw)
  To: Eric Sunshine
  Cc: Derrick Stolee, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

Eric Sunshine <sunshine@sunshineco.com> writes:

> On Fri, Oct 14, 2022 at 12:35 PM Derrick Stolee
> <derrickstolee@github.com> wrote:
>> On 10/14/2022 12:15 PM, Junio C Hamano wrote:
>> > "nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:
>> >> Cc: Christian Couder  <christian.couder@gmail.com>
>> >> Cc: Hariom Verma <hariom18599@gmail.com>
>> >
>> > What are these C: lines for?  I do not think the message I am
>> > responding to is Cc'ed to them.  There may be a special incantation
>> > to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
>> > log message trailer like this does not seem to be it---at least it
>> > appears that it did not work that way.
>>
>> GitGitGadget will read the "cc:" lines from the end of the pull request
>> description, not the commit messages. I'm pretty sure they will be
>> ignored if there are other lines after them.
>
> For Wilberforce's edification for future submissions, presumably the
> reason that the CC: in the pull-request's description didn't work is
> because the CC: line wasn't the last line in the description? Does
> there need to be a blank line before the CC: line? Is it okay to list
> multiple people on the same CC: line as done in this case, or is that
> also a problem?

Ah, now I can see why the round v4 is CC'ed to you and Derrick on
the list.  The pull-request text (visible in GitHub UI in the top
most box of https://github.com/git/git/pull/1362) ends with two
lines of cc: that list you two.  The one named Christian and Hariom
were not at the end and was ignored by GGG, it seems.


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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 19:06           ` Junio C Hamano
@ 2022-10-14 19:14             ` Eric Sunshine
  2022-10-14 20:41               ` Junio C Hamano
  2022-10-14 20:19             ` Philip Oakley
  1 sibling, 1 reply; 15+ messages in thread
From: Eric Sunshine @ 2022-10-14 19:14 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Derrick Stolee, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

On Fri, Oct 14, 2022 at 3:06 PM Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
> > On Fri, Oct 14, 2022 at 12:35 PM Derrick Stolee
> > <derrickstolee@github.com> wrote:
> >> GitGitGadget will read the "cc:" lines from the end of the pull request
> >> description, not the commit messages. I'm pretty sure they will be
> >> ignored if there are other lines after them.
> >
> > For Wilberforce's edification for future submissions, presumably the
> > reason that the CC: in the pull-request's description didn't work is
> > because the CC: line wasn't the last line in the description? Does
> > there need to be a blank line before the CC: line? Is it okay to list
> > multiple people on the same CC: line as done in this case, or is that
> > also a problem?
>
> Ah, now I can see why the round v4 is CC'ed to you and Derrick on
> the list.  The pull-request text (visible in GitHub UI in the top
> most box of https://github.com/git/git/pull/1362) ends with two
> lines of cc: that list you two.  The one named Christian and Hariom
> were not at the end and was ignored by GGG, it seems.

Yes, the CC: line mentioning Christian and Hariom was not at the end
of the description, which is likely why GitGitGadget didn't pick it
up. (Presumably Stolee overlooked that line when responding to my
question.) However, clarification about whether or not there needs to
be a blank line before the CC: line would be nice (I presume the blank
line is needed), but also whether or not GitGitGadget correctly deals
with multiple people mentioned on the same CC: line or if they each
need to occupy a single CC: line.

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 19:06           ` Junio C Hamano
  2022-10-14 19:14             ` Eric Sunshine
@ 2022-10-14 20:19             ` Philip Oakley
  2022-10-14 20:42               ` Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: Philip Oakley @ 2022-10-14 20:19 UTC (permalink / raw)
  To: Junio C Hamano, Eric Sunshine
  Cc: Derrick Stolee, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

On 14/10/2022 20:06, Junio C Hamano wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> On Fri, Oct 14, 2022 at 12:35 PM Derrick Stolee
>> <derrickstolee@github.com> wrote:
>>> On 10/14/2022 12:15 PM, Junio C Hamano wrote:
>>>> "nsengaw4c via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>>>> Cc: Christian Couder  <christian.couder@gmail.com>
>>>>> Cc: Hariom Verma <hariom18599@gmail.com>
>>>> What are these C: lines for?  I do not think the message I am
>>>> responding to is Cc'ed to them.  There may be a special incantation
>>>> to tell GitGitGadget to Cc to certain folks, but adding Cc: to the
>>>> log message trailer like this does not seem to be it---at least it
>>>> appears that it did not work that way.
>>> GitGitGadget will read the "cc:" lines from the end of the pull request
>>> description, not the commit messages. I'm pretty sure they will be
>>> ignored if there are other lines after them.
>> For Wilberforce's edification for future submissions, presumably the
>> reason that the CC: in the pull-request's description didn't work is
>> because the CC: line wasn't the last line in the description? Does
>> there need to be a blank line before the CC: line? Is it okay to list
>> multiple people on the same CC: line as done in this case, or is that
>> also a problem?
> Ah, now I can see why the round v4 is CC'ed to you and Derrick on
> the list.  The pull-request text (visible in GitHub UI in the top
> most box of https://github.com/git/git/pull/1362) ends with two
> lines of cc: that list you two.  The one named Christian and Hariom
> were not at the end and was ignored by GGG, it seems.
>
I just want to throw in that because GitHub takes the PR & comitts
verbatim, but Git itself works via email, you can add description
portions to commits, and I believe the PR part, by add a line containing
just three dashes `---` followed by the additional descriptive note text
which won't be used when `am` (apply mailbox) is used.

I've certainly used that technique when sending patches. See the "Bonus
Chapter: One-Patch Changes" in MyFirstContribution.txt
--
Philip

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 19:14             ` Eric Sunshine
@ 2022-10-14 20:41               ` Junio C Hamano
  0 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14 20:41 UTC (permalink / raw)
  To: Eric Sunshine
  Cc: Derrick Stolee, nsengaw4c via GitGitGadget, git, nsengaw4c,
	Christian Couder, Hariom Verma

Eric Sunshine <sunshine@sunshineco.com> writes:

> ... However, clarification about whether or not there needs to
> be a blank line before the CC: line would be nice (I presume the blank
> line is needed), but also whether or not GitGitGadget correctly deals
> with multiple people mentioned on the same CC: line or if they each
> need to occupy a single CC: line.

Indeed it is very good to have such a documentation that tells us
all these things.  Is the "Welcome to GGG" comment it adds to first
time users a good place to have this kind of information (I am
guessing not, as more advanced features may become needed after you
used the tool several times)?

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

* Re: [PATCH v3] [OUTREACHY] t1002: modernize outdated conditional
  2022-10-14 20:19             ` Philip Oakley
@ 2022-10-14 20:42               ` Junio C Hamano
  0 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2022-10-14 20:42 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Eric Sunshine, Derrick Stolee, nsengaw4c via GitGitGadget, git,
	nsengaw4c, Christian Couder, Hariom Verma

Philip Oakley <philipoakley@iee.email> writes:

> I just want to throw in that because GitHub takes the PR & comitts
> verbatim, but Git itself works via email, you can add description
> portions to commits, and I believe the PR part, by add a line containing
> just three dashes `---` followed by the additional descriptive note text
> which won't be used when `am` (apply mailbox) is used.

Yup, if you are absolutely sure you won't interact with others in
any way other than e-mailed patches, it is a great trick to use.

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

end of thread, other threads:[~2022-10-14 20:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14  2:06 [PATCH] [OUTREACHY] t1002: modernize outdated conditional nsengaw4c via GitGitGadget
2022-10-14  5:05 ` Junio C Hamano
2022-10-14  7:47 ` [PATCH v2] " nsengaw4c via GitGitGadget
2022-10-14  8:01   ` [PATCH v3] " nsengaw4c via GitGitGadget
2022-10-14 16:15     ` Junio C Hamano
2022-10-14 16:21       ` Derrick Stolee
2022-10-14 16:58         ` Eric Sunshine
2022-10-14 17:54           ` Derrick Stolee
2022-10-14 18:57             ` Junio C Hamano
2022-10-14 19:06           ` Junio C Hamano
2022-10-14 19:14             ` Eric Sunshine
2022-10-14 20:41               ` Junio C Hamano
2022-10-14 20:19             ` Philip Oakley
2022-10-14 20:42               ` Junio C Hamano
2022-10-14 18:28     ` [PATCH v4] " nsengaw4c via GitGitGadget

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).