Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-21 Thread Eric Sunshine
On Wed, Sep 16, 2015 at 5:36 PM, Mike Rappazzo  wrote:
> On Wed, Sep 16, 2015 at 5:09 PM, Eric Sunshine  
> wrote:
>> On Mon, Sep 14, 2015 at 1:44 PM, Mike Rappazzo  wrote:
>>> On Sat, Sep 12, 2015 at 11:19 PM, Eric Sunshine  
>>> wrote:
 The original code in branch.c, which this patch removes, did not need
 to make a special case of HEAD, so it's not immediately clear why this
 replacement code does so. This is the sort of issue which argues in
 favor of mutating the existing code (slowly) over the course of
 several patches into the final form, rather than having the final form
 come into existence out of thin air. When the changes are made
 incrementally, it is easier for reviewers to understand why such
 modifications are needed, which (hopefully) should lead to fewer
 questions such as this one.
>>>
>>> I reversed the the check here; it is intended to check if the symref
>>> is _not_ the head, since the head
>>> ref has already been parsed.  This is used in notes.c to find
>>> "NOTES_MERGE_REF".
>>
>> I'm probably being dense, but I still don't understand why the code
>> now needs a special case for HEAD, whereas the original didn't. But,
>> my denseness my be indicative of this change not being well-described
>> (or described at all) by the commit message. Hopefully, when this is
>> refactored into finer changes, the purpose will become clear.
>
> The special case for HEAD is because the HEAD is already included in
> the worktree struct.  This block is intended to save from re-parsing.
> If you think the code would be easier to read, the HEAD check could be
> removed, and the ref will just be parsed always.

