From: Johannes Sixt <j.sixt@viscovery.net>
To: Christian Couder <christian.couder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Christian Couder <chriscool@tuxfamily.org>,
git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Stephan Beyer <s-beyer@gmx.net>,
Daniel Barkalow <barkalow@iabervon.org>,
Jakub Narebski <jnareb@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v3 3/4] reset: add option "--merge-safe" to "git reset"
Date: Thu, 17 Sep 2009 15:05:20 +0200 [thread overview]
Message-ID: <4AB23410.6080508@viscovery.net> (raw)
In-Reply-To: <c07716ae0909170512k3c2ec7m21e69e9acfdfd81f@mail.gmail.com>
Christian Couder schrieb:
> On Thu, Sep 17, 2009 at 9:24 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> Junio C Hamano schrieb:
>>> Johannes Sixt <j.sixt@viscovery.net> writes:
>> $ git stash
>> $ git reset --hard $target
>> $ git stash pop
>>
>>> I have _no_ idea what the intended use-case of --merge-safe is, and that
>>> was why I asked Christian for clarification in the previous round. The
>>> answer was still not clear enough so I pointed out --merge-safe could be
>>> still doing a wrong thing even in _his_ use-case.
>> Reading Christian in 200909170554.49416.chriscool@tuxfamily.org, I think
>> this *is* his use-case? Christian?
>
> Yes, I agree, it can be used instead of git stash.
It "can"? Do you say that you intend --merge-safe for something else in
addition to the above stash + reset --hard + stash pop sequence? What?
> By the way Linus, in his
> patch that added the --merge option, said that --merge could be used like
> that.
But that use-case has one important difference: You can't use stash right
before the reset:
# work tree is dirty
$ git pull $there $topic # assume we have conflicts
# investigate result ...
# oh no, that's crap, scratch it
$ git stash what? conflicted changes?
$ git reset what? --hard would remove my dirty state, too
You are screwed. 'git reset --merge' comes to rescue.
I'm pretty sure you don't mean --merge-safe to provide extra safety in
*this* use-case, but that you have a very different use-case in mind.
-- Hannes
next prev parent reply other threads:[~2009-09-17 13:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 4:14 [PATCH v3 0/4] "git reset --merge" related improvements Christian Couder
2009-09-17 4:14 ` [PATCH v3 1/4] reset: add a few tests for "git reset --merge" Christian Couder
2009-09-17 4:14 ` [PATCH v3 2/4] reset: use "unpack_trees()" directly instead of "git read-tree" Christian Couder
2009-09-17 4:14 ` [PATCH v3 3/4] reset: add option "--merge-safe" to "git reset" Christian Couder
2009-09-17 5:15 ` Junio C Hamano
2009-09-17 6:38 ` Johannes Sixt
2009-09-17 7:07 ` Junio C Hamano
2009-09-17 7:24 ` Johannes Sixt
2009-09-17 12:12 ` Christian Couder
2009-09-17 13:05 ` Johannes Sixt [this message]
2009-09-17 13:25 ` Christian Couder
2009-09-17 20:43 ` Junio C Hamano
2009-09-17 12:25 ` Christian Couder
2009-09-17 21:04 ` Daniel Barkalow
2009-09-17 4:14 ` [PATCH v3 4/4] reset: add test cases for "--merge-safe" option Christian Couder
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=4AB23410.6080508@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=barkalow@iabervon.org \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=s-beyer@gmx.net \
--cc=torvalds@linux-foundation.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 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.