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

RE: [PATCH 0/4] [RFC] merge --autostash: apply autostash in more cases

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 23, 2021, 16:10 UTC
Message-ID
<60faea007b6ce_defb20871@natae.notmuch>
In-Reply-To
<pull.1002.git.1627042470.gitgitgadget@gmail.com>
Philippe Blain via GitGitGadget wrote:
Show 21 quoted lines
> This series aims to apply the stash created by 'git merge --autostash' in 2
> situations that were not covered by the code:
> 
>  1. If the merge is fast-forward but the fast-forward operation fails -
>     PATCH 3/4
>  2. If the merge strategy completely fails to handle the merge (exit code 2)
>     - PATCH 4/4
> 
> The first 2 commits are small improvements that I noticed while implementing
> the other two.
> 
> I'm marking it [RFC] because I'm not 100% sure that trying to apply the
> autostash in 3/4 and 4/4 is actually the best course of action (or if it
> would be better to call 'save_autostash' instead). That's because:
> 
> For 3/4 (fast-forward fails): I'm not sure if 'unpack_trees' (called by
> 'checkout_fast_forward') is guaranteed to fail atomically, or it might fail
> mid-way and leave the worktree unclean, in which case it might be better not
> to apply the autostash, but just save it instead (and tell the user). In the
> test case I'm adding, it does fail before starting to update the working
> tree, but I'm not sure if it's always the case.

I'm not familiar with unpack_trees, but sans that possibility the whole series looks fine to me.

-- 
Felipe Contreras
Previous: Junio C Hamano
Message 11 of 11 in “[RFC] merge --autostash: apply autostash in more cases”
  1. 0/4 [RFC] merge --autostash: apply autostash in more casesPhilippe Blain via GitGitGadget, Jul 23, 2021
  2. 1/4 merge: add missing word "strategy" to a messagePhilippe Blain via GitGitGadget, Jul 23, 2021
  3. Felipe ContrerasJul 23, 2021
  4. 3/4 merge: apply autostash if fast-forward failsPhilippe Blain via GitGitGadget, Jul 23, 2021
  5. Felipe ContrerasJul 23, 2021
  6. Junio C HamanoJul 23, 2021
  7. 2/4 Documentation: define 'MERGE_AUTOSTASH'Philippe Blain via GitGitGadget, Jul 23, 2021
  8. Felipe ContrerasJul 23, 2021
  9. 4/4 merge: apply autostash if merge strategy failsPhilippe Blain via GitGitGadget, Jul 23, 2021
  10. Junio C HamanoJul 23, 2021
  11. Felipe ContrerasJul 23, 2021

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.