All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Dimitar Bonev <dsbonev@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state
Date: Sat, 4 May 2013 10:58:39 +0200	[thread overview]
Message-ID: <87obcryvcw.fsf@hexa.v.cablecom.net> (raw)
In-Reply-To: <CADeMBooSZA4D7YctRpRf+axjcUhkMBaJhkd89nssxZYFKph5sA@mail.gmail.com> (Dimitar Bonev's message of "Sat, 4 May 2013 10:34:55 +0300")

Dimitar Bonev <dsbonev@gmail.com> writes:

> I have been looking for such a command/option and no one gave me
> sufficient answer. So this message should be considered as a feature
> request. I had a situation where I had staged a file with a problem
> solution in it, then I wanted to experiment with a different solution
> so I had to revert the file to its HEAD state and I couldn't find a
> way that preserves the staged state of that file. More discussions:
>
> https://groups.google.com/forum/?fromgroups=#!topic/git-users/nYiN-rE_3i0
>
> http://stackoverflow.com/questions/16335799/git-porcelain-command-to-revert-a-single-file-to-its-head-state-but-keep-its-sta

Is that a common enough issue to warrant a better solution than

  git show HEAD:targetfile > targetfile

which is how we would do it?

Or more likely,

  git commit -m WIP
  git revert -n HEAD

which is safer anyway, since it doesn't lose the formerly-staged state
so easily (you have the reflog in case of any mistakes).

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2013-05-04  8:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-04  7:34 Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state Dimitar Bonev
2013-05-04  8:58 ` Thomas Rast [this message]
2013-05-04 11:13   ` Dimitar Bonev
2013-05-04 18:48     ` Jonathan Nieder
2013-05-04 19:56   ` Junio C Hamano
2013-05-04 20:01     ` Junio C Hamano
2013-05-04 22:46       ` Dimitar Bonev
2013-05-06  9:51         ` Thomas Rast
2013-05-06 14:52         ` Junio C Hamano
2013-05-07 20:39           ` Dimitar Bonev

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=87obcryvcw.fsf@hexa.v.cablecom.net \
    --to=trast@inf.ethz.ch \
    --cc=dsbonev@gmail.com \
    --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 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.