git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Don't require working tree for git-rm

From
Mike Hommey <mh@glandium.org>
Date
Nov 3, 2007, 12:11 UTC
Message-ID
<20071103121150.GB4295@glandium.org>
In-Reply-To
<Pine.LNX.4.64.0711031155070.4362@racer.site>
On Sat, Nov 03, 2007 at 11:56:17AM +0000, Johannes Schindelin wrote:
Show 27 quoted lines
> Hi,
> 
> On Sat, 3 Nov 2007, Mike Hommey wrote:
> 
> > This allows to do git rm --cached -r directory, instead of
> > git ls-files -z directory | git update-index --remove -z --stdin.
> > This can be particularly useful for git-filter-branch users.
> > 
> > Signed-off-by: Mike Hommey <mh@glandium.org>
> > ---
> >  git.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/git.c b/git.c
> > index 4e10581..01dcb6a 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -345,7 +345,7 @@ static void handle_internal_command(int argc, const char **argv)
> >  		{ "rev-list", cmd_rev_list, RUN_SETUP },
> >  		{ "rev-parse", cmd_rev_parse, RUN_SETUP },
> >  		{ "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
> > -		{ "rm", cmd_rm, RUN_SETUP | NEED_WORK_TREE },
> > +		{ "rm", cmd_rm, RUN_SETUP },
> 
> Just removing this is wrong!
> 
> You have to test for a working tree if "--cached" was _not_ given.  
See the other patch I sent a bit later.
Mike
Previous: Johannes Schindelin
Message 3 of 3 in “Don't require working tree for git-rm”
  1. Don't require working tree for git-rmMike Hommey, Nov 3, 2007
  2. Johannes SchindelinNov 3, 2007
  3. Mike HommeyNov 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.