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

Re: [PATCH 1/3] rebase: guard against missing files in read_basic_state()

From
Martin von Zweigbergk <martinvonz@gmail.com>
Date
Jun 16, 2013, 05:45 UTC
Message-ID
<CANiSa6hUV-xMMASbJf67j0Zn+Mu25CRcvQThNd1EuemhSBB6Rg@mail.gmail.com>
In-Reply-To
<7vy5adskz3.fsf@alter.siamese.dyndns.org>
On Thu, Jun 13, 2013 at 3:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
> A more troublesome is that nobody seems to check the return value of
> this function.  If head-name, onto or orig-head is missing, is that
> an error condition that should make the callers of read_basic_state
> stop and refuse to proceed?

Since we unconditionally write those three (and 'quiet'), it seems reasonable to require all of them to be there when continuing, so I think you're right that we should fail fast.

Show 8 quoted lines
> The way the && cascade is used seems to indicate that, but up to the
> point where it sents $verbose. If and only if head-name, onto, orig-head
> and quiet can be read in state-dir, verbose in state-dir is checked
> and only then $verbose is set.
>
> Martin, this seems to be from your series around early Feburary
> 2011.  Do you recall why these checks are cascaded this way?
> I do not offhand think of a good reason.

Neither do I. I think the cascading after 'quiet' is just a mistake on my part. The consequences are probably close to none, since if one of earlier commands fail, the other files will probably not be there either. (Not defending it; I'm happy if it gets fixed, e.g. by making it fail fast.)

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “Fix a couple of edge cases in autostash”
  1. 0/3 Fix a couple of edge cases in autostashRamkumar Ramachandra, Jun 13, 2013
  2. 1/3 rebase: guard against missing files in read_basic_state()Ramkumar Ramachandra, Jun 13, 2013
  3. Junio C HamanoJun 13, 2013
  4. Martin von ZweigbergkJun 16, 2013
  5. Junio C HamanoJun 20, 2013
  6. 2/3 rebase: finish_rebase() in fast-forward rebaseRamkumar Ramachandra, Jun 13, 2013
  7. 3/3 rebase: finish_rebase() in noop rebaseRamkumar Ramachandra, Jun 13, 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.