From: Junio C Hamano <gitster@pobox.com>
To: Shawn Bohrer <shawn.bohrer@gmail.com>
Cc: git@vger.kernel.org, johannes.schindelin@gmx.de
Subject: Re: [PATCH] Make git-clean a builtin
Date: Wed, 07 Nov 2007 12:42:16 -0800 [thread overview]
Message-ID: <7vabppbxef.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 11944127311587-git-send-email-shawn.bohrer@gmail.com
Shawn Bohrer <shawn.bohrer@gmail.com> writes:
> This replaces git-clean.sh with builtin-clean.c, and moves
> git-clean.sh to the examples.
>
> This also introduces a change in behavior where the -d parameter is
> required to remove an entire directory of untracked files even when
> the directory is passed as a path.
The updated behaviour may be better, but this description at the
first read makes one wonder if it is describing a regression as
if it is a feature.
> ... For example ...
> ...
> if 'dir' only contains untracked files. This is consistent with the
> old behavior when two or more paths were specified.
I think what you fixed are two inconsistencies in the original
implementation. If you spelled out the existing inconsistency
and described what your implementation does differently, the
proposal would start looking like a real improvement, like this:
1. When dir has only untracked files, these two behave differently:
$ git clean -n dir
$ git clean -n dir/
the former says "Would not remove dir/", while the latter would
say "Would remove dir/untracked" for all paths under it.
With -d, the former would stop refusing, but the difference in
reporting is still there. The latter lists all paths under the
directory.
2. When there are more parameters, the latter behave differently:
$ git clean -n dir/ foo
refuses to remove dir/. This is inconsistent.
My reimplementation changes the behaviour by always
requiring the -d option with or without the trailing slash.
Having said that, I do not particularly agree with the way the
new implementation resolves the existing inconsistencies.
Wouldn't it be better to remove "dir" when the user explicitly
told you to clean "dir", with or without the trailing slash?
That's what the user asked you to do, isn't it?
next prev parent reply other threads:[~2007-11-07 20:42 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-07 5:18 [PATCH] Make git-clean a builtin Shawn Bohrer
2007-11-07 11:10 ` Johannes Schindelin
2007-11-07 13:29 ` Bill Lear
2007-11-07 14:17 ` Johannes Schindelin
2007-11-07 14:45 ` Matthieu Moy
2007-11-07 19:46 ` Jon Loeliger
2007-11-10 22:43 ` Miles Bader
2007-11-07 14:54 ` Shawn Bohrer
2007-11-07 15:04 ` Johannes Schindelin
2007-11-07 20:51 ` Brian Downing
2007-11-07 21:49 ` Junio C Hamano
2007-11-07 20:42 ` Junio C Hamano [this message]
2007-11-08 5:37 ` Shawn Bohrer
-- strict thread matches above, loose matches on Subject: below --
2007-11-12 1:48 Shawn Bohrer
2007-11-04 19:02 [RFC] Second attempt at making " Shawn Bohrer
2007-11-04 19:02 ` [PATCH] Add more tests for git-clean Shawn Bohrer
2007-11-04 19:02 ` [PATCH] Make git-clean a builtin Shawn Bohrer
2007-11-04 19:41 ` Pierre Habouzit
2007-11-05 21:14 ` Junio C Hamano
2007-11-05 22:10 ` Carlos Rica
2007-11-05 23:54 ` Junio C Hamano
2007-11-06 5:05 ` Shawn Bohrer
2007-11-06 5:30 ` Junio C Hamano
2007-10-07 23:57 Shawn Bohrer
2007-10-08 3:57 ` Johannes Schindelin
2007-10-07 1:17 Shawn Bohrer
2007-10-07 1:31 ` Linus Torvalds
2007-10-07 15:41 ` Shawn Bohrer
2007-10-07 16:42 ` rae l
2007-10-07 16:38 ` Johannes Schindelin
2007-10-06 20:54 Shawn Bohrer
2007-10-06 21:52 ` Frank Lichtenheld
2007-10-07 1:13 ` Shawn Bohrer
2007-10-08 2:04 ` Jeff King
2007-10-08 2:08 ` Jeff King
2007-10-08 2:17 ` Linus Torvalds
2007-10-08 2:22 ` Jeff King
2007-10-08 6:37 ` Johannes Sixt
2007-10-08 18:27 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vabppbxef.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=shawn.bohrer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).