threads / patch / 49442

patchgit-completion.bash: Add completion for stash list

Subject: [PATCH] git-completion.bash: Add completion for stash list

## tl;dr

3 messages between Sep 27, 2018 and Oct 10, 2018. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Steve· Sep 27, 2018, 19:59 UTC · lore

Since stash list accepts git-log options, add the following useful options that make sense in the context of the `git stash list` command:

  --name-status --oneline --patch-with-stat
Signed-off-by: Steven Fernandez <steve@lonetwin.net>
---

This is my first patch to the project so please be excuse any process errors. Although, I've tried my best to follow the guidelines in Documentation/SubmittingPatches but I'm not sure if I missed anything.

 contrib/completion/git-completion.bash | 3 +++
 1 file changed, 3 insertions(+)
Show changes to diff +3 −0
diff --git contrib/completion/git-completion.bash
contrib/completion/git-completion.bash
index d63d2dffd..06ec6ca11 100644
--- contrib/completion/git-completion.bash
+++ contrib/completion/git-completion.bash
@@ -2567,6 +2567,9 @@ _git_stash ()
 		drop,--*)
 			__gitcomp "--quiet"
 			;;
+		list,--*)
+			__gitcomp "--name-status --oneline --patch-
with-stat"
+			;;
 		show,--*|branch,--*)
 			;;
 		branch,*)
-- 
2.17.1
Junio C Hamano· Oct 7, 2018, 01:08 UTC · re: Steve · lore

Re: [PATCH] git-completion.bash: Add completion for stash list

Steve <steve@lonetwin.net> writes:
Show 12 quoted lines
> Since stash list accepts git-log options, add the following useful
> options that make sense in the context of the `git stash list` command:
>
>   --name-status --oneline --patch-with-stat
>
> Signed-off-by: Steven Fernandez <steve@lonetwin.net>
> ---
>
> This is my first patch to the project so please be excuse any process
> errors.
> Although, I've tried my best to follow the guidelines in
> Documentation/SubmittingPatches but I'm not sure if I missed anything.

Thanks. Will queue with manual fix-ups, but since you asked, here are the things I'll be fixing up manually, which you may want to avoid next time.

 (1) We strongly prefer to see contributor's identity recorded as
     the "author" of a commit to match the sign-off from the
     contributor.  Your MSA sent your message with only the more
     casual version of your first name on the "From: " header, which
     does not match your sign-off.  It would have been more correct
     if you added two lines at the beginning of the body of the
     message, i.e. before "Since stash list accepts...".  The first
     line would be
	From: Steven Fernandez <steve@lonetwin.net>
     and then you would have a blank line immediately after that.
     Your "Since stash list accepts..." would become the third line
     of the body.  That will tell the receiving end that the author
     identity of the resulting commit should not be "Steve" but
     should be "Steven Fernandez".
 (2) "git shortlog --no-merges" would show that we tend not to
     capitalize the first word after "<area>:" on the subject line.
 (3) Your patch is line-wrapped (see below that has with-stat on its
     own line after the line you intended it to go).
 (4) You somehow generated your patch with "-p0".  It is OK to do
     whatever for your own use, but patch submission is 
     communication with others, so don't be original by doing
     unusual things.

None of the above is something I cannot fix on the receiving end myself, but at the same time, it is not something people should be wasting maintainer's time on, and small wastes add up.

Show 19 quoted lines
>  contrib/completion/git-completion.bash | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git contrib/completion/git-completion.bash
> contrib/completion/git-completion.bash
> index d63d2dffd..06ec6ca11 100644
> --- contrib/completion/git-completion.bash
> +++ contrib/completion/git-completion.bash
> @@ -2567,6 +2567,9 @@ _git_stash ()
>  		drop,--*)
>  			__gitcomp "--quiet"
>  			;;
> +		list,--*)
> +			__gitcomp "--name-status --oneline --patch-
> with-stat"
> +			;;
>  		show,--*|branch,--*)
>  			;;
>  		branch,*)
steve@lonetwin.net· Oct 10, 2018, 13:34 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-completion.bash: Add completion for stash list

On 2018-10-07 2:08 am, Junio C Hamano wrote:
Show 20 quoted lines
> Steve <steve@lonetwin.net> writes:
> 
>> Since stash list accepts git-log options, add the following useful
>> options that make sense in the context of the `git stash list` 
>> command:
>> 
>>   --name-status --oneline --patch-with-stat
>> 
>> Signed-off-by: Steven Fernandez <steve@lonetwin.net>
>> ---
>> 
>> This is my first patch to the project so please be excuse any process
>> errors.
>> Although, I've tried my best to follow the guidelines in
>> Documentation/SubmittingPatches but I'm not sure if I missed anything.
> 
> Thanks.  Will queue with manual fix-ups, but since you asked, here
> are the things I'll be fixing up manually, which you may want to
> avoid next time.
> 

Thanks for accepting the patchset and the manual fixes. Thanks a lot also for taking the time to explain the mistakes to avoid.

cheers, Steve

← back to recent threads