Message ID | pull.1362.v3.git.git.1665734502591.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [v3,OUTREACHY] t1002: modernize outdated conditional | expand |
"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.
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
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?
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
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.
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.
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.
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
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)?
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.
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 \