git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] checkout: add simple check for 'git checkout -b'
@ 2019-08-29 17:01 Derrick Stolee via GitGitGadget
  2019-08-29 17:01 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
  0 siblings, 1 reply; 11+ messages in thread
From: Derrick Stolee via GitGitGadget @ 2019-08-29 17:01 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

This series replaces "[RFC] Revert/delay performance regression in 'git
checkout -b'" [1].

The community response to that series seems to be:

 1. 'git switch' is still experimental, so don't warn that users should
    adopt it right away.
    
    
 2. 'git checkout -b ' should do the fast thing, and we should check the
    arguments directly.
    
    

This series makes 'git checkout -b ' do the same thing as 'git switch -c '.

Thanks, -Stolee

[1] https://public-inbox.org/git/pull.317.git.gitgitgadget@gmail.com/

Derrick Stolee (1):
  checkout: add simple check for 'git checkout -b'

 builtin/checkout.c | 9 +++++++++
 1 file changed, 9 insertions(+)


base-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-325%2Fderrickstolee%2Fcheckout-b-fast-again-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-325/derrickstolee/checkout-b-fast-again-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/325
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 17:01 [PATCH 0/1] checkout: add simple check for 'git checkout -b' Derrick Stolee via GitGitGadget
@ 2019-08-29 17:01 ` Derrick Stolee via GitGitGadget
  2019-08-29 17:25   ` Elijah Newren
  2019-08-29 18:54   ` Phillip Wood
  0 siblings, 2 replies; 11+ messages in thread
From: Derrick Stolee via GitGitGadget @ 2019-08-29 17:01 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Derrick Stolee

From: Derrick Stolee <dstolee@microsoft.com>

The 'git switch' command was created to separate half of the
behavior of 'git checkout'. It specifically has the mode to
do nothing with the index and working directory if the user
only specifies to create a new branch and change HEAD to that
branch. This is also the behavior most users expect from
'git checkout -b', but for historical reasons it also performs
an index update by scanning the working directory. This can be
slow for even moderately-sized repos.

A performance fix for 'git checkout -b' was introduced by
fa655d8411 (checkout: optimize "git checkout -b <new_branch>"
2018-08-16). That change includes details about the config
setting checkout.optimizeNewBranch when the sparse-checkout
feature is required. The way this change detected if this
behavior change is safe was through the skip_merge_working_tree()
method. This method was complex and needed to be updated
as new options were introduced.

This behavior was essentially reverted by 65f099b ("switch:
no worktree status unless real branch switch happens"
2019-03-29). Instead, two members of the checkout_opts struct
were used to distinguish between 'git checkout' and 'git switch':

    * switch_branch_doing_nothing_is_ok
    * only_merge_on_switching_branches

These settings have opposite values depending on if we start
in cmd_checkout or cmd_switch.

The message for 64f099b includes "Users of big repos are
encouraged to move to switch." Making this change while
'git switch' is still experimental is too aggressive.

Create a happy medium between these two options by making
'git checkout -b <branch>' behave just like 'git switch',
but only if we read exactly those arguments. This must
be done in cmd_checkout to avoid the arguments being
consumed by the option parsing logic.

This differs from the previous change by fa644d8 in that
the config option checkout.optimizeNewBranch remains
deleted. This means that 'git checkout -b' will ignore
the index merge even if we have a sparse-checkout file.
While this is a behavior change for 'git checkout -b',
it matches the behavior of 'git switch -c'.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 builtin/checkout.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 6123f732a2..116200cf90 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1713,6 +1713,15 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
 	opts.overlay_mode = -1;
 	opts.checkout_index = -2;    /* default on */
 	opts.checkout_worktree = -2; /* default on */
+	
+	if (argc == 3 && !strcmp(argv[1], "-b")) {
+		/*
+		 * User ran 'git checkout -b <branch>' and expects
+		 * the same behavior as 'git switch -c <branch>'.
+		 */
+		opts.switch_branch_doing_nothing_is_ok = 0;
+		opts.only_merge_on_switching_branches = 1;
+	}
 
 	options = parse_options_dup(checkout_options);
 	options = add_common_options(&opts, options);
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 17:01 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
@ 2019-08-29 17:25   ` Elijah Newren
  2019-08-29 18:54   ` Phillip Wood
  1 sibling, 0 replies; 11+ messages in thread
From: Elijah Newren @ 2019-08-29 17:25 UTC (permalink / raw)
  To: Derrick Stolee via GitGitGadget
  Cc: Git Mailing List, Junio C Hamano, Derrick Stolee

On Thu, Aug 29, 2019 at 10:04 AM Derrick Stolee via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Derrick Stolee <dstolee@microsoft.com>
>
> The 'git switch' command was created to separate half of the
> behavior of 'git checkout'. It specifically has the mode to
> do nothing with the index and working directory if the user
> only specifies to create a new branch and change HEAD to that
> branch. This is also the behavior most users expect from
> 'git checkout -b', but for historical reasons it also performs
> an index update by scanning the working directory. This can be
> slow for even moderately-sized repos.
>
> A performance fix for 'git checkout -b' was introduced by
> fa655d8411 (checkout: optimize "git checkout -b <new_branch>"
> 2018-08-16). That change includes details about the config
> setting checkout.optimizeNewBranch when the sparse-checkout
> feature is required. The way this change detected if this
> behavior change is safe was through the skip_merge_working_tree()
> method. This method was complex and needed to be updated
> as new options were introduced.
>
> This behavior was essentially reverted by 65f099b ("switch:
> no worktree status unless real branch switch happens"
> 2019-03-29). Instead, two members of the checkout_opts struct
> were used to distinguish between 'git checkout' and 'git switch':
>
>     * switch_branch_doing_nothing_is_ok
>     * only_merge_on_switching_branches
>
> These settings have opposite values depending on if we start
> in cmd_checkout or cmd_switch.
>
> The message for 64f099b includes "Users of big repos are
> encouraged to move to switch." Making this change while
> 'git switch' is still experimental is too aggressive.
>
> Create a happy medium between these two options by making
> 'git checkout -b <branch>' behave just like 'git switch',
> but only if we read exactly those arguments. This must
> be done in cmd_checkout to avoid the arguments being
> consumed by the option parsing logic.
>
> This differs from the previous change by fa644d8 in that
> the config option checkout.optimizeNewBranch remains
> deleted. This means that 'git checkout -b' will ignore
> the index merge even if we have a sparse-checkout file.
> While this is a behavior change for 'git checkout -b',
> it matches the behavior of 'git switch -c'.
>
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
>  builtin/checkout.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 6123f732a2..116200cf90 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -1713,6 +1713,15 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
>         opts.overlay_mode = -1;
>         opts.checkout_index = -2;    /* default on */
>         opts.checkout_worktree = -2; /* default on */
> +
> +       if (argc == 3 && !strcmp(argv[1], "-b")) {
> +               /*
> +                * User ran 'git checkout -b <branch>' and expects
> +                * the same behavior as 'git switch -c <branch>'.
> +                */
> +               opts.switch_branch_doing_nothing_is_ok = 0;
> +               opts.only_merge_on_switching_branches = 1;
> +       }
>
>         options = parse_options_dup(checkout_options);
>         options = add_common_options(&opts, options);
> --
> gitgitgadget

Nice!  Thanks for doing this; a small and localized performance hack
is much nicer than a big and non-localized one.  I also appreciate the
detailed history in the commit message.

Just for fun, I tested on linux (with a relatively fast SSD) using a
simple git-bomb repo with 10M index entries but a sparse checkout of
just one file.  'git switch -c' takes approximately 0.004s before or
after this patch.  'git checkout -b' before this patch:

$ time git checkout -b newbranch1
Switched to a new branch 'newbranch1'

real    0m13.533s
user    0m9.824s
sys    0m2.828s


After this patch:

$ time git checkout -b newbranch2
Switched to a new branch 'newbranch2'

real    0m0.003s
user    0m0.000s
sys    0m0.000s


Anyway, looks good to me.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 17:01 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
  2019-08-29 17:25   ` Elijah Newren
