git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zoltan Klinger <zoltan.klinger@gmail.com>
To: Soren Brinkmann <soren.brinkmann@xilinx.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-clean: Display more accurate delete messages
Date: Sun, 9 Dec 2012 22:18:19 +1100	[thread overview]
Message-ID: <CAKJhZwROXsTa4wu-C9rhfGysetL+cZRDECyFUn5VTb833pWzMQ@mail.gmail.com> (raw)
In-Reply-To: <7d290bdc-8654-4526-ba73-89408fa99a16@DB3EHSMHS002.ehs.local>

>> 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

  reply	other threads:[~2012-12-09 11:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 10:15 [PATCH] git-clean: Display more accurate delete messages Zoltan Klinger
2012-12-06 17:37 ` Junio C Hamano
2012-12-07  0:15   ` Soren Brinkmann
2012-12-09 11:18     ` Zoltan Klinger [this message]
2012-12-10  7:04       ` Junio C Hamano
2012-12-10 17:33         ` Soren Brinkmann
2012-12-10 18:03           ` Junio C Hamano
2012-12-10 18:16             ` Soren Brinkmann
2012-12-10 18:53               ` Junio C Hamano
2012-12-11 12:32         ` Zoltan Klinger
2012-12-10 17:04       ` Soren Brinkmann

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=CAKJhZwROXsTa4wu-C9rhfGysetL+cZRDECyFUn5VTb833pWzMQ@mail.gmail.com \
    --to=zoltan.klinger@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=soren.brinkmann@xilinx.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).