[RFC/PATCH 0/4] reset: be more flexible about <rev>

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Nieder
Date: Tuesday, October 19, 2010 - 3:10 pm

Junio C Hamano wrote:


I wouldn't be surprised to find people using

	git reset HEAD <paths>

just because '--' did not come to mind quickly enough.  For example, I
have a faint memory of doing that myself a couple of years ago.  Why
should Git mind?

Patch 1 below teaches reset -p to accept an arbitrary tree for <rev>.
Unfortunately add--interactive notices but does not error out when
<rev> is a blob; that should be fixed in the add--interactive script
by checking the exit status of commands it runs, I think (help from
those more comfortable in perl would be appreciated).

Patch 2 removes the arbitrary restriction in "git reset <rev>
<path>" that <rev> be a commit.  It also paves the way for writing
patch 3 more clearly.

Patch 3 is the "probably Ok" change you mentioned above.  It allows
use of "git reset" to un-add a file from an unborn branch.

Patch 4 is like patch 3, but for "git reset HEAD".

Help on finishing up patch 1 (or comments to the effect that it is
pointless) would be welcome.

Jonathan Nieder (4):
  reset -p: accept "git reset -p <tree>"
  reset: accept "git reset <tree> <path>"
  reset: accept "git reset -- <path>" from unborn branch
  reset: accept "git reset HEAD <path>" from unborn branch

 builtin/reset.c         |   27 ++++++++++++++++-------
 t/t7102-reset.sh        |   31 +++++++++++++++++++++++++++
 t/t7105-reset-patch.sh  |   12 ++++++++++
 t/t7106-reset-unborn.sh |   53 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 115 insertions(+), 8 deletions(-)
 create mode 100755 t/t7106-reset-unborn.sh

-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Mon Oct 18, 1:45 pm)
Re: Git terminology: remote, add, track, stage, etc., Jonathan Nieder, (Mon Oct 18, 2:15 pm)
Re: Git terminology: remote, add, track, stage, etc., Sverre Rabbelier, (Mon Oct 18, 2:35 pm)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Mon Oct 18, 2:41 pm)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Mon Oct 18, 2:57 pm)
Re: Git terminology: remote, add, track, stage, etc., Junio C Hamano, (Mon Oct 18, 5:03 pm)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Mon Oct 18, 9:49 pm)
Re: Git terminology: remote, add, track, stage, etc., Wincent Colaiuta, (Tue Oct 19, 12:19 am)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Tue Oct 19, 12:48 am)
Re: Git terminology: remote, add, track, stage, etc., Wincent Colaiuta, (Tue Oct 19, 1:05 am)
Re: Git terminology: remote, add, track, stage, etc., Matthijs Kooijman, (Tue Oct 19, 1:05 am)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Tue Oct 19, 1:27 am)
[PATCH v3] Porcelain scripts: Rewrite cryptic &quot;needs updat ..., Ramkumar Ramachandra, (Tue Oct 19, 7:39 am)
Re: Git terminology: remote, add, track, stage, etc., Eugene Sajine, (Tue Oct 19, 8:09 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Tue Oct 19, 10:30 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Tue Oct 19, 10:51 am)
Re: Git terminology: remote, add, track, stage, etc., Jonathan Nieder, (Tue Oct 19, 11:28 am)
Re: Git terminology: remote, add, track, stage, etc., Sverre Rabbelier, (Tue Oct 19, 11:34 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Tue Oct 19, 11:43 am)
Re: Git terminology: remote, add, track, stage, etc., Nicolas Pitre, (Tue Oct 19, 12:15 pm)
Re: Git terminology: remote, add, track, stage, etc., Junio C Hamano, (Tue Oct 19, 12:20 pm)
Re: Git terminology: remote, add, track, stage, etc., Jakub Narebski, (Tue Oct 19, 1:57 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Tue Oct 19, 2:53 pm)
[RFC/PATCH 0/4] reset: be more flexible about <rev>, Jonathan Nieder, (Tue Oct 19, 3:10 pm)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Wed Oct 20, 2:53 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Wed Oct 20, 4:34 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Wed Oct 20, 7:01 am)
Re: Git terminology: remote, add, track, stage, etc., Michael Haggerty, (Thu Oct 21, 1:44 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 4:20 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Thu Oct 21, 5:31 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 5:56 am)
Re: Git terminology: remote, add, track, stage, etc., Thore Husfeldt, (Thu Oct 21, 7:06 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Thu Oct 21, 1:06 pm)
Re: Git terminology: remote, add, track, stage, etc., Miles Bader, (Thu Oct 21, 9:07 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Fri Oct 22, 4:51 am)
Re: Git terminology: remote, add, track, stage, etc., Paul Bolle, (Fri Oct 22, 1:16 pm)
Re: Git terminology: remote, add, track, stage, etc., Eugene Sajine, (Fri Oct 22, 2:00 pm)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Fri Oct 22, 2:46 pm)
Re: [PATCH v3] Porcelain scripts: Rewrite cryptic &quot;needs u ..., Ramkumar Ramachandra, (Wed Oct 27, 7:55 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Wed Oct 27, 8:03 am)
Re: Git terminology: remote, add, track, stage, etc., Drew Northup, (Wed Oct 27, 8:16 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Wed Oct 27, 9:08 am)
Re: Git terminology: remote, add, track, stage, etc., Ramkumar Ramachandra, (Thu Oct 28, 8:20 am)
Re: Git terminology: remote, add, track, stage, etc., Matthieu Moy, (Thu Oct 28, 11:25 am)