git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Recursive remove
@ 2006-01-13 13:21 Peter Eriksen
       [not found] ` <20060113090301.10e08670.seanlkml@sympatico.ca>
  2006-01-13 17:37 ` Junio C Hamano
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Eriksen @ 2006-01-13 13:21 UTC (permalink / raw)
  To: git

Hello,

A way to recursively remove a directory /Some/Dir/ is a follows:

   git ls-files -z Some/Dir >rmfiles
   git update-index -z --force-remove --stdin <rmfiles
   git commit -a -m "Remove directory Some/Dir"
   rm -rf Some/Dir

What is a better way to do it?

Regards,

Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Recursive remove
       [not found] ` <20060113090301.10e08670.seanlkml@sympatico.ca>
@ 2006-01-13 14:03   ` sean
  0 siblings, 0 replies; 5+ messages in thread
From: sean @ 2006-01-13 14:03 UTC (permalink / raw)
  To: Peter Eriksen; +Cc: git

On Fri, 13 Jan 2006 14:21:19 +0100
"Peter Eriksen" <s022018@student.dtu.dk> wrote:

> Hello,
> 
> A way to recursively remove a directory /Some/Dir/ is a follows:
> 
>    git ls-files -z Some/Dir >rmfiles
>    git update-index -z --force-remove --stdin <rmfiles
>    git commit -a -m "Remove directory Some/Dir"
>    rm -rf Some/Dir
> 
> What is a better way to do it?
> 

Hi Peter,

The following is a bit more concise but not better than your version:

rm -rf Some/Dir
git ls-files -z -d Some/Dir | git-update-index -z --remove --stdin
git commit -m "Remove directory Some/Dir"


Git could stand to have an "rm" command to make this easier.


Sean

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Recursive remove
  2006-01-13 13:21 Recursive remove Peter Eriksen
       [not found] ` <20060113090301.10e08670.seanlkml@sympatico.ca>
@ 2006-01-13 17:37 ` Junio C Hamano
       [not found]   ` <20060113125604.4ec91466.seanlkml@sympatico.ca>
  1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2006-01-13 17:37 UTC (permalink / raw)
  To: Peter Eriksen; +Cc: git

"Peter Eriksen" <s022018@student.dtu.dk> writes:

> A way to recursively remove a directory /Some/Dir/ is a follows:
>
>    git ls-files -z Some/Dir >rmfiles
>    git update-index -z --force-remove --stdin <rmfiles
>    git commit -a -m "Remove directory Some/Dir"
>    rm -rf Some/Dir
>
> What is a better way to do it?

	$ rm -fr Some/Dir; git commit -a -m 'Remove'

perhaps?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Recursive remove
       [not found]   ` <20060113125604.4ec91466.seanlkml@sympatico.ca>
@ 2006-01-13 17:56     ` sean
  2006-01-13 19:51       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: sean @ 2006-01-13 17:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: s022018, git

On Fri, 13 Jan 2006 09:37:54 -0800
Junio C Hamano <junkio@cox.net> wrote:

> 
> 	$ rm -fr Some/Dir; git commit -a -m 'Remove'
> 
> perhaps?
> 

Sigh, its been a humbling morning all around; can't get easier than that.

Sean

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Recursive remove
  2006-01-13 17:56     ` sean
@ 2006-01-13 19:51       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-01-13 19:51 UTC (permalink / raw)
  To: sean; +Cc: git

sean <seanlkml@sympatico.ca> writes:

> On Fri, 13 Jan 2006 09:37:54 -0800
> Junio C Hamano <junkio@cox.net> wrote:
>> 
>> 	$ rm -fr Some/Dir; git commit -a -m 'Remove'
>> 
>> perhaps?
>
> Sigh, its been a humbling morning all around; can't get easier than that.

Perhaps this is because I did not do a good job in
Documentation/git-commit.txt.  Something like this?

-- >8 --
Documentation: git-commit -a

A bit more elaboration on what "update all paths" means.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index e0ff74f..e35984d 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -25,7 +25,9 @@ information.
 OPTIONS
 -------
 -a|--all::
-	Update all paths in the index file.
+	Update all paths in the index file.  The command with this flag
+	notices files that have been modified and deleted, but new files
+	you have not told about git are not affected.
 
 -c or -C <commit>::
 	Take existing commit object, and reuse the log message

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-01-13 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 13:21 Recursive remove Peter Eriksen
     [not found] ` <20060113090301.10e08670.seanlkml@sympatico.ca>
2006-01-13 14:03   ` sean
2006-01-13 17:37 ` Junio C Hamano
     [not found]   ` <20060113125604.4ec91466.seanlkml@sympatico.ca>
2006-01-13 17:56     ` sean
2006-01-13 19:51       ` Junio C Hamano

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 NNTP newsgroup(s).