git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Martin von Zweigbergk <martinvonz@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Philippe Vaucher <philippe.vaucher@gmail.com>,
	git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>
Subject: Re: Proposal: create meaningful aliases for git reset's hard/soft/mixed
Date: Tue, 18 Dec 2012 11:30:57 -0500	[thread overview]
Message-ID: <20121218163057.GB20122@sigill.intra.peff.net> (raw)
In-Reply-To: <CANiSa6h3Qf=6hw6fzHVw=CeuhnNeq+cuEvwwmVhUaSOcVgCSBA@mail.gmail.com>

On Mon, Dec 17, 2012 at 10:34:07PM -0800, Martin von Zweigbergk wrote:

> On Wed, Nov 23, 2011 at 10:51 AM, Junio C Hamano <gitster@pobox.com> wrote:
> >
> > I am guilty of introducing "git reset --soft HEAD^" before I invented
> > "commit --amend" during v1.3.0 timeframe to solve the issue "soft" reset
> > originally wanted to.
> 
> I do use "commit --amend" a lot, but I still appreciate having "reset
> --soft". For example, to squash the last few commits:
> 
> git reset --soft HEAD^^^ && git commit --amend

Me too. Another one I use is:

  $ hack hack hack
  $ git commit -m wip
  $ git checkout something-else
  ... time passes ...
  $ git checkout orig-branch
  $ git reset --soft HEAD^
  $ hack hack hack
  $ git diff
  $ git add -p
  $ git commit

which ends up with the same history as "commit --amend", but in between
the reset and the commit, the bogus WIP commit is thrown away entirely.
And things like "diff" and "add -p" do what you want, instead of showing
your progress on top of the WIP.

-Peff

      parent reply	other threads:[~2012-12-18 16:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  8:28 Proposal: create meaningful aliases for git reset's hard/soft/mixed Philippe Vaucher
2011-11-23  8:49 ` Matthieu Moy
2011-11-23 11:32   ` Philippe Vaucher
2012-12-18  6:24   ` Martin von Zweigbergk
2011-11-23 12:02 ` Nguyen Thai Ngoc Duy
2011-11-23 18:51 ` Junio C Hamano
2011-11-23 23:00   ` Philippe Vaucher
2011-12-01 21:23     ` Phil Hord
2011-12-02  7:26       ` Thomas Rast
2011-12-02  7:45         ` Miles Bader
2011-12-02 15:28         ` Phil Hord
2011-12-02 14:27       ` Philippe Vaucher
2011-12-02 15:38         ` Phil Hord
2011-12-06  7:34           ` Philippe Vaucher
2012-10-03 16:23             ` Phil Hord
2012-10-03 18:41               ` Junio C Hamano
2012-10-03 19:03                 ` Junio C Hamano
2012-12-15 18:57                   ` Jan Engelhardt
2011-12-01 21:02   ` Phil Hord
2012-12-18  6:34   ` Martin von Zweigbergk
2012-12-18 15:22     ` Junio C Hamano
2012-12-18 16:30     ` Jeff King [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

  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=20121218163057.GB20122@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martinvonz@gmail.com \
    --cc=philippe.vaucher@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).