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

Re: [PATCH 5/5] rebase: use 'git stash store' to simplify logic

From
Phil Hord <phil.hord@gmail.com>
Date
Jun 14, 2013, 12:47 UTC
Message-ID
<CABURp0rEzKwE__Sg+Z66iOo7qZn0NKPzPuuhb52taBs8zyga=Q@mail.gmail.com>
In-Reply-To
<1371205924-8982-6-git-send-email-artagnon@gmail.com>

On Fri, Jun 14, 2013 at 6:32 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 23 quoted lines
> rebase has no reason to know about the implementation of the stash.  In
> the case when applying the autostash results in conflicts, replace the
> relevant code in finish_rebase () to simply call 'git stash store'.
>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
>  git-rebase.sh | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index d0c11a9..bf37259 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -153,11 +153,7 @@ finish_rebase () {
>                 then
>                         echo "$(gettext 'Applied autostash.')"
>                 else
> -                       ref_stash=refs/stash &&
> -                       >>"$GIT_DIR/logs/$ref_stash" &&
> -                       git update-ref -m "autostash" $ref_stash $stash_sha1 ||
> -                       die "$(eval_gettext 'Cannot store $stash_sha1')"
> -
> +                       git stash store -m "autostash" -e "Cannot store $stash_sha1." $stash_sha1
nit: adds a period where there was not one previously.

Maybe this doesn't matter so much since this code is new anyway. But showing a period after sha1 seems wrong, too. Or maybe I am confused again. Does eval_gettext routinely add a period to the end of translated strings?

Show 10 quoted lines
>                         gettext 'Applying autostash resulted in conflicts.
>  Your changes are safe in the stash.
>  You can run "git stash pop" or "git stash drop" it at any time.
> --
> 1.8.3.1.383.g0d5ad6b
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 10 of 13 in “Write a good 'git stash store' for autostash”
  1. 0/5 Write a good 'git stash store' for autostashRamkumar Ramachandra, Jun 14, 2013
  2. 1/5 stash doc: add a warning about using createRamkumar Ramachandra, Jun 14, 2013
  3. Phil HordJun 14, 2013
  4. Junio C HamanoJun 14, 2013
  5. 2/5 stash doc: document short form -p in synopsisRamkumar Ramachandra, Jun 14, 2013
  6. 3/5 stash: simplify option parser for createRamkumar Ramachandra, Jun 14, 2013
  7. 4/5 stash: introduce 'git stash store'Ramkumar Ramachandra, Jun 14, 2013
  8. Phil HordJun 14, 2013
  9. 5/5 rebase: use 'git stash store' to simplify logicRamkumar Ramachandra, Jun 14, 2013
  10. Phil HordJun 14, 2013
  11. Ramkumar RamachandraJun 14, 2013
  12. Junio C HamanoJun 14, 2013
  13. Ramkumar RamachandraJun 14, 2013

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.