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

Re: [PATCH 7/7] worktree: document `list` verbose and prunable annotations

From
Rafael Silva <rafaeloliveira.cs@gmail.com>
Date
Jan 8, 2021, 07:49 UTC
Message-ID
<gohp6kturrc2fk.fsf@gmail.com>
In-Reply-To
<CAPig+cRtd9V_ko1gNmueKWbJvna80mMgdvj6_06afK8JzypAOg@mail.gmail.com>
Eric Sunshine writes:
Show 20 quoted lines
> On Mon, Jan 4, 2021 at 11:22 AM Rafael Silva
> <rafaeloliveira.cs@gmail.com> wrote:
>> Update the documentation with "git worktree list" verbose mode, prunable
>> and locked annotations for the default and porcelain format as part of
>> teaching the command to show prunable working trees and verbose mode.
>>
>> Signed-off-by: Rafael Silva <rafaeloliveira.cs@gmail.com>
>> ---
>> diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
>> @@ -226,9 +227,12 @@ This can also be set up as the default behaviour by using the
>>  -v::
>>  --verbose::
>>         With `prune`, report all removals.
>> +       With `list`, output additional information for working trees.
>
> This leaves the reader wondering what additional information is output
> for `list`. Perhaps a small tweak will help:
>
>     With `list`, output additional information about worktrees (see below).
>
Make sense.
Show 10 quoted lines
>>  --expire <time>::
>>         With `prune`, only expire unused working trees older than `<time>`.
>> +       With `list`, annotate unused working trees older than `<time>` as prunable
>> +       candidates that will be remove by `prune` command if the same option is used.
>
> Perhaps just minimal:
>
>     With `list`, annotate missing worktrees as prunable if they
>     are older than `<time>`.
>
Sounds reasonable.
Show 14 quoted lines
>> @@ -367,13 +371,48 @@ $ git worktree list
>> +The command also shows annotations for each working tree, according to its state.
>> +These annotations are:
>> +
>> + * "locked", if any working tree is locked
>> + * "prunable", if any working tree can be pruned via "git worktree prune".
>
> s/any/the/g
>
> We might want to use backticks around these annotations rather than
> double quotes, and we certainly do want to use backticks around the
> `git worktree prune` command to ensure it is styled consistently with
> other commands in this document.
>
Yes, good catch. It make sense to have backticks here.
Show 13 quoted lines
>> +Note that, the annotation is only moved to the next line only if the
>> +additional text is available, otherwise the text is kept on the same.
>
> Drop the comma between "that, the". Also, too many "only"s in this
> sentence. You can actually drop both of them and the sentence will
> still read fine:
>
>    Note that the annotation is moved to the next line if the
>    additional information is available, otherwise it stays on
>    the same line as the worktree itself.
>
> or something.
>

Thanks for the alternative suggestion. It reads better like this will add change the patch message to something more close to your suggestion.

