Re: [PATCH] add option -n (--no-checkout) to git-worktree add

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] add option -n (--no-checkout) to git-worktree add

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:08:54

Ray Zhang [off-list ref] writes:
quoted hunk
@@ -320,6 +323,7 @@ static int add(int ac, const char **av, const char *prefix)
 		OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
 			   N_("create or reset a branch")),
 		OPT_BOOL(0, "detach", &opts.detach, N_("detach HEAD at named commit")),
+		OPT_BOOL('n', "no-checkout", &opts.no_checkout, N_("don't create a checkout")),
This would allow --no-no-checkout, which is idiotic, wouldn't it?

How about

    OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree"))

and set opts.checkout to true when initializing?

Re: [PATCH] add option -n (--no-checkout) to git-worktree add

From: Eric Sunshine <hidden>
Date: 2016-06-15 23:08:55

On Wed, Mar 23, 2016 at 11:51 AM, Junio C Hamano [off-list ref] wrote:
Ray Zhang [off-list ref] writes:
quoted
@@ -320,6 +323,7 @@ static int add(int ac, const char **av, const char *prefix)
              OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
                         N_("create or reset a branch")),
              OPT_BOOL(0, "detach", &opts.detach, N_("detach HEAD at named commit")),
+             OPT_BOOL('n', "no-checkout", &opts.no_checkout, N_("don't create a checkout")),
This would allow --no-no-checkout, which is idiotic, wouldn't it?

How about

    OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree"))

and set opts.checkout to true when initializing?
I think this code was copied verbatim from builtin/clone.c, and, as a
newcomer to the project, it's understandable that Ray Zhang imitated
existing code, but I agree that it would be better to avoid repeating
the misbehavior.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help