All of lore.kernel.org
 help / color / mirror / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 0/1] Introduce a way to create a branch and worktree at the same time
Date: Thu, 10 Mar 2016 18:51:55 +0700	[thread overview]
Message-ID: <CACsJy8BA7-ev9wTt6K45TgiNxOaBUXbN1P03U4EUAzAPy=7Faw@mail.gmail.com> (raw)
In-Reply-To: <cover.1457609615.git.johannes.schindelin@gmx.de>

On Thu, Mar 10, 2016 at 6:34 PM, Johannes Schindelin
<johannes.schindelin@gmx.de> wrote:
> The invention of the `git worktree` command changed this developer's
> working style dramatically. Rather than switching between branches all
> the time, topic branches are created and checked out in newly-added
> worktrees, to be reworked and refined until the topic branch is either
> merged into `master` or abandoned.
>
> It gets rather tiresome, and also typo-prone, to call "git branch xyz
> upstream/master && git worktree add xyz xyz" all the time.

You can actually do "git worktree -b xyz xyz upstream/master" for the
same effect. Maybe we can avoid "xyz" duplication with "-b -" or a new
option name?

> Hence this
> proposal: "git branch -w xyz upstream/master" to do the same.
>
> The plan is to also support "git branch -d -w xyz" once the `git
> worktree` command learned a `remove` (or `delete`) subcommand.

"git worktree remove" is coming (will be resent after -rc period). And
I agree it's convenient for it to remove the branch as well because
that happened to (and annoyed) me a few times. I still think it should
be centered around git-worktree than git-branch though.

> One possible improvement would be to add "/xyz/" to the parent
> repository's .git/info/exclude, but this developer hesitates to
> introduce that feature without the "delete" counterpart: those exclude
> entries would likely go stale very quickly. Besides, there might be a
> plan in the working to exclude worktrees automagically?

That's needed because you add a worktree inside another worktree? I
know that feeling, but I've changed my layout from ~/w/git as main
worktree (and ~/w/git/.git as repo) to ~/w/git as a non-worktree dir
that contains all worktrees, e.g. ~/w/git/reinclude-dir,
~/w/git/worktree-config, ~/w/git/lmdb... My typical worktree add
command is "git worktree add ../<some-name>" then move there and do
stuff. No nested worktrees, no need to update exclude file (and no
messing up emacs' rgrep command, which does not understand .gitignore
anyway)
-- 
Duy

  parent reply	other threads:[~2016-03-10 11:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 11:34 [PATCH 0/1] Introduce a way to create a branch and worktree at the same time Johannes Schindelin
2016-03-10 11:34 ` [PATCH 1/1] branch: allow conveniently adding new worktrees for new branches Johannes Schindelin
2016-03-10 11:51 ` Duy Nguyen [this message]
2016-03-10 11:59   ` [PATCH 0/1] Introduce a way to create a branch and worktree at the same time Duy Nguyen
2016-03-10 13:24     ` Johannes Schindelin
2016-03-10 13:21   ` Johannes Schindelin
2016-03-11  0:56     ` Duy Nguyen
2016-03-11  6:43       ` Junio C Hamano
2016-03-15  6:53         ` Johannes Schindelin
2016-03-15 10:34           ` Duy Nguyen
2016-03-15 13:56             ` Johannes Schindelin
2016-03-15 14:07               ` Duy Nguyen
2016-03-11  2:57     ` Mikael Magnusson
2016-03-14 13:45       ` Johannes Schindelin
2016-03-15 20:40       ` Johannes Sixt
2016-03-10 20:45   ` Eric Sunshine

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='CACsJy8BA7-ev9wTt6K45TgiNxOaBUXbN1P03U4EUAzAPy=7Faw@mail.gmail.com' \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /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.