Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t9803-git-p4-shell-metachars.sh: update to use test_path_* functions #1700

Conversation

sanchit1053
Copy link

@sanchit1053 sanchit1053 commented Mar 20, 2024

I have updated the statements test [!] -[e|f] with the corresponding test_path_* functions
The statements are at the end of their respective texts and can be easily replaced

I am having trouble with the git send-email and my institutes firewall, that is why I am trying to use gitgitgadget

cc: Eric Sunshine sunshine@sunshineco.com

Signed-off-by: sanchit1053 <sanchit1053@gmail.com>
Copy link

gitgitgadget bot commented Mar 20, 2024

Welcome to GitGitGadget

Hi @sanchit1053, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that either:

  • Your Pull Request has a good description, if it consists of multiple commits, as it will be used as cover letter.
  • Your Pull Request description is empty, if it consists of a single commit, as the commit message should be descriptive enough by itself.

You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will not actually be sent emails.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

Need help?

New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, #git-devel on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

@sunshineco
Copy link

/allow

Copy link

gitgitgadget bot commented Mar 20, 2024

User sanchit1053 is now allowed to use GitGitGadget.

WARNING: sanchit1053 has no public email address set on GitHub;
GitGitGadget needs an email address to Cc: you on your contribution, so that you receive any feedback on the Git mailing list. Go to https://github.com/settings/profile to make your preferred email public to let GitGitGadget know which email address to use.

@sanchit1053
Copy link
Author

/submit

Copy link

gitgitgadget bot commented Mar 20, 2024

Error: Could not determine full name of sanchit1053

@sanchit1053
Copy link
Author

sanchit1053 commented Mar 20, 2024

/submit

Copy link

gitgitgadget bot commented Mar 20, 2024

Submitted as pull.1700.git.1710964109659.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1700/sanchit1053/sj/t8903_use_path_helper_fn-v1

To fetch this version to local tag pr-1700/sanchit1053/sj/t8903_use_path_helper_fn-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1700/sanchit1053/sj/t8903_use_path_helper_fn-v1

@sanchit1053 sanchit1053 deleted the sj/t8903_use_path_helper_fn branch March 20, 2024 19:56
Copy link

gitgitgadget bot commented Mar 20, 2024

On the Git mailing list, Eric Sunshine wrote (reply to this):

On Wed, Mar 20, 2024 at 3:48 PM Sanchit Jindal via GitGitGadget
<gitgitgadget@gmail.com> wrote:
> From: sanchit1053 <sanchit1053@gmail.com>
>
> Signed-off-by: sanchit1053 <sanchit1053@gmail.com>

Thanks for submitting a microproject. Some comments...

The From: and Signed-off-by: lines should include your full name and
email address, so probably:

    From: Sanchit Jindal <sanchit1053@gmail.com>
    ...
    Signed-off-by: Sanchit Jindal <sanchit1053@gmail.com>

Reviewers would like to know why the changes made by the patch are
desirable, so use the space between From: and Signed-off-by: to
explain the rationale for the patch. This particular case doesn't
require much explanation, but you may want to say something about how
the `test_path_*` functions provide useful diagnostics when they fail
whereas `test` does not.

> ---
>     t9803-git-p4-shell-metachars.sh: update to use test_path_* functions
>
>     I have updated the statements test [!] -[e|f] with the corresponding
>     test_path_* functions The statements are at the end of their respective
>     texts and can be easily replaced
>
>     I am having trouble with the git send-email and my institutes firewall,
>     that is why I am trying to use gitgitgadget

This portion after the "---" line is for commentary which doesn't
become part of the official commit message (unlike the portion above
the "---" lines). When you resubmit, you can use this commentary area
to explain what you changed between v1 and v2 (which, in this case,
will just be adding a commit message and fixing the From: and
Signed-off-by: lines). GitGitGadget inserts what you wrote in the PR's
description into this area below the "---" line, so you'll want to
update the PR's description to explain what changed between v1 and v2.