@ 2019-08-29 18:54   ` Phillip Wood
  2019-08-29 20:07     ` Derrick Stolee
  1 sibling, 1 reply; 11+ messages in thread
From: Phillip Wood @ 2019-08-29 18:54 UTC (permalink / raw)
  To: Derrick Stolee via GitGitGadget, git; +Cc: Junio C Hamano, Derrick Stolee

Hi Stolee

On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
> From: Derrick Stolee <dstolee@microsoft.com>
> 
> The 'git switch' command was created to separate half of the
> behavior of 'git checkout'. It specifically has the mode to
> do nothing with the index and working directory if the user
> only specifies to create a new branch and change HEAD to that
> branch. This is also the behavior most users expect from
> 'git checkout -b', but for historical reasons it also performs
> an index update by scanning the working directory. This can be
> slow for even moderately-sized repos.
> 
> A performance fix for 'git checkout -b' was introduced by
> fa655d8411 (checkout: optimize "git checkout -b <new_branch>"
> 2018-08-16). That change includes details about the config
> setting checkout.optimizeNewBranch when the sparse-checkout
> feature is required. The way this change detected if this
> behavior change is safe was through the skip_merge_working_tree()
> method. This method was complex and needed to be updated
> as new options were introduced.
> 
> This behavior was essentially reverted by 65f099b ("switch:
> no worktree status unless real branch switch happens"
> 2019-03-29). Instead, two members of the checkout_opts struct
> were used to distinguish between 'git checkout' and 'git switch':
> 
>      * switch_branch_doing_nothing_is_ok
>      * only_merge_on_switching_branches
> 
> These settings have opposite values depending on if we start
> in cmd_checkout or cmd_switch.
> 
> The message for 64f099b includes "Users of big repos are
> encouraged to move to switch." Making this change while
> 'git switch' is still experimental is too aggressive.
> 
> Create a happy medium between these two options by making
> 'git checkout -b <branch>' behave just like 'git switch',
> but only if we read exactly those arguments. This must
> be done in cmd_checkout to avoid the arguments being
> consumed by the option parsing logic.
> 
> This differs from the previous change by fa644d8 in that
> the config option checkout.optimizeNewBranch remains
> deleted. This means that 'git checkout -b' will ignore
> the index merge even if we have a sparse-checkout file.
> While this is a behavior change for 'git checkout -b',
> it matches the behavior of 'git switch -c'.
> 
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
>   builtin/checkout.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 6123f732a2..116200cf90 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -1713,6 +1713,15 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
>   	opts.overlay_mode = -1;
>   	opts.checkout_index = -2;    /* default on */
>   	opts.checkout_worktree = -2; /* default on */
> +	
> +	if (argc == 3 && !strcmp(argv[1], "-b")) {
> +		/*
> +		 * User ran 'git checkout -b <branch>' and expects

What if the user ran 'git checkout -b<branch>'? Then argc == 2.

Best Wishes

Phillip

> +		 * the same behavior as 'git switch -c <branch>'.
> +		 */
> +		opts.switch_branch_doing_nothing_is_ok = 0;
> +		opts.only_merge_on_switching_branches = 1;
> +	}
>   
>   	options = parse_options_dup(checkout_options);
>   	options = add_common_options(&opts, options);
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 18:54   ` Phillip Wood
@ 2019-08-29 20:07     ` Derrick Stolee
  2019-08-29 20:30       ` Pratyush Yadav
  0 siblings, 1 reply; 11+ messages in thread
From: Derrick Stolee @ 2019-08-29 20:07 UTC (permalink / raw)
  To: phillip.wood, Derrick Stolee via GitGitGadget, git
  Cc: Junio C Hamano, Derrick Stolee

On 8/29/2019 2:54 PM, Phillip Wood wrote:
> Hi Stolee
> 
> On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
>> +   
>> +    if (argc == 3 && !strcmp(argv[1], "-b")) {
>> +        /*
>> +         * User ran 'git checkout -b <branch>' and expects
> 
> What if the user ran 'git checkout -b<branch>'? Then argc == 2.

Good catch. I'm tempted to say "don't do that" to keep this
simple. They won't have incorrect results, just slower than
the "with space" option.

However, if there is enough interest in correcting the "-b<branch>"
case, then I can make another attempt at this.

-Stolee

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 20:07     ` Derrick Stolee
@ 2019-08-29 20:30       ` Pratyush Yadav
  2019-08-29 21:40         ` Pratyush Yadav
  0 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2019-08-29 20:30 UTC (permalink / raw)
  To: Derrick Stolee
  Cc: phillip.wood, Derrick Stolee via GitGitGadget, git,
	Junio C Hamano, Derrick Stolee