I'm unable to judge whether the code would be easier to read since I
still don't understand the purpose of the special case. (But, as
noted, it may just be that I'm being dense, though not intentionally.)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-16 Thread Eric Sunshine
On Mon, Sep 14, 2015 at 1:44 PM, Mike Rappazzo  wrote:
> On Sat, Sep 12, 2015 at 11:19 PM, Eric Sunshine  
> wrote:
>> On Fri, Sep 4, 2015 at 5:39 PM, Michael Rappazzo  wrote:
>>> +   while (!matched && worktree_list) {
>>> +   if (strcmp("HEAD", symref)) {
>>> +   strbuf_reset();
>>> +   strbuf_reset();
>>> +   strbuf_addf(, "%s/%s", 
>>> worktree_list->worktree->git_dir, symref);
>>> +
>>> +   if (_parse_ref(path.buf, , NULL)) {
>>> +   continue;
>>> +   }
>>> +
>>> +   if (!strcmp(sb.buf, target))
>>> +   matched = worktree_list->worktree;
>>
>> The original code in branch.c, which this patch removes, did not need
>> to make a special case of HEAD, so it's not immediately clear why this
>> replacement code does so. This is the sort of issue which argues in
>> favor of mutating the existing code (slowly) over the course of
>> several patches into the final form, rather than having the final form
>> come into existence out of thin air. When the changes are made
>> incrementally, it is easier for reviewers to understand why such
>> modifications are needed, which (hopefully) should lead to fewer
>> questions such as this one.
>
> I reversed the the check here; it is intended to check if the symref
> is _not_ the head, since the head
> ref has already been parsed.  This is used in notes.c to find
> "NOTES_MERGE_REF".

I'm probably being dense, but I still don't understand why the code
now needs a special case for HEAD, whereas the original didn't. But,
my denseness my be indicative of this change not being well-described
(or described at all) by the commit message. Hopefully, when this is
refactored into finer changes, the purpose will become clear.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-16 Thread Mike Rappazzo
On Wed, Sep 16, 2015 at 5:09 PM, Eric Sunshine  wrote:
> On Mon, Sep 14, 2015 at 1:44 PM, Mike Rappazzo  wrote:
>> On Sat, Sep 12, 2015 at 11:19 PM, Eric Sunshine  
>> wrote:
>>> On Fri, Sep 4, 2015 at 5:39 PM, Michael Rappazzo  wrote:
 +   while (!matched && worktree_list) {
 +   if (strcmp("HEAD", symref)) {
 +   strbuf_reset();
 +   strbuf_reset();
 +   strbuf_addf(, "%s/%s", 
 worktree_list->worktree->git_dir, symref);
 +
 +   if (_parse_ref(path.buf, , NULL)) {
 +   continue;
 +   }
 +
 +   if (!strcmp(sb.buf, target))
 +   matched = worktree_list->worktree;
>>>
>>> The original code in branch.c, which this patch removes, did not need
>>> to make a special case of HEAD, so it's not immediately clear why this
>>> replacement code does so. This is the sort of issue which argues in
>>> favor of mutating the existing code (slowly) over the course of
>>> several patches into the final form, rather than having the final form
>>> come into existence out of thin air. When the changes are made
>>> incrementally, it is easier for reviewers to understand why such
>>> modifications are needed, which (hopefully) should lead to fewer
>>> questions such as this one.
>>
>> I reversed the the check here; it is intended to check if the symref
>> is _not_ the head, since the head
>> ref has already been parsed.  This is used in notes.c to find
>> "NOTES_MERGE_REF".
>
> I'm probably being dense, but I still don't understand why the code
> now needs a special case for HEAD, whereas the original didn't. But,
> my denseness my be indicative of this change not being well-described
> (or described at all) by the commit message. Hopefully, when this is
> refactored into finer changes, the purpose will become clear.
>
> Thanks.

The special case for HEAD is because the HEAD is already included in
the worktree struct.  This block is intended to save from re-parsing.
If you think the code would be easier to read, the HEAD check could be
removed, and the ref will just be parsed always.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-14 Thread Mike Rappazzo
On Sat, Sep 12, 2015 at 11:19 PM, Eric Sunshine  wrote:
> On Fri, Sep 4, 2015 at 5:39 PM, Michael Rappazzo  wrote:
>> The code formerly in branch.c was largely the basis of the
>> get_worktree_list implementation is now moved to worktree.c,
>> and the find_shared_symref implementation has been refactored
>> to use get_worktree_list
>
> Some comments below in addition to those by Junio...
>
>> Signed-off-by: Michael Rappazzo 
>> ---
>> diff --git a/branch.h b/branch.h
>> index d3446ed..58aa45f 100644
>> --- a/branch.h
>> +++ b/branch.h
>> @@ -59,12 +59,4 @@ extern int read_branch_desc(struct strbuf *, const char 
>> *branch_name);
>>   */
>>  extern void die_if_checked_out(const char *branch);
>>
>> -/*
>> - * Check if a per-worktree symref points to a ref in the main worktree
>> - * or any linked worktree, and return the path to the exising worktree
>> - * if it is.  Returns NULL if there is no existing ref.  The caller is
>> - * responsible for freeing the returned path.
>> - */
>> -extern char *find_shared_symref(const char *symref, const char *target);
>> -
>>  #endif
>> diff --git a/worktree.c b/worktree.c
>> index 33d2e57..e45b651 100644
>> --- a/worktree.c
>> +++ b/worktree.c
>> @@ -155,3 +155,43 @@ done:
>> return list;
>>  }
>>
>> +char *find_shared_symref(const char *symref, const char *target)
>> +{
>> +   char *existing = NULL;
>> +   struct strbuf path = STRBUF_INIT;
>> +   struct strbuf sb = STRBUF_INIT;
>> +   struct worktree_list *worktree_list = get_worktree_list();
>> +   struct worktree_list *orig_list = worktree_list;
>> +   struct worktree *matched = NULL;
>> +
>> +   while (!matched && worktree_list) {
>> +   if (strcmp("HEAD", symref)) {
>
> The result of strcmp() never changes, so this (expensive) check could
> be lifted out of the 'while' loop, however...
>
>> +   strbuf_reset();
>> +   strbuf_reset();
>> +   strbuf_addf(, "%s/%s", 
>> worktree_list->worktree->git_dir, symref);
>> +
>> +   if (_parse_ref(path.buf, , NULL)) {
>> +   continue;
>> +   }
>> +
>> +   if (!strcmp(sb.buf, target))
>> +   matched = worktree_list->worktree;
>
> The original code in branch.c, which this patch removes, did not need
> to make a special case of HEAD, so it's not immediately clear why this
> replacement code does so. This is the sort of issue which argues in
> favor of mutating the existing code (slowly) over the course of
> several patches into the final form, rather than having the final form
> come into existence out of thin air. When the changes are made
> incrementally, it is easier for reviewers to understand why such
> modifications are needed, which (hopefully) should lead to fewer
> questions such as this one.
>

I reversed the the check here; it is intended to check if the symref
is _not_ the head, since the head
ref has already been parsed.  This is used in notes.c to find
"NOTES_MERGE_REF".  I will move the
check out of the loop as you suggest above.

>> +   } else {
>> +   if (worktree_list->worktree->head_ref && 
>> !strcmp(worktree_list->worktree->head_ref, target))
>> +   matched = worktree_list->worktree;
>> +   }
>> +   worktree_list = worktree_list->next ? worktree_list->next : 
>> NULL;
>> +   }
>> +
>> +   if (matched) {
>> +   existing = malloc(strlen(matched->path) + 1);
>> +   strcpy(existing, matched->path);
>
> A couple issues:
>
> This can be done more concisely and safely with xstrdup().
>
> In this codebase, it probably would be more idiomatic to use goto to
> drop out of the loop rather than setting 'matched' and then having to
> check 'matched' in the loop condition. So, for instance, each place
> which sets 'matched' could instead say:
>
> existing = xstrdup(...);
> goto done;
>
>> +   }
>> +
>> +done:
>
> This label doesn't have any matching goto's.
>
>> +   strbuf_release();
>> +   strbuf_release();
>> +   worktree_list_release(orig_list);
>> +
>> +   return existing;
>> +}
>> diff --git a/worktree.h b/worktree.h
>> index 2bc0ab8..320f17e 100644
>> --- a/worktree.h
>> +++ b/worktree.h
>> @@ -45,4 +45,11 @@ struct worktree *get_worktree(const char *id);
>>  extern void worktree_list_release(struct worktree_list *);
>>  extern void worktree_release(struct worktree *);
>>
>> +/*
>> + * Look for a symref in any worktree, and return the path to the first
>> + * worktree found or NULL if not found.  The caller is responsible for
>> + * freeing the returned path.
>> + */
>
> For some reason, this comment differs a fair bit from the original in
> branch.h which was removed by this patch, however, the original
> comment was a bit more explanatory 

Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-12 Thread Eric Sunshine
On Fri, Sep 4, 2015 at 5:39 PM, Michael Rappazzo  wrote:
> The code formerly in branch.c was largely the basis of the
> get_worktree_list implementation is now moved to worktree.c,
> and the find_shared_symref implementation has been refactored
> to use get_worktree_list

Some comments below in addition to those by Junio...

> Signed-off-by: Michael Rappazzo 
> ---
> diff --git a/branch.h b/branch.h
> index d3446ed..58aa45f 100644
> --- a/branch.h
> +++ b/branch.h
> @@ -59,12 +59,4 @@ extern int read_branch_desc(struct strbuf *, const char 
> *branch_name);
>   */
>  extern void die_if_checked_out(const char *branch);
>
> -/*
> - * Check if a per-worktree symref points to a ref in the main worktree
> - * or any linked worktree, and return the path to the exising worktree
> - * if it is.  Returns NULL if there is no existing ref.  The caller is
> - * responsible for freeing the returned path.
> - */
> -extern char *find_shared_symref(const char *symref, const char *target);
> -
>  #endif
> diff --git a/worktree.c b/worktree.c
> index 33d2e57..e45b651 100644
> --- a/worktree.c
> +++ b/worktree.c
> @@ -155,3 +155,43 @@ done:
> return list;
>  }
>
> +char *find_shared_symref(const char *symref, const char *target)
> +{
> +   char *existing = NULL;
> +   struct strbuf path = STRBUF_INIT;
> +   struct strbuf sb = STRBUF_INIT;
> +   struct worktree_list *worktree_list = get_worktree_list();
> +   struct worktree_list *orig_list = worktree_list;
> +   struct worktree *matched = NULL;
> +
> +   while (!matched && worktree_list) {
> +   if (strcmp("HEAD", symref)) {

The result of strcmp() never changes, so this (expensive) check could
be lifted out of the 'while' loop, however...

> +   strbuf_reset();
> +   strbuf_reset();
> +   strbuf_addf(, "%s/%s", 
> worktree_list->worktree->git_dir, symref);
> +
> +   if (_parse_ref(path.buf, , NULL)) {
> +   continue;
> +   }
> +
> +   if (!strcmp(sb.buf, target))
> +   matched = worktree_list->worktree;

The original code in branch.c, which this patch removes, did not need
to make a special case of HEAD, so it's not immediately clear why this
replacement code does so. This is the sort of issue which argues in
favor of mutating the existing code (slowly) over the course of
several patches into the final form, rather than having the final form
come into existence out of thin air. When the changes are made
incrementally, it is easier for reviewers to understand why such
modifications are needed, which (hopefully) should lead to fewer
questions such as this one.

> +   } else {
> +   if (worktree_list->worktree->head_ref && 
> !strcmp(worktree_list->worktree->head_ref, target))
> +   matched = worktree_list->worktree;
> +   }
> +   worktree_list = worktree_list->next ? worktree_list->next : 
> NULL;
> +   }
> +
> +   if (matched) {
> +   existing = malloc(strlen(matched->path) + 1);
> +   strcpy(existing, matched->path);

A couple issues:

This can be done more concisely and safely with xstrdup().

In this codebase, it probably would be more idiomatic to use goto to
drop out of the loop rather than setting 'matched' and then having to
check 'matched' in the loop condition. So, for instance, each place
which sets 'matched' could instead say:

existing = xstrdup(...);
goto done;

> +   }
> +
> +done:

This label doesn't have any matching goto's.

> +   strbuf_release();
> +   strbuf_release();
> +   worktree_list_release(orig_list);
> +
> +   return existing;
> +}
> diff --git a/worktree.h b/worktree.h
> index 2bc0ab8..320f17e 100644
> --- a/worktree.h
> +++ b/worktree.h
> @@ -45,4 +45,11 @@ struct worktree *get_worktree(const char *id);
>  extern void worktree_list_release(struct worktree_list *);
>  extern void worktree_release(struct worktree *);
>
> +/*
> + * Look for a symref in any worktree, and return the path to the first
> + * worktree found or NULL if not found.  The caller is responsible for
> + * freeing the returned path.
> + */

For some reason, this comment differs a fair bit from the original in
branch.h which was removed by this patch, however, the original
comment was a bit more explanatory (I think).

As a general rule, it's better to do code movement and code changes in
separate patches since it's hard for reviewers to detect and
comprehend differences in code which has been both moved and changed
at the same time.

> +extern char *find_shared_symref(const char *symref, const char *target);
> +
>  #endif
> --
> 2.5.0
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-11 Thread Junio C Hamano
Michael Rappazzo  writes:

> The code formerly in branch.c was largely the basis of the
> get_worktree_list implementation is now moved to worktree.c,
> and the find_shared_symref implementation has been refactored
> to use get_worktree_list
>
> Signed-off-by: Michael Rappazzo 
> ---




>  branch.c| 79 
> +
>  branch.h|  8 --
>  builtin/notes.c |  1 +
>  worktree.c  | 40 +
>  worktree.h  |  7 +
>  5 files changed, 49 insertions(+), 86 deletions(-)
>
> diff --git a/branch.c b/branch.c
> index d013374..77d7f2a 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -4,6 +4,7 @@
>  #include "refs.h"
>  #include "remote.h"
>  #include "commit.h"
> +#include "worktree.h"
>  
>  struct tracking {
>   struct refspec spec;
> @@ -311,84 +312,6 @@ void remove_branch_state(void)
>   unlink(git_path_squash_msg());
>  }
>  
> -static char *find_linked_symref(const char *symref, const char *branch,
> - const char *id)

The title refers to a function with a different name ;-).

Copying the bulk of the function in 1/3 and then removing the
original here made it somewhat hard to compare what got changed in
the implementation.

I _think_ the code structure in the end result is more or less
right, though.

> diff --git a/worktree.c b/worktree.c
> index 33d2e57..e45b651 100644
> --- a/worktree.c
> +++ b/worktree.c
> @@ -155,3 +155,43 @@ done:
>   return list;
>  }
>  
> +char *find_shared_symref(const char *symref, const char *target)
> +{
> + char *existing = NULL;
> + struct strbuf path = STRBUF_INIT;
> + struct strbuf sb = STRBUF_INIT;
> + struct worktree_list *worktree_list = get_worktree_list();
> + struct worktree_list *orig_list = worktree_list;
> + struct worktree *matched = NULL;
> +
> + while (!matched && worktree_list) {
> + if (strcmp("HEAD", symref)) {
> + strbuf_reset();
> + strbuf_reset();
> + strbuf_addf(, "%s/%s", 
> worktree_list->worktree->git_dir, symref);
> +
> + if (_parse_ref(path.buf, , NULL)) {
> + continue;
> + }

I forgot to say this on 1/3, but this helper function _parse_ref()
is obviously an implementation detail; does it have to be visible
outside the file, or can it become file-scope static?  There may
be other helpers that may not want to be global (I didn't check).

Provided that 1/3 will become accepable, this step looks sensible to
me.

Thanks.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-11 Thread Eric Sunshine
On Fri, Sep 11, 2015 at 5:52 PM, Junio C Hamano  wrote:
> Mike Rappazzo  writes:
>> On Fri, Sep 11, 2015 at 12:16 PM, Junio C Hamano  wrote:
>>> Michael Rappazzo  writes:
 The code formerly in branch.c was largely the basis of the
 get_worktree_list implementation is now moved to worktree.c,
 and the find_shared_symref implementation has been refactored
 to use get_worktree_list
>>>
>>> Copying the bulk of the function in 1/3 and then removing the
>>> original here made it somewhat hard to compare what got changed in
>>> the implementation.
>>>
>>> I _think_ the code structure in the end result is more or less
>>> right, though.
>>
>> Should I squash these first two commits together in the next series?
>
> Mashing the two into one patch would not help anybody, I would
> suspect.
>
> I didn't try this myself, but if I were doing this and if I were
> aiming for perfection, then I would probably try to split it even
> finer.  Refactor the original while both the callers and the helpers
> are still inside branch.c (hence the early steps in the series will
> not benefit worktree.c at all---worktree.c may not even exist in
> them yet), move refactored helpers to worktree.[ch] (and at this
> step you may not even have get_worktree() etc. yet), and then use
> that refactored helper while writing new functions in worktree.c.

Thanks for bringing this up. I haven't found a sufficient block of
time yet to review these patches, however, I had the same thought upon
a quick initial read, and is how I was hoping to see the patch series
constructed based upon my earlier two reviews suggesting refactoring
the existing branch.c functions into a new get_worktrees(). There are
at least a couple important reasons for taking this approach.

First, it keeps the "blame" trail intact, the full context of which
can be helpful to someone trying to understand why the code is the way
it is. The current approach of having get_worktree_list() materialize
out of thin air (even though it may have been patterned after existing
code) doesn't give the same benefit.

Second, it's easier for reviewers to understand and check the code for
correctness if it mutates to the final form in small increments than
it is to have get_worktrees() come into existence fully matured.

A final minor comment: Since all three branch.c functions,
die_if_checked_out(), find_shared_symref(), and find_linked_symref(),
ought to be moved to top-level worktree.c, I'd probably have patch 1
do the relocation (with no functional changes), and subsequent patches
refactor the moved code into a general purpose get_worktrees(). The
final patch would then implement "git worktrees list".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-11 Thread Mike Rappazzo
On Fri, Sep 11, 2015 at 12:16 PM, Junio C Hamano  wrote:
> Michael Rappazzo  writes:
>
>> The code formerly in branch.c was largely the basis of the
>> get_worktree_list implementation is now moved to worktree.c,
>> and the find_shared_symref implementation has been refactored
>> to use get_worktree_list
>>
>
> Copying the bulk of the function in 1/3 and then removing the
> original here made it somewhat hard to compare what got changed in
> the implementation.
>
> I _think_ the code structure in the end result is more or less
> right, though.

Should I squash these first two commits together in the next series?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-11 Thread Junio C Hamano
Mike Rappazzo  writes:

> On Fri, Sep 11, 2015 at 12:16 PM, Junio C Hamano  wrote:
>> Michael Rappazzo  writes:
>>
>>> The code formerly in branch.c was largely the basis of the
>>> get_worktree_list implementation is now moved to worktree.c,
>>> and the find_shared_symref implementation has been refactored
>>> to use get_worktree_list
>>>
>>
>> Copying the bulk of the function in 1/3 and then removing the
>> original here made it somewhat hard to compare what got changed in
>> the implementation.
>>
>> I _think_ the code structure in the end result is more or less
>> right, though.
>
> Should I squash these first two commits together in the next series?

Mashing the two into one patch would not help anybody, I would
suspect.

I didn't try this myself, but if I were doing this and if I were
aiming for perfection, then I would probably try to split it even
finer.  Refactor the original while both the callers and the helpers
are still inside branch.c (hence the early steps in the series will
not benefit worktree.c at all---worktree.c may not even exist in
them yet), move refactored helpers to worktree.[ch] (and at this
step you may not even have get_worktree() etc. yet), and then use
that refactored helper while writing new functions in worktree.c.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v7 2/3] worktree: move/refactor find_shared_symref from branch.c

2015-09-11 Thread Mike Rappazzo
On Fri, Sep 11, 2015 at 7:10 PM, Eric Sunshine  wrote:
> On Fri, Sep 11, 2015 at 5:52 PM, Junio C Hamano  wrote:
>
> Thanks for bringing this up. I haven't found a sufficient block of
> time yet to review these patches, however, I had the same thought upon
> a quick initial read, and is how I was hoping to see the patch series
> constructed based upon my earlier two reviews suggesting refactoring
> the existing branch.c functions into a new get_worktrees(). There are
> at least a couple important reasons for taking this approach.
>
> First, it keeps the "blame" trail intact, the full context of which
> can be helpful to someone trying to understand why the code is the way
> it is. The current approach of having get_worktree_list() materialize
> out of thin air (even though it may have been patterned after existing
> code) doesn't give the same benefit.
>
> Second, it's easier for reviewers to understand and check the code for
> correctness if it mutates to the final form in small increments than
> it is to have get_worktrees() come into existence fully matured.
>
> A final minor comment: Since all three branch.c functions,
> die_if_checked_out(), find_shared_symref(), and find_linked_symref(),
> ought to be moved to top-level worktree.c, I'd probably have patch 1
> do the relocation (with no functional changes), and subsequent patches
> refactor the moved code into a general purpose get_worktrees(). The
> final patch would then implement "git worktrees list".

I like the way this history works out, and I have reworked the history
to follow this idea.  The only thing
I didn't do was move the die_if_checked_out() function from branch.c,
as I feel that this function is more
of a branch feature than a worktree feature.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html