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

Re: [PATCH 0/3] git-describe deals gracefully with broken submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2017, 06:54 UTC
Message-ID
<xmqq37e7t902.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq7f3jta7o.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> I do not have a strong preference for or against the "treat a broken
> repository as if nothing is wrong with the revision, but just mark
> it as dirty" idea.  I would be more receptive if it substituted the
> "-dirty" marker with something else, e.g. "-broken", though.
> ...
> But it is possible there may be a reason why submodules are special.
> I do not think the third paragraph quoted above is a good
> justification.  A repository with broken submodule is just as broken
> and untrustworthy as a broken repository without a submodule, and if
> you want to allow such a checkout with broken submodule to call
> itself v2.0-dirty, you would also want to allow a broken checkout
> without any submodule to do so, too.

Having said all that, if I thought it were a good idea to optionally allow people to treat "repository is corrupt in some ways to make it impossible for us if the checkout is dirty or not, even though we are fairly certain what commit .git/HEAD points at is" as a state that is describable, I probably would

 - introduce a new "git describe --possibly-broken" option;
 - instead of running "diff-index" internally to decide the "-dirty"
   state, spawn "diff-index" as a separate process;
 - observe the exit status from "diff-index" and add "-dirty" suffix
   when it is _known_ to be dirty, add "-broken" suffix when it
   died, and leave out the suffix when we know that the checkout is
   clean.

That way, we wouldn't have to contaminate the generic codepath with a "treat broken and modified states as if they are the same" logic, only to support such a niche feature that we wouldn't want to use anywhere else.

Previous: Junio C HamanoNext: Stefan Beller
Message 6 of 15 in “git-describe deals gracefully with broken submodules”
  1. 0/3 git-describe deals gracefully with broken submodulesStefan Beller, Mar 21, 2017
  2. 1/3 submodule.c: port is_submodule_modified to use porcelain 2Stefan Beller, Mar 21, 2017
  3. 3/3 builtin/describe: introduce --submodule-error-as-dirty flagStefan Beller, Mar 21, 2017
  4. 2/3 revision machinery: gentle submodule errorsStefan Beller, Mar 21, 2017
  5. Junio C HamanoMar 21, 2017
  6. Junio C HamanoMar 21, 2017
  7. builtin/describe: introduce --broken flagStefan Beller, Mar 21, 2017
  8. Junio C HamanoMar 21, 2017
  9. Stefan BellerMar 21, 2017
  10. Junio C HamanoMar 21, 2017
  11. Stefan BellerMar 21, 2017
  12. builtin/describe: introduce --broken flagStefan Beller, Mar 21, 2017
  13. Junio C HamanoMar 22, 2017
  14. Jakub NarębskiMar 22, 2017
  15. Stefan BellerMar 21, 2017

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.