From: Junio C Hamano <hidden> Date: 2016-06-15 22:55:29
Zoltan Klinger [off-list ref] writes:
Only print out the names of the files and directories that got actually
deleted.
Consider the following repo layout:
|-- test.git/
|-- foo/
|-- bar/
|-- bar.txt
|-- frotz.git/
|-- frotz.txt
|-- tracked_file1
|-- untracked_file1
...
Consider the output of the improved version:
$ git clean -fd
Removed foo/bar/bar.txt
Removed foo/bar
Removed untracked_file1
Hrm, following your discussion (ellided above), I would have
expected that you would show
Removing directory foo/bar
Removing untracked_file1
Hi,
On Thu, Dec 06, 2012 at 09:37:31AM -0800, Junio C Hamano wrote:
Zoltan Klinger [off-list ref] writes:
quoted
Only print out the names of the files and directories that got actually
deleted.
Consider the following repo layout:
|-- test.git/
|-- foo/
|-- bar/
|-- bar.txt
|-- frotz.git/
|-- frotz.txt
|-- tracked_file1
|-- untracked_file1
...
Consider the output of the improved version:
$ git clean -fd
Removed foo/bar/bar.txt
Removed foo/bar
Removed untracked_file1
Hrm, following your discussion (ellided above), I would have
expected that you would show
Removing directory foo/bar
Removing untracked_file1
Also it would be nice to have warnings about undeleted directories since this git
clean behavior (or the work around to pass -f twice) is not documented.
Without a warning you would probably miss that something was _not_ deleted.
So something like:
Removing foo
Removing bar
...
Warning: Not all untracked objects have been deleted:
<list objects here> (optional)
Use git clean --force --force to delete all objects.
But clearly going into a good direction. Thanks.
Soren
Hrm, following your discussion (ellided above), I would have
expected that you would show
Removing directory foo/bar
Removing untracked_file1
Also it would be nice to have warnings about undeleted directories since this git
clean behavior (or the work around to pass -f twice) is not documented.
Without a warning you would probably miss that something was _not_ deleted.
Thanks for the feedback. I think you're right. Showing 'foo/bar/bar.txt' in
the list when 'foo/bar/' directory has been successfully deleted is just noise.
Would like to get some more feedback on the proposed output in case of
(1) an untracked subdirectory with multiple files where at least one of them
cannot be removed.
(2) reporting ignored untracked git subdirectories
Suppose we have a repo like the one below:
test.git/
|-- tracked_file
|-- untracked_file
|-- untracked_foo/
| |-- bar/
| | |-- bar.txt
| |-- emptydir/
| |-- frotz.git/
| | |-- frotx.txt
| |-- quux/
| |-- failedquux.txt
| |-- quux.txt
|-- untracked_unreadable_dir/
| |-- afile
|-- untracked_some.git/
|-- some.txt
$ git clean -fd
Removing untracked_file
Removing untracked_foo/bar
Removing untracked_foo/emptydir
Removing untracked_foo/quux/quux.txt
warning: failed to remove untracked_foo/quux/failedquux.txt
warning: failed to remove remove untracked_unreadable_dir/
warning: ignoring untracked git repository untracked_foo/frotz.git/
warning: ignoring untracked git repository untracked_some.git/
Use git clean --force --force to delete all untracked git repositories
$ # use forced remove
$ git clean --force --force -d
Removing untracked_foo/frotz.git
Removing untracked_foo/quux/quux.txt
Removing untracked_some.git/
warning: failed to remove untracked_foo/quux/failedquux.txt
warning: failed to remove untracked_unreadable_dir/
Can you see any issues with the proposed output, wording above? If
everyone is happy,
I'm going to prepare patch V2 for it.
Thanks,
Zoltan
Hi Zoltan,
On Sun, Dec 09, 2012 at 10:18:19PM +1100, Zoltan Klinger wrote:
quoted
quoted
Hrm, following your discussion (ellided above), I would have
expected that you would show
Removing directory foo/bar
Removing untracked_file1
Also it would be nice to have warnings about undeleted directories since this git
clean behavior (or the work around to pass -f twice) is not documented.
Without a warning you would probably miss that something was _not_ deleted.
Thanks for the feedback. I think you're right. Showing 'foo/bar/bar.txt' in
the list when 'foo/bar/' directory has been successfully deleted is just noise.
Would like to get some more feedback on the proposed output in case of
(1) an untracked subdirectory with multiple files where at least one of them
cannot be removed.
(2) reporting ignored untracked git subdirectories
Suppose we have a repo like the one below:
test.git/
|-- tracked_file
|-- untracked_file
|-- untracked_foo/
| |-- bar/
| | |-- bar.txt
| |-- emptydir/
| |-- frotz.git/
| | |-- frotx.txt
| |-- quux/
| |-- failedquux.txt
| |-- quux.txt
|-- untracked_unreadable_dir/
| |-- afile
|-- untracked_some.git/
|-- some.txt
$ git clean -fd
Removing untracked_file
Removing untracked_foo/bar
Removing untracked_foo/emptydir
Removing untracked_foo/quux/quux.txt
warning: failed to remove untracked_foo/quux/failedquux.txt
warning: failed to remove remove untracked_unreadable_dir/
warning: ignoring untracked git repository untracked_foo/frotz.git/
warning: ignoring untracked git repository untracked_some.git/
Use git clean --force --force to delete all untracked git repositories
$ # use forced remove
$ git clean --force --force -d
Removing untracked_foo/frotz.git
Removing untracked_foo/quux/quux.txt
Removing untracked_some.git/
warning: failed to remove untracked_foo/quux/failedquux.txt
warning: failed to remove untracked_unreadable_dir/
Can you see any issues with the proposed output, wording above? If
everyone is happy,
I'm going to prepare patch V2 for it.