On 29/08/19 04:07PM, Derrick Stolee wrote:
> On 8/29/2019 2:54 PM, Phillip Wood wrote:
> > Hi Stolee
> > 
> > On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
> >> +   
> >> +    if (argc == 3 && !strcmp(argv[1], "-b")) {
> >> +        /*
> >> +         * User ran 'git checkout -b <branch>' and expects
> > 
> > What if the user ran 'git checkout -b<branch>'? Then argc == 2.
> 
> Good catch. I'm tempted to say "don't do that" to keep this
> simple. They won't have incorrect results, just slower than
> the "with space" option.
> 
> However, if there is enough interest in correcting the "-b<branch>"
> case, then I can make another attempt at this.
 
You can probably do this with:

  !strncmp(argv[1], "-b", 2)

The difference is so little, might as well do it IMO.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 20:30       ` Pratyush Yadav
@ 2019-08-29 21:40         ` Pratyush Yadav
  2019-08-30  0:19           ` Elijah Newren
  0 siblings, 1 reply; 11+ messages in thread
From: Pratyush Yadav @ 2019-08-29 21:40 UTC (permalink / raw)
  To: Derrick Stolee
  Cc: phillip.wood, Derrick Stolee via GitGitGadget, git,
	Junio C Hamano, Derrick Stolee

On 30/08/19 02:00AM, Pratyush Yadav wrote:
> On 29/08/19 04:07PM, Derrick Stolee wrote:
> > On 8/29/2019 2:54 PM, Phillip Wood wrote:
> > > Hi Stolee
> > > 
> > > On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
> > >> +   
> > >> +    if (argc == 3 && !strcmp(argv[1], "-b")) {
> > >> +        /*
> > >> +         * User ran 'git checkout -b <branch>' and expects
> > > 
> > > What if the user ran 'git checkout -b<branch>'? Then argc == 2.
> > 
> > Good catch. I'm tempted to say "don't do that" to keep this
> > simple. They won't have incorrect results, just slower than
> > the "with space" option.
> > 
> > However, if there is enough interest in correcting the "-b<branch>"
> > case, then I can make another attempt at this.
>  
> You can probably do this with:
> 
>   !strncmp(argv[1], "-b", 2)
> 
> The difference is so little, might as well do it IMO.
 
Actually, that is not correct. I took a quick look before writing this 
and missed the fact that argc == 3 is the bigger problem.

Thinking a little more about this, you can mix other options with 
checkout -b, like --track. You can also specify <start_point>.

Now I don't know enough about this optimization you are doing to know 
whether we need to optimize when these options are given, but at least 
for --track I don't see any reason not to.

So maybe you are better off using something like getopt() (warning: 
getopt modifies the input string so you probably want to duplicate it) 
if you want to support all cases. Though for this simple case you can 
probably get away by just directly scanning the argv list for "-b" 
(using strncmp instead of strcmp to account for "-b<branch-name>)

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-29 21:40         ` Pratyush Yadav
@ 2019-08-30  0:19           ` Elijah Newren
  2019-08-30  0:43             ` Taylor Blau
  0 siblings, 1 reply; 11+ messages in thread
From: Elijah Newren @ 2019-08-30  0:19 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Derrick Stolee, Phillip Wood, Derrick Stolee via GitGitGadget,
	Git Mailing List, Junio C Hamano, Derrick Stolee

On Thu, Aug 29, 2019 at 2:42 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> On 30/08/19 02:00AM, Pratyush Yadav wrote:
> > On 29/08/19 04:07PM, Derrick Stolee wrote:
> > > On 8/29/2019 2:54 PM, Phillip Wood wrote:
> > > > Hi Stolee
> > > >
> > > > On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
> > > >> +
> > > >> +    if (argc == 3 && !strcmp(argv[1], "-b")) {
> > > >> +        /*
> > > >> +         * User ran 'git checkout -b <branch>' and expects
> > > >
> > > > What if the user ran 'git checkout -b<branch>'? Then argc == 2.
> > >
> > > Good catch. I'm tempted to say "don't do that" to keep this
> > > simple. They won't have incorrect results, just slower than
> > > the "with space" option.
> > >
> > > However, if there is enough interest in correcting the "-b<branch>"
> > > case, then I can make another attempt at this.
> >
> > You can probably do this with:
> >
> >   !strncmp(argv[1], "-b", 2)
> >
> > The difference is so little, might as well do it IMO.
>
> Actually, that is not correct. I took a quick look before writing this
> and missed the fact that argc == 3 is the bigger problem.
>
> Thinking a little more about this, you can mix other options with
> checkout -b, like --track. You can also specify <start_point>.
>
> Now I don't know enough about this optimization you are doing to know
> whether we need to optimize when these options are given, but at least
> for --track I don't see any reason not to.
>
> So maybe you are better off using something like getopt() (warning:
> getopt modifies the input string so you probably want to duplicate it)
> if you want to support all cases. Though for this simple case you can
> probably get away by just directly scanning the argv list for "-b"
> (using strncmp instead of strcmp to account for "-b<branch-name>)

NO.  This would be unsafe to use if <start_point> is specified.  I
think either -f or -m together with -b make no sense unless
<start_point> is specified, but if they do make sense separately, I'm
guessing this hack should not be used with those flags.  And
additional flags may appear in the future that should not be used
together with this hack.

Personally, although I understand the desire to support any possible
cases in general, *this is a performance hack*.  As such, it should be
as simple and localized as possible.  I don't think supporting
old-style stuck flags (-b$BRANCH) is worth complicating this.  I'm
even leery of adding support for --track (do any users of huge repos
use -b with --track?  Does anyone at all use --track anymore?  I'm not
sure I've ever seen any user use that flag in the last 10 years other
than myself.)  Besides, in the *worst* possible case, the command the
user specifies works just fine...it just takes a little longer.  My
opinion is that Stolee's patch is perfect as-is and should not be
generalized at all.

Just my $0.02,
Elijah

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-30  0:19           ` Elijah Newren
@ 2019-08-30  0:43             ` Taylor Blau
  2019-08-30 16:56               ` Derrick Stolee
  2019-08-30 17:18               ` Junio C Hamano
  0 siblings, 2 replies; 11+ messages in thread
From: Taylor Blau @ 2019-08-30  0:43 UTC (permalink / raw)
  To: Elijah Newren
  Cc: Pratyush Yadav, Derrick Stolee, Phillip Wood,
	Derrick Stolee via GitGitGadget, Git Mailing List, Junio C Hamano,
	Derrick Stolee

Hi Elijah,

On Thu, Aug 29, 2019 at 05:19:44PM -0700, Elijah Newren wrote:
> On Thu, Aug 29, 2019 at 2:42 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > On 30/08/19 02:00AM, Pratyush Yadav wrote:
> > > On 29/08/19 04:07PM, Derrick Stolee wrote:
> > > > On 8/29/2019 2:54 PM, Phillip Wood wrote:
> > > > > Hi Stolee
> > > > >
> > > > > On 29/08/2019 18:01, Derrick Stolee via GitGitGadget wrote:
> > > > >> +
> > > > >> +    if (argc == 3 && !strcmp(argv[1], "-b")) {
> > > > >> +        /*
> > > > >> +         * User ran 'git checkout -b <branch>' and expects
> > > > >
> > > > > What if the user ran 'git checkout -b<branch>'? Then argc == 2.
> > > >
> > > > Good catch. I'm tempted to say "don't do that" to keep this
> > > > simple. They won't have incorrect results, just slower than
> > > > the "with space" option.
> > > >
> > > > However, if there is enough interest in correcting the "-b<branch>"
> > > > case, then I can make another attempt at this.
> > >
> > > You can probably do this with:
> > >
> > >   !strncmp(argv[1], "-b", 2)
> > >
> > > The difference is so little, might as well do it IMO.
> >
> > Actually, that is not correct. I took a quick look before writing this
> > and missed the fact that argc == 3 is the bigger problem.
> >
> > Thinking a little more about this, you can mix other options with
> > checkout -b, like --track. You can also specify <start_point>.
> >
> > Now I don't know enough about this optimization you are doing to know
> > whether we need to optimize when these options are given, but at least
> > for --track I don't see any reason not to.
> >
> > So maybe you are better off using something like getopt() (warning:
> > getopt modifies the input string so you probably want to duplicate it)
> > if you want to support all cases. Though for this simple case you can
> > probably get away by just directly scanning the argv list for "-b"
> > (using strncmp instead of strcmp to account for "-b<branch-name>)
>
> NO.  This would be unsafe to use if <start_point> is specified.  I
> think either -f or -m together with -b make no sense unless
> <start_point> is specified, but if they do make sense separately, I'm
> guessing this hack should not be used with those flags.  And
> additional flags may appear in the future that should not be used
> together with this hack.
>
> Personally, although I understand the desire to support any possible
> cases in general, *this is a performance hack*.  As such, it should be
> as simple and localized as possible.  I don't think supporting
> old-style stuck flags (-b$BRANCH) is worth complicating this.  I'm
> even leery of adding support for --track (do any users of huge repos
> use -b with --track?  Does anyone at all use --track anymore?  I'm not
> sure I've ever seen any user use that flag in the last 10 years other
> than myself.)  Besides, in the *worst* possible case, the command the
> user specifies works just fine...it just takes a little longer.  My
> opinion is that Stolee's patch is perfect as-is and should not be
> generalized at all.

I wholeheartedly agree with this, and pledge my $.02 towards it as well.
Now with a combined total of $.04, I think that this patch is ready for
queueing as-is.

> Just my $0.02,
> Elijah

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-30  0:43             ` Taylor Blau
@ 2019-08-30 16:56               ` Derrick Stolee
  2019-08-30 17:18               ` Junio C Hamano
  1 sibling, 0 replies; 11+ messages in thread
From: Derrick Stolee @ 2019-08-30 16:56 UTC (permalink / raw)
  To: Taylor Blau, Elijah Newren
  Cc: Pratyush Yadav, Phillip Wood, Derrick Stolee via GitGitGadget,
	Git Mailing List, Junio C Hamano, Derrick Stolee

On 8/29/2019 8:43 PM, Taylor Blau wrote:
> Hi Elijah,
> 
> On Thu, Aug 29, 2019 at 05:19:44PM -0700, Elijah Newren wrote:
>> Personally, although I understand the desire to support any possible
>> cases in general, *this is a performance hack*.  As such, it should be
>> as simple and localized as possible.  I don't think supporting
>> old-style stuck flags (-b$BRANCH) is worth complicating this.  I'm
>> even leery of adding support for --track (do any users of huge repos
>> use -b with --track?  Does anyone at all use --track anymore?  I'm not
>> sure I've ever seen any user use that flag in the last 10 years other
>> than myself.)  Besides, in the *worst* possible case, the command the
>> user specifies works just fine...it just takes a little longer.  My
>> opinion is that Stolee's patch is perfect as-is and should not be
>> generalized at all.
> 
> I wholeheartedly agree with this, and pledge my $.02 towards it as well.
> Now with a combined total of $.04, I think that this patch is ready for
> queueing as-is.

Thanks, both!


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/1] checkout: add simple check for 'git checkout -b'
  2019-08-30  0:43             ` Taylor Blau
  2019-08-30 16:56               ` Derrick Stolee
@ 2019-08-30 17:18               ` Junio C Hamano
  1 sibling, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2019-08-30 17:18 UTC (permalink / raw)
  To: Taylor Blau
  Cc: Elijah Newren, Pratyush Yadav, Derrick Stolee, Phillip Wood,
	Derrick Stolee via GitGitGadget, Git Mailing List, Derrick Stolee

Taylor Blau <me@ttaylorr.com> writes:

> I wholeheartedly agree with this, and pledge my $.02 towards it as well.
> Now with a combined total of $.04, I think that this patch is ready for
> queueing as-is.

;-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-30 17:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 17:01 [PATCH 0/1] checkout: add simple check for 'git checkout -b' Derrick Stolee via GitGitGadget
2019-08-29 17:01 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
2019-08-29 17:25   ` Elijah Newren
2019-08-29 18:54   ` Phillip Wood
2019-08-29 20:07     ` Derrick Stolee
2019-08-29 20:30       ` Pratyush Yadav
2019-08-29 21:40         ` Pratyush Yadav
2019-08-30  0:19           ` Elijah Newren
2019-08-30  0:43             ` Taylor Blau
2019-08-30 16:56               ` Derrick Stolee
2019-08-30 17:18               ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).