git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Sahil Dua <sahildua2305@gmail.com>
Subject: Re: What's cooking in git.git (Jul 2017, #04; Thu, 13)
Date: Sat, 15 Jul 2017 13:12:25 +0200	[thread overview]
Message-ID: <87iniu2bty.fsf@gmail.com> (raw)
In-Reply-To: <xmqqo9snsy0k.fsf@gitster.mtv.corp.google.com>


On Thu, Jul 13 2017, Junio C. Hamano jotted:

> Here are the topics that have been cooking.  Commits prefixed with
> [...]
>
> * jc/allow-lazy-cas (2017-07-06) 1 commit
>  - push: disable lazy --force-with-lease by default
>
>  Because "git push --force-with-lease[=<ref>]" that relies on the
>  stability of remote-tracking branches is unsafe when something
>  fetches into the repository behind user's back, it is now disabled
>  by default.  A new configuration variable can be used to enable it
>  by users who know what they are doing.  This would pave the way to
>  possibly turn `--force` into `--force-with-lease`.
>
>  Will wait for feedback, then merge to and cook in 'next'.

Aside from the feedback I just sent now 87k23a2d28.fsf@gmail.com,
there's my outstanding comment on the config variable name in
877ezkbn6x.fsf@gmail.com which is waiting on your feedback.

> * sd/branch-copy (2017-06-18) 3 commits
>  - branch: add a --copy (-c) option to go with --move (-m)
>  - branch: add test for -m renaming multiple config sections
>  - config: create a function to format section headers
>
>  "git branch" learned "-c/-C" to create and switch to a new branch
>  by copying an existing one.
>
>  Undecided.
>
>  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
>  'next' and eventually to 'master'.

For anyone following along with this. The reason Sahil & I hacked it up
like that is because that's analogous to what the --move option does.

Let's see what *nix does:

    $ rm -rf /tmp/{master,backup}; mkdir /tmp/master && cd /tmp/master && mv /tmp/{master,backup} ; file /tmp/{master,backup}
    /tmp/master: cannot open `/tmp/master' (No such file or directory)
    /tmp/backup: directory

Similarly to that, when you're on "master" "git branch --move backup"
could have left you on an orphan branch, but it doesn't, it's the
equivalent of "mv && cd" in *nix terms.

So since our --move is really --move-and-checkout I think it would be
confusing to introduce a --copy sister option that has the semantics of
--copy-no-checkout instead of a corresponding --copy-and-checkout.

I think it's easier to explain & use an option that's "like --move
except the old branch doesn't get deleted", which is what this does,
instead of "actually not analogous to --move at all".

I happen to want to use this for something where the semantics on that
topic work better for me, but I recognize that that's just a matter of
taste, if we were green-fielding this I wouldn't mind either way.

But since we're not, and especially with all the confusion around
checkout/branch (some of the hairiest UX in git) I think our --move &
--copy should be symmetric in the same way that mv(1) an cp(1) are
symmetric. Let's not add yet another special case to whether a ref is
created/checked out when being manipulated by some mode of
checkout/branch.

  parent reply	other threads:[~2017-07-15 11:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 23:44 What's cooking in git.git (Jul 2017, #04; Thu, 13) Junio C Hamano
2017-07-14  0:27 ` Santiago Torres
2017-07-14  2:32   ` Junio C Hamano
2017-07-14 14:02     ` Santiago Torres
2017-07-14 15:25       ` Junio C Hamano
2017-07-17 21:42         ` Santiago Torres
2017-07-17 22:09           ` Junio C Hamano
2017-07-18 17:54             ` Santiago Torres
2017-07-18 18:46               ` Junio C Hamano
2017-07-18 21:16                 ` Santiago Torres
2017-07-18 21:38                   ` Junio C Hamano
2017-07-15 11:12 ` Ævar Arnfjörð Bjarmason [this message]
2017-07-17 17:55   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=87iniu2bty.fsf@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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).