From: Pavel Roskin <proski@gnu.org>
To: Matthias Urlichs <smurf@smurf.noris.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Allow "git cancel" to change branches
Date: Thu, 21 Apr 2005 16:00:09 -0400 [thread overview]
Message-ID: <1114113609.29603.24.camel@dv> (raw)
In-Reply-To: <E1DObsr-0006Au-MA@server.smurf.noris.de>
Hi, Matthias!
On Thu, 2005-04-21 at 23:31 +1000, Matthias Urlichs wrote:
> "git cancel" may not be named correctly for this job, but it does almost
> everything you'd need for switching between one branch and another
> within a repository, so...
This functionality is badly needed, but "git cancel" should probably
remain what it is.
> +if [ "$1" ] ; then
> + test -f .git/heads/$1 || cp .git/HEAD .git/heads/$1
> + ln -sf "heads/$1" .git/HEAD
> +fi
Considering that the patch is essentially just this block of code, it
could be (in the first approximation) a separate command, e.g. "git
switch", that would call "git cancel" if needed.
But let's consider the fact that "git cancel" removes all local changes.
That's quite a serious side effect. I don't always want to remove local
changes when I switch between branches in CVS. Many users would prefer
git to do a merge.
I think that "git track" needs to be redesigned. There are at least
three properties of the working directory (related to branch tracking)
that users may want to change:
1) Where new revisions are pulled from. It could be more than one
branch (ideal implementation - with several copies of rsync run
simultaneously).
2) What branch is "checked out" to the working directory, i.e. what
branch would "git cancel" restore.
3) Whether new changes are merged automatically.
I suggest following syntax:
git track -b WORKING-BRANCH [--cancel] [--active|--passive]
[TRACK-BRANCH...|--notrack]
--cancel would cancel changes rather than merge when the current branch
changes.
--active enables automerge, --passive disables it
Empty list of branches to track should not disable tracking. Only
--notrack should do it.
Then your "git cancel BRANCH" would become:
git track -b BRANCH --cancel
--
Regards,
Pavel Roskin
prev parent reply other threads:[~2005-04-21 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-21 13:31 [PATCH] Allow "git cancel" to change branches Matthias Urlichs
2005-04-21 16:05 ` Petr Baudis
2005-04-21 20:00 ` Pavel Roskin [this message]
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=1114113609.29603.24.camel@dv \
--to=proski@gnu.org \
--cc=git@vger.kernel.org \
--cc=smurf@smurf.noris.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 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 NNTP newsgroup(s).