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

Re: [PATCH v8 4/4] worktree: add 'list' command

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 24, 2015, 05:00 UTC
Message-ID
<xmqqvbb0v2bi.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CANoM8SX28TPt_U8v9HO4yo=M46-JKn5S11DrhZ0-EdrjkDT3EQ@mail.gmail.com>
Mike Rappazzo <rappazzo@gmail.com> writes:
Show 5 quoted lines
> ...  Does the porcelain
> format restrict additive changes?  That is, is it OK for a future
> patch to add another field in the format, as long as it doesn't alter
> the other values?  Is the format that I have used here acceptable
> (assuming the changes proposed below are made)?

It for you, as the designer of the format, to decide what to put in the proposed specification, but I'm sure that we would want it to be extensible. I guess your design is essentially a series of records, each of which begins with a "worktree <path>" line, followed by various attributes, one per line, about that worktree, and each attribute line begins with some fixed keyword so that the reader can tell what attribute the line is talking about (or if the line describes an attribute that the reader does not yet know about), and I think that is an acceptable format.

You need to decide and describe if the value for some attribute can span multiple lines (and define the quoting mechanism if that is the case), what the set of keywords currently defined and what each of these keywords means, and document that the readers are expected to skip a line that begins with an unknown keyword.

Show 7 quoted lines
>> Are the number of SPs here significant and if so in what way?  Does
>> it depend on your environment or will there always be six of them?
>> Either way feels like an indication of a problem.
>
> The number of spaces is significant in this case, but it should not be
> platform dependent.  It is just the padding for the different worktree
> paths.

By environment, I didn't just mean 'platform'. For example, the output from --show-toplevel will be different for me and you as it is likely that the absolute path where I have my repository and you have yours would be different, so the contents of "expect" would also be. I was wondering where that SIX comes from.

The reason why I said it feels like an indication of a problem is because it invites this question: If it is uniformly SIX no matter what the user's environment is, why does it have to be SIX and not other value, say, ONE, for example?

Previous: Mike Rappazzo
Message 11 of 11 in “worktree: list functions and command”
  1. 0/4 worktree: list functions and commandMichael Rappazzo, Sep 18, 2015
  2. 1/4 worktree: add top-level worktree.cMichael Rappazzo, Sep 18, 2015
  3. Junio C HamanoSep 22, 2015
  4. 2/4 worktree: refactor find_linked_symref functionMichael Rappazzo, Sep 18, 2015
  5. Junio C HamanoSep 22, 2015
  6. 3/4 worktree: add functions to get worktree detailsMichael Rappazzo, Sep 18, 2015
  7. Junio C HamanoSep 22, 2015
  8. 4/4 worktree: add 'list' commandMichael Rappazzo, Sep 18, 2015
  9. Junio C HamanoSep 22, 2015
  10. Mike RappazzoSep 24, 2015
  11. Junio C HamanoSep 24, 2015

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.