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

Re: [PATCH 1/2] restore: require --source when combining --worktree and --staged

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 1, 2020, 08:49 UTC
Message-ID
<CAPig+cR4VpyAzqok8+QoUgQQc=mS-ooD8+PUCPMuO6XQ21dL6w@mail.gmail.com>
In-Reply-To
<20200501082746.23943-2-sunshine@sunshineco.com>
On Fri, May 1, 2020 at 4:28 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 7 quoted lines
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> @@ -1604,6 +1604,9 @@ static int checkout_main(int argc, const char **argv, const char *prefix,
>         }
>         if (opts->checkout_index < 0 || opts->checkout_worktree < 0)
>                 BUG("these flags should be non-negative by now");
> +       if (opts->checkout_index > 0 && opts->checkout_worktree > 0 &&
> +           !opts->from_treeish)

If I re-roll the series for some reason, I'll drop the unnecessary "> 0". (But this code goes away in patch 2/2 anyhow, so I'm not too worried about it.)

Previous: Eric SunshineNext: Taylor Blau
Message 3 of 10 in “enhance "git restore --worktree --staged" behavior”
  1. 0/2 enhance "git restore --worktree --staged" behaviorEric Sunshine, May 1, 2020
  2. 1/2 restore: require --source when combining --worktree and --stagedEric Sunshine, May 1, 2020
  3. Eric SunshineMay 1, 2020
  4. Taylor BlauMay 1, 2020
  5. 2/2 restore: default to HEAD when combining --worktree and --stagedEric Sunshine, May 1, 2020
  6. Junio C HamanoMay 1, 2020
  7. Eric SunshineMay 5, 2020
  8. Taylor BlauMay 1, 2020
  9. Eric SunshineMay 5, 2020
  10. Taylor BlauMay 5, 2020

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.