From: "David Kågedal" <davidk@lysator.liu.se>
To: git@vger.kernel.org
Subject: Re: [PATCH] git-checkout --push/--pop
Date: Wed, 05 Dec 2007 18:44:05 +0100 [thread overview]
Message-ID: <877ijt2g0q.fsf@lysator.liu.se> (raw)
In-Reply-To: vpqir3de8t6.fsf@bauges.imag.fr
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Matthieu, is this something that forgetful people would find useful?
>
> Not sure. That's obviously an interesting feature, but adding two more
> options to checkout (which is already a huge swiss-army knife) might
> not be worth the trouble.
>
> And the issue with push/pop approaches is that I usually notice I have
> to use pop after not having used push (i.e. I use "cd -" all the time,
> but rarely "pushd"/"popd").
It is probably more common that you want to be able to switch back to
the previous branch, than that you actually need a full stack.
So a "git checkout --previous" could be enough. Or a set of aliases
[alias]
co = !"git symbolic-ref HEAD | sed -ne 's!refs/heads/!!p' > .git/LAST ; git checkout"
pop = !"git co $(cat .git/LAST)"
--
David Kågedal
next prev parent reply other threads:[~2007-12-05 19:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-04 20:08 [RFC] Introduce .git/BRANCH to point to the current branch Salikh Zakirov
2007-12-04 20:19 ` Matthieu Moy
2007-12-04 20:42 ` Jakub Narebski
2007-12-04 20:46 ` Junio C Hamano
2007-12-04 21:32 ` Matthieu Moy
2007-12-04 21:48 ` Junio C Hamano
2007-12-04 22:04 ` [PATCH] git-checkout --push/--pop Nanako Shiraishi
2007-12-05 6:59 ` Junio C Hamano
2007-12-05 10:26 ` Matthieu Moy
2007-12-05 17:44 ` David Kågedal [this message]
2007-12-06 23:39 ` [RFC] Introduce .git/BRANCH to point to the current branch Robin Rosenberg
2007-12-04 21:57 ` Salikh Zakirov
2007-12-04 22:06 ` Junio C Hamano
2007-12-04 22:08 ` Jakub Narebski
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=877ijt2g0q.fsf@lysator.liu.se \
--to=davidk@lysator.liu.se \
--cc=git@vger.kernel.org \
/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).