Re: [PATCH v5 2/2] worktree: add 'list' command

2015-08-24 Thread Junio C Hamano
Michael Rappazzo rappa...@gmail.com writes: +static int print_worktree_details(const char *path, const char *git_dir, void *cb_data) +{ + struct strbuf head_file = STRBUF_INIT; + struct strbuf head_ref = STRBUF_INIT; + struct stat st; + struct list_opts *opts = cb_data; +

Re: [PATCH v5 2/2] worktree: add 'list' command

2015-08-24 Thread Eric Sunshine
On Mon, Aug 24, 2015 at 2:05 PM, Junio C Hamano gits...@pobox.com wrote: Michael Rappazzo rappa...@gmail.com writes: + strbuf_strip_suffix(head_ref, \n); + + if (starts_with(head_ref.buf, ref_prefix)) { + /* branch checked out */ +

Re: [PATCH v5 2/2] worktree: add 'list' command

2015-08-24 Thread Mikael Magnusson
On Sat, Aug 22, 2015 at 11:51 PM, Michael Rappazzo rappa...@gmail.com wrote: 'git worktree list' uses the for_each_worktree function to iterate, and outputs in the format: 'worktree (short-ref)' Signed-off-by: Michael Rappazzo rappa...@gmail.com --- Documentation/git-worktree.txt | 11

[PATCH v5 2/2] worktree: add 'list' command

2015-08-22 Thread Michael Rappazzo
'git worktree list' uses the for_each_worktree function to iterate, and outputs in the format: 'worktree (short-ref)' Signed-off-by: Michael Rappazzo rappa...@gmail.com --- Documentation/git-worktree.txt | 11 +- builtin/worktree.c | 55