git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] stash: drop superfluos pathspec parameter

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2018, 22:07 UTC
Message-ID
<xmqqzi31m6ag.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180321215310.GH2224@hank>
Thomas Gummerer <t.gummerer@gmail.com> writes:
Show 12 quoted lines
> On 03/21, Thomas Gummerer wrote:
>>
>> Argh I just noticed we could drop the "$@" here, as this is no longer
>> the pathspec case.  It doesn't hurt anything, except it may be a bit
>> confusing when reading the code.
>> 
>> Although if we end up implementing 'git checkout --index <pathspec>',
>> we'd have to add it back, but we do have a test covering this case, so
>> there's no worries about forgetting to add it back.
>
> Here's a patch for that.  Not sure it's worth doing, but since we're
> already touching the area, this may be a good cleanup.

OK, I can go either way, and since you have already written a change, let's not waste it ;-)

Thanks.
Show 29 quoted lines
>
> This is based on top of tg/stash-untracked-with-pathspec-fix.
>
> --- >8 ---
> Subject: [PATCH] stash: drop superfluos pathspec parameter
>
> Since 833622a945 ("stash push: avoid printing errors", 2018-03-19) we
> don't use the 'git clean' call for the pathspec case anymore.  The
> commit however forgot to remove the pathspec argument to the call.
> Remove the superfluos argument to make the code a little more obvious.
>
> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
> ---
>  git-stash.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index 4e55f278bd..d31924aea3 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -310,7 +310,7 @@ push_stash () {
>  		test "$untracked" = "all" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=
>  		if test -n "$untracked" && test $# = 0
>  		then
> -			git clean --force --quiet -d $CLEAN_X_OPTION -- "$@"
> +			git clean --force --quiet -d $CLEAN_X_OPTION
>  		fi
>  
>  		if test $# != 0
Previous: Thomas GummererNext: Junio C Hamano
Message 28 of 33 in “git stash push -u always warns "pathspec '...' did not match any files"”
  1. Marc StrapetzMar 3, 2018
  2. Thomas GummererMar 3, 2018
  3. Marc StrapetzMar 4, 2018
  4. Junio C HamanoMar 9, 2018
  5. Marc StrapetzMar 10, 2018
  6. Thomas GummererMar 10, 2018
  7. 1/2 stash push: avoid printing errorsThomas Gummerer, Mar 14, 2018
  8. 2/2 stash push -u: don't create empty stashThomas Gummerer, Mar 14, 2018
  9. Junio C HamanoMar 15, 2018
  10. Thomas GummererMar 16, 2018
  11. Marc StrapetzMar 15, 2018
  12. Thomas GummererMar 16, 2018
  13. 0/2 stash push -u -- <pathspec> fixesThomas Gummerer, Mar 16, 2018
  14. 2/2 stash push -u: don't create empty stashThomas Gummerer, Mar 16, 2018
  15. 1/2 stash push: avoid printing errorsThomas Gummerer, Mar 16, 2018
  16. Junio C HamanoMar 16, 2018
  17. 0/3 stash push -u -- <pathspec> fixesJunio C Hamano, Mar 16, 2018
  18. 2/3 stash push: avoid printing errorsJunio C Hamano, Mar 16, 2018
  19. 1/3 stash: fix nonsense pipelineJunio C Hamano, Mar 16, 2018
  20. 3/3 stash push -u: don't create empty stashJunio C Hamano, Mar 16, 2018
  21. Thomas GummererMar 17, 2018
  22. 0/3 stash push -u -- <pathspec> fixesThomas Gummerer, Mar 19, 2018
  23. 1/3 stash: fix nonsense pipelineThomas Gummerer, Mar 19, 2018
  24. 2/3 stash push: avoid printing errorsThomas Gummerer, Mar 19, 2018
  25. Junio C HamanoMar 20, 2018
  26. Thomas GummererMar 21, 2018
  27. stash: drop superfluos pathspec parameter (was: Re: [PATCH v5 2/3] stash push: avoid printing errors)Thomas Gummerer, Mar 21, 2018
  28. Junio C HamanoMar 21, 2018
  29. Junio C HamanoMar 21, 2018
  30. 3/3 stash push -u: don't create empty stashThomas Gummerer, Mar 19, 2018
  31. Marc StrapetzMar 20, 2018
  32. Marc StrapetzMar 19, 2018
  33. Thomas GummererMar 19, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.