All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Sahil Dua <sahildua2305@gmail.com>
Cc: Ramsay Jones <ramsay@ramsayjones.plus.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Jul 2017, #09; Mon, 31)
Date: Thu, 03 Aug 2017 14:07:47 -0700	[thread overview]
Message-ID: <xmqqd18cweak.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CALiud+nm9wu4rBY6zBXmenJj_0Mn7xeU_FAvSdn4fdH+q--Jag@mail.gmail.com> (Sahil Dua's message of "Thu, 3 Aug 2017 22:26:10 +0200")

Sahil Dua <sahildua2305@gmail.com> writes:

> Ah! I had skipped this reply from Ramsay earlier.
>
> On Tue, Aug 1, 2017 at 1:36 AM, Ramsay Jones
> ...
>>>  I personally do not think "branch --copy master backup" while on
>>>  "master" that switches to "backup" is a good UI, and I *will* say
>>>  "I told you so" when users complain after we merge this down to
>>>  'master'.
>>
>> I wouldn't normally comment on an issue like this because I am
>> not very good at specifying, designing and evaluating UIs (so
>> who in their right mind would listen to me). ;-)
>>
>> FWIW, I suspect that I would not like using this interface either
>> and would, therefore, not use it.
>
> Does that mean you'd use it when "branch --copy feature-branch
> new-feature-branch" in the case when you would want to start working
> on a new branch (to modify or experiment with your current feature
> branch) on top of a branch keeping intact all the configuration and
> logs?

I am not Ramsay, but your choice of branch names in your question,
i.e. "branch --copy feature new-feature", is what we do not agree
with in the first place, especially when we are *on* the "feature"
branch.

We view "copy A B" as a way to make a back-up of A in B.  I.e. We
want to keep working on A, but just in case we screw up badly, make
a backup copy of A in B, so that we can recover by a "branch --move
B A" later if needed.  So touching B is the last thing we want to do
after "copy A B" operation---hence we do not want to switch to B.

That is not to say that you are wrong to wish to create a new
branch, check it out and start working on it with a single command.
We already have such a command all Git users are accustomed to,
which is "git checkout -b new-feature-branch feature-branch".  

That existing command does not copy things other than the commit
object name from "feature-branch", and I do not think it should by
default.  But I do not think it is wrong to extend it with a new
option (think of it as "checkout --super-b" ;-) to copy other things
like branch descriptions etc.

So from that point of view, your new feature conceptually fits a lot
better to "git checkout", and does not belong to "git branch".  That
is why I do not think "git branch --copy A B" while you are on A
should check out B after creating the copy.

  reply	other threads:[~2017-08-03 21:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 22:30 What's cooking in git.git (Jul 2017, #09; Mon, 31) Junio C Hamano
2017-07-31 23:36 ` Ramsay Jones
2017-08-03 20:26   ` Sahil Dua
2017-08-03 21:07     ` Junio C Hamano [this message]
2017-08-03 22:20       ` Ramsay Jones
2017-08-05 20:34       ` Ævar Arnfjörð Bjarmason
2017-08-05 22:37         ` Junio C Hamano
2017-08-06 20:26           ` Ævar Arnfjörð Bjarmason
2017-08-07 21:25             ` Igor Djordjevic
2017-08-07 22:20               ` Igor Djordjevic
2017-08-08 13:14                 ` Ævar Arnfjörð Bjarmason
2017-08-08 18:55                   ` Igor Djordjevic
2017-08-03 20:17 ` Sahil Dua
2017-08-03 20:23   ` Stefan Beller
2017-08-03 21:17   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqd18cweak.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=sahildua2305@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.