Re: [PATCH 2/2] Make "git reset" a builtin.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Carlos Rica <jasampler@...>
Cc: <git@...>, Johannes Schindelin <Johannes.Schindelin@...>
Date: Tuesday, September 11, 2007 - 3:32 am

Carlos Rica <jasampler@gmail.com> writes:


Not that git-reset is so performance sensitive, but you could do
this from built-in without exec, by just reading the index and
checking if you have a higher-stage entry yourself.


Instead of making a call to this one after read_from_tree()
returns, immediately before writing the index out at the end of
read_from_tree(), you have the index in core.  I think you can
call read-cache.c::refresh_index() at that point and then do the
write_cache(), no?


s/^ {8}/\t/;


This part is interesting for a couple of reasons.


 * When we can have both rev and path params, and the user calls
   us without '--' disambiguation, we make sure the rev
   parameter (i.e. the first non-option) cannot be interpreted
   as path and the path parameters (i.e. the rest) cannot be
   interpreted as rev, but in git-reset traditionally we did not
   do so.  Maybe we'd want to, but that would be a very isolated
   change and does not have to be a part of this round.  Just
   something to keep in mind...

 * You hint in a comment in the later part of the code that "git
   reset <tree-ish> -- paths" is to selectively read-tree into
   the index.  I do not thinkn we advertize git-reset as such,
   but we do not have to forbid non commit here.  Not that I
   think allowing arbitrary tree object is not so useful in
   practice.
-
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:
[PATCH 2/2] Make "git reset" a builtin., Carlos Rica, (Mon Sep 10, 11:19 pm)
Re: [PATCH 2/2] Make "git reset" a builtin., Junio C Hamano, (Tue Sep 11, 3:32 am)
[PATCH] builtin-reset: avoid forking "update-index --refresh", Johannes Schindelin, (Sat Nov 3, 11:21 am)
[PATCH] builtin-reset: do not call "ls-files --unmerged", Johannes Schindelin, (Sat Nov 3, 10:33 am)