> diff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh
> @@ -33,8 +33,8 @@ test_expect_success 'shell metachars in filenames' '
> -               test -e "file with spaces" &&
> -               test -e "foo\$bar"
> +               test_path_exists "file with spaces" &&
> +               test_path_exists "foo\$bar"
> @@ -52,8 +52,8 @@ test_expect_success 'deleting with shell metachars' '
> -               test ! -e "file with spaces" &&
> -               test ! -e foo\$bar
> +               test_path_is_missing "file with spaces" &&
> +               test_path_is_missing foo\$bar
> @@ -100,8 +100,8 @@ test_expect_success 'branch with shell char' '
> -               test -f shell_char_branch_file &&
> -               test -f f1
> +               test_path_is_file shell_char_branch_file &&
> +               test_path_is_file f1

These changes all look trivially correct and faithfully retain the
intention of the original `test` checks. Good.

Copy link

gitgitgadget bot commented Mar 20, 2024

User Eric Sunshine <sunshine@sunshineco.com> has been added to the cc: list.

Copy link

gitgitgadget bot commented Mar 20, 2024

On the Git mailing list, Junio C Hamano wrote (reply to this):

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

> From: sanchit1053 <sanchit1053@gmail.com>
>
> Signed-off-by: sanchit1053 <sanchit1053@gmail.com>
> ---

>     t9803-git-p4-shell-metachars.sh: update to use test_path_* functions
>     
>     I have updated the statements test [!] -[e|f] with the corresponding
>     test_path_* functions The statements are at the end of their respective
>     texts and can be easily replaced
>     
>     I am having trouble with the git send-email and my institutes firewall,
>     that is why I am trying to use gitgitgadget

A few minor points.

 * As our test numbers uniquely identify test scripts, your commit
   title can be "t9803: use test_path_* helpers".

 * We prefer to see the patches signed with real name.  As you seem
   to have let your name known to GGG, I am assuming "sanchit1053"
   is not a name you chose for anonymity.  You would want to, at
   least while you are working for this project, have something like

     $ git config user.name "Sanchit Jindal"

   in the repository you use to work on Git.

 * The proposed commit log message is empty; you seem to have a lot
   more after the three-dash lines, which probably came from pull
   request message you gave GGG.  The single paragraph that talks
   about "test [!] -[e|f]" should go between From: and Signed-off-by:
   but refer to Documentation/SubmittingPatches:[[describe-changes]]
   while reading the message again and updating it.

The patch text below looks good to me (but that is to be
expected---a microproject is not a practice about coding, but is
a practice about interacting with reviewers and going through a
contribution process).

Thanks.


>  t/t9803-git-p4-shell-metachars.sh | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/t/t9803-git-p4-shell-metachars.sh b/t/t9803-git-p4-shell-metachars.sh
> index 2913277013d..4905ed2ae9e 100755
> --- a/t/t9803-git-p4-shell-metachars.sh
> +++ b/t/t9803-git-p4-shell-metachars.sh
> @@ -33,8 +33,8 @@ test_expect_success 'shell metachars in filenames' '
>  	(
>  		cd "$cli" &&
>  		p4 sync ... &&
> -		test -e "file with spaces" &&
> -		test -e "foo\$bar"
> +		test_path_exists "file with spaces" &&
> +		test_path_exists "foo\$bar"
>  	)
>  '
>  
> @@ -52,8 +52,8 @@ test_expect_success 'deleting with shell metachars' '
>  	(
>  		cd "$cli" &&
>  		p4 sync ... &&
> -		test ! -e "file with spaces" &&
> -		test ! -e foo\$bar
> +		test_path_is_missing "file with spaces" &&
> +		test_path_is_missing foo\$bar
>  	)
>  '
>  
> @@ -100,8 +100,8 @@ test_expect_success 'branch with shell char' '
>  		git p4 clone --dest=. --detect-branches //depot@all &&
>  		git log --all --graph --decorate --stat &&
>  		git reset --hard p4/depot/branch\$3 &&
> -		test -f shell_char_branch_file &&
> -		test -f f1
> +		test_path_is_file shell_char_branch_file &&
> +		test_path_is_file f1
>  	)
>  '
>  
>
> base-commit: 3bd955d26919e149552f34aacf8a4e6368c26cec

Copy link

gitgitgadget bot commented Mar 20, 2024

On the Git mailing list, Eric Sunshine wrote (reply to this):

On Wed, Mar 20, 2024 at 4:46 PM Junio C Hamano <gitster@pobox.com> wrote:
> A few minor points.
>
>  * As our test numbers uniquely identify test scripts, your commit
>    title can be "t9803: use test_path_* helpers".

I meant to mention this, as well, in my review but forgot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants