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

Re: [PATCH 2/2] sh-setup: make require_clean_work_tree() work on orphan branches

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2016, 00:06 UTC
Message-ID
<xmqq7fj33ifq.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1448376345-27339-2-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
> git-sh-setup's require_clean_work_tree() always exits with error on an
> orphan branch, even when the index and worktree are both clean.

Ah, I just sent a review on 1/2 as I found it was not commented on by anybody, but re-reading this sentence (and subsequent review of this 2/2) makes it clear this is not a good idea. By definition, the index immediately after creating and getting on an orphan branch is not clean [*1*].

I'll move the topic from "Needs review" to "Will discard" pile in my tree.

Sorry for the noise.
[Footnote]

*1* Roughly speaking, if "git commit" (no arguments) to record the state of the index succeeds without "--allow-empty", your index is dirty with respect to HEAD.

Previous: SZEDER GáborNext: Junio C Hamano
Message 8 of 11 in “Add tests for git-sh-setup's require_clean_work_tree()”
  1. 1/2 Add tests for git-sh-setup's require_clean_work_tree()SZEDER Gábor, Nov 24, 2015
  2. 2/2 sh-setup: make require_clean_work_tree() work on orphan branchesSZEDER Gábor, Nov 24, 2015
  3. Jeff KingNov 24, 2015
  4. SZEDER GáborNov 30, 2015
  5. Junio C HamanoDec 2, 2015
  6. Johannes SixtNov 25, 2015
  7. SZEDER GáborNov 30, 2015
  8. Junio C HamanoJan 21, 2016
  9. Junio C HamanoJan 20, 2016
  10. SZEDER GáborJan 21, 2016
  11. Junio C HamanoJan 21, 2016

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.