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

Re: [RFC] deprecate git stash save? (was: Re: [PATCH 2/3] http-push: fix construction of hex value from path)

From
Jeff King <peff@peff.net>
Date
Oct 17, 2017, 04:13 UTC
Message-ID
<20171017041332.ooybecmonvssko2k@sigill.intra.peff.net>
In-Reply-To
<20171005200049.GF30301@hank>
On Thu, Oct 05, 2017 at 09:00:49PM +0100, Thomas Gummerer wrote:
Show 16 quoted lines
> Since you were asking :)  With the introduction of 'git stash push',
> my hope was always that we could eventually get rid of 'git stash
> save' and only keep one interface around.
> 
> As there still many references to it around on the internet, it
> probably requires a bit of a longer deprecation plan.  What do you
> think about the following:
> 
> - Change docs/man pages to use 'git stash push' everywhere instead of
>   'git stash save'.
> - Mention the deprecation in the release notes and in the man page.
> - Print a warning when 'git stash save' is used.
> - Eventually get rid of it (maybe something for 3.0?)
> 
> The steps above would all occur sequentially with a few releases
> between each of them.
That sounds like a pretty good plan.
> A patch for the first step below.  I think that even makes sense if we
> don't want to follow through with the deprecation.
Agreed. The patch mostly looks good, except:
Show 11 quoted lines
> diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
> index b4d88af133..1c4e44892d 100644
> --- a/Documentation/user-manual.txt
> +++ b/Documentation/user-manual.txt
> @@ -1556,7 +1556,7 @@ so on a different branch and then coming back), unstash the
>  work-in-progress changes.
>  
>  ------------------------------------------------
> -$ git stash save "work in progress for foo feature"
> +$ git stash push "work in progress for foo feature"
>  ------------------------------------------------
This needs "-m", doesn't it?
Show 20 quoted lines
>  
>  This command will save your changes away to the `stash`, and
> diff --git a/git-stash.sh b/git-stash.sh
> index 8b2ce9afda..8ce6929d7f 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -267,11 +267,11 @@ push_stash () {
>  			# translation of "error: " takes in your language. E.g. in
>  			# English this is:
>  			#
> -			#    $ git stash save --blah-blah 2>&1 | head -n 2
> -			#    error: unknown option for 'stash save': --blah-blah
> -			#           To provide a message, use git stash save -- '--blah-blah'
> -			eval_gettextln "error: unknown option for 'stash save': \$option
> -       To provide a message, use git stash save -- '\$option'"
> +			#    $ git stash push --blah-blah 2>&1 | head -n 2
> +			#    error: unknown option for 'stash push': --blah-blah
> +			#           To provide a message, use git stash push -- '--blah-blah'
> +			eval_gettextln "error: unknown option for 'stash push': \$option
> +       To provide a message, use git stash push -- '\$option'"
And here, too?
-Peff
Previous: Thomas GummererNext: Thomas Gummerer
Message 13 of 30 in “[RFC] deprecate git stash save? (was: Re: [PATCH 2/3] http-push: fix construction of hex value from path)”
  1. Thomas GummererOct 5, 2017
  2. 2/1 mention git stash push first in the man pageThomas Gummerer, Oct 5, 2017
  3. Jeff KingOct 17, 2017
  4. Thomas GummererOct 17, 2017
  5. Jeff KingOct 17, 2017
  6. Thomas GummererOct 19, 2017
  7. Robert P. J. DayOct 20, 2017
  8. Jeff KingOct 21, 2017
  9. Robert P. J. DayOct 21, 2017
  10. Junio C HamanoOct 12, 2017
  11. Junio C HamanoOct 12, 2017
  12. Thomas GummererOct 16, 2017
  13. Jeff KingOct 17, 2017
  14. Thomas GummererOct 17, 2017
  15. 1/2 replace git stash save with git stash push in the documentationThomas Gummerer, Oct 19, 2017
  16. 2/2 mark git stash push deprecated in the man pageThomas Gummerer, Oct 19, 2017
  17. Jeff KingOct 21, 2017
  18. Thomas GummererOct 22, 2017
  19. 0/3 deprecate git stash saveThomas Gummerer, Oct 22, 2017
  20. 1/3 replace git stash save with git stash push in the documentationThomas Gummerer, Oct 22, 2017
  21. 2/3 mark git stash push deprecated in the man pageThomas Gummerer, Oct 22, 2017
  22. 3/3 stash: remove now superfluos help for "stash push"Thomas Gummerer, Oct 22, 2017
  23. Jeff KingOct 23, 2017
  24. Junio C HamanoOct 23, 2017
  25. Jeff KingOct 23, 2017
  26. Junio C HamanoOct 23, 2017
  27. Robert P. J. DayOct 23, 2017
  28. Junio C HamanoOct 23, 2017
  29. Jeff KingOct 21, 2017
  30. Thomas GummererOct 22, 2017

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.