Show 21 quoted lines
>>  Porcelain Format
>>  ~~~~~~~~~~~~~~~~
>>  The porcelain format has a line per attribute.  Attributes are listed with a
>>  label and value separated by a single space.  Boolean attributes (like `bare`
>>  and `detached`) are listed as a label only, and are present only
>>  if the value is true.  The first attribute of a working tree is always
>> -`worktree`, an empty line indicates the end of the record.  For example:
>> +`worktree`, an empty line indicates the end of the record.
>> ++
>> +In case any of the working trees are locked or is a candidate for pruning
>> +(See DESCRIPTION above) the labels "locked" and "prunable" is also shown
>> +followed by a reason, if available, otherwise only the labels are listed.
>> +For example:
>
> s/(See/(see/
> s/is also/are also/
>
> Let's also use backticks rather than double quotes around `locked` and
> `prunable` to ensure consistent formatting with the other porcelain
> labels `bare` and `detached` which are already in backticks.
>
Nice catch. 
Show 10 quoted lines
> Also, the unnecessary `+` line (seen as `++` in the diff) makes this
> render incorrectly. It renders as:
>
>     +In case any...
>
> To fix it, just leave the line blank between paragraphs.
>
> (If possible, install `asciidoc` and `xmlto` and then run `make html`
> to render the documentation yourself, and open
> Documentation/git-worktree.html in your browser to check the output.)

Sure thing. thanks for the suggestion. I should have rendered the documentation before sending. Apologize for that.

-- 
Thanks
Rafael
Previous: Eric SunshineNext: Rafael Silva
Message 14 of 88 in “teach `worktree list` verbose mode and prunable annotations”
  1. 0/7 teach `worktree list` verbose mode and prunable annotationsRafael Silva, Jan 4, 2021
  2. 3/7 worktree: teach worktree_lock_reason() to gently handle main worktreeRafael Silva, Jan 4, 2021
  3. Eric SunshineJan 6, 2021
  4. Rafael SilvaJan 8, 2021
  5. 6/7 worktree: add tests for `list` verbose and annotationsRafael Silva, Jan 4, 2021
  6. Eric SunshineJan 6, 2021
  7. Eric SunshineJan 7, 2021
  8. Rafael SilvaJan 8, 2021
  9. 4/7 worktree: teach `list` prunable annotation and verboseRafael Silva, Jan 4, 2021
  10. Eric SunshineJan 6, 2021
  11. Rafael SilvaJan 8, 2021
  12. 7/7 worktree: document `list` verbose and prunable annotationsRafael Silva, Jan 4, 2021
  13. Eric SunshineJan 6, 2021
  14. Rafael SilvaJan 8, 2021
  15. 5/7 worktree: `list` escape lock reason in --porcelainRafael Silva, Jan 4, 2021
  16. Phillip WoodJan 5, 2021
  17. worktree: add -z option for list subcommandPhillip Wood, Jan 5, 2021
  18. Eric SunshineJan 7, 2021
  19. Phillip WoodJan 8, 2021
  20. Eric SunshineJan 10, 2021
  21. Eric SunshineJan 6, 2021
  22. Rafael SilvaJan 8, 2021
  23. Eric SunshineJan 6, 2021
  24. 1/7 worktree: move should_prune_worktree() to worktree.cRafael Silva, Jan 4, 2021
  25. Eric SunshineJan 6, 2021
  26. Rafael SilvaJan 8, 2021
  27. Eric SunshineJan 6, 2021
  28. Eric SunshineJan 7, 2021
  29. Rafael SilvaJan 8, 2021
  30. 2/7 worktree: implement worktree_prune_reason() wrapperRafael Silva, Jan 4, 2021
  31. Eric SunshineJan 6, 2021
  32. Rafael SilvaJan 8, 2021
  33. Eric SunshineJan 6, 2021
  34. Rafael SilvaJan 8, 2021
  35. Eric SunshineJan 8, 2021
  36. 0/6 teach `worktree list` verbose mode and prunable annotationsRafael Silva, Jan 17, 2021
  37. 1/6 worktree: libify should_prune_worktree()Rafael Silva, Jan 17, 2021
  38. 4/6 worktree: teach `list --porcelain` to annotate locked worktreeRafael Silva, Jan 17, 2021
  39. Eric SunshineJan 18, 2021
  40. Rafael SilvaJan 19, 2021
  41. Eric SunshineJan 19, 2021
  42. 5/6 worktree: teach `list` to annotate prunable worktreeRafael Silva, Jan 17, 2021
  43. Eric SunshineJan 18, 2021
  44. Rafael SilvaJan 19, 2021
  45. Eric SunshineJan 19, 2021
  46. 6/6 worktree: teach `list` verbose modeRafael Silva, Jan 17, 2021
  47. Eric SunshineJan 18, 2021
  48. Eric SunshineJan 18, 2021
  49. 2/6 worktree: teach worktree to lazy-load "prunable" reasonRafael Silva, Jan 17, 2021
  50. Eric SunshineJan 18, 2021
  51. Rafael SilvaJan 19, 2021
  52. 3/6 worktree: teach worktree_lock_reason() to gently handle main worktreeRafael Silva, Jan 17, 2021
  53. Eric SunshineJan 18, 2021
  54. Rafael SilvaJan 19, 2021
  55. 0/7 teach `worktree list` verbose mode and prunable annotationsRafael Silva, Jan 19, 2021
  56. 1/7 worktree: libify should_prune_worktree()Rafael Silva, Jan 19, 2021
  57. 7/7 worktree: teach `list` verbose modeRafael Silva, Jan 19, 2021
  58. Eric SunshineJan 24, 2021
  59. Rafael SilvaJan 24, 2021
  60. 2/7 worktree: teach worktree to lazy-load "prunable" reasonRafael Silva, Jan 19, 2021
  61. 6/7 worktree: teach `list` to annotate prunable worktreeRafael Silva, Jan 19, 2021
  62. Junio C HamanoJan 21, 2021
  63. Rafael SilvaJan 21, 2021
  64. Junio C HamanoJan 21, 2021
  65. 3/7 worktree: teach worktree_lock_reason() to gently handle main worktreeRafael Silva, Jan 19, 2021
  66. 4/7 t2402: ensure locked worktree is properly cleaned upRafael Silva, Jan 19, 2021
  67. Eric SunshineJan 24, 2021
  68. Rafael SilvaJan 24, 2021
  69. 5/7 worktree: teach `list --porcelain` to annotate locked worktreeRafael Silva, Jan 19, 2021
  70. Phillip WoodJan 20, 2021
  71. Junio C HamanoJan 21, 2021
  72. Rafael SilvaJan 21, 2021
  73. Eric SunshineJan 24, 2021
  74. Eric SunshineJan 24, 2021
  75. Rafael SilvaJan 24, 2021
  76. Eric SunshineJan 24, 2021
  77. Rafael SilvaJan 27, 2021
  78. 0/7 teach `worktree list` verbose mode and prunable annotationsRafael Silva, Jan 27, 2021
  79. 2/7 worktree: teach worktree to lazy-load "prunable" reasonRafael Silva, Jan 27, 2021
  80. 6/7 worktree: teach `list` to annotate prunable worktreeRafael Silva, Jan 27, 2021
  81. 5/7 worktree: teach `list --porcelain` to annotate locked worktreeRafael Silva, Jan 27, 2021
  82. 7/7 worktree: teach `list` verbose modeRafael Silva, Jan 27, 2021
  83. 3/7 worktree: teach worktree_lock_reason() to gently handle main worktreeRafael Silva, Jan 27, 2021
  84. 1/7 worktree: libify should_prune_worktree()Rafael Silva, Jan 27, 2021
  85. 4/7 t2402: ensure locked worktree is properly cleaned upRafael Silva, Jan 27, 2021
  86. Eric SunshineJan 30, 2021
  87. Rafael SilvaJan 30, 2021
  88. Junio C HamanoJan 30, 2021

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.