Re: [PATCH v5 13/17] read-tree: show progress by default
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Oct 21, 2019, 15:04 UTC
- Message-ID
- <3de0f590-c75c-2470-232f-73a07876df88@gmail.com>
- In-Reply-To
- <a229e1ee0cb96c5f8c2c5d430641c386bc082a2d.1571666187.git.gitgitgadget@gmail.com>
Hi Stolee
On 21/10/2019 14:56, Derrick Stolee via GitGitGadget wrote:
Show 23 quoted lines
> From: Derrick Stolee <dstolee@microsoft.com> > > The read-tree builtin has a --verbose option that signals to show > progress and other data while updating the index. Update this to > be on by default when stderr is a terminal window. > > This will help tools like 'git sparse-checkout' to automatically > benefit from progress indicators when a user runs these commands. > > Signed-off-by: Derrick Stolee <dstolee@microsoft.com> > --- > builtin/read-tree.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/builtin/read-tree.c b/builtin/read-tree.c > index ca5e655d2f..69963d83dc 100644 > --- a/builtin/read-tree.c > +++ b/builtin/read-tree.c > @@ -162,6 +162,7 @@ int cmd_read_tree(int argc, const char **argv, const char *cmd_prefix) > opts.head_idx = -1; > opts.src_index = &the_index; > opts.dst_index = &the_index; > + opts.verbose_update = isatty(2);
I'm slightly wary of changing the output of plumbing commands like this. If a script wants progress output it can already get it by passing --verbose. With this change a script that does not want that output now has to pass --no-verbose. If 'git sparse-checkout' wants progress indicators why not put the isatty() check there and pass the appropriate option to read-tree?
Best Wishes
Phillip
> git_config(git_read_tree_config, NULL); > >