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

Re: [PATCH v5 0/3] interactive git clean

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 6, 2013, 09:40 UTC
Message-ID
<CAPig+cTSER2ngpGoM-3pwPO3dAnqq+9qCHdVb1YbLg9UgkPF0g@mail.gmail.com>
In-Reply-To
<vpqli7s8rqp.fsf@grenoble-inp.fr>
Hi Matthieu,

On Mon, May 6, 2013 at 3:58 AM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:

Show 8 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> The pattern [y] will match file named 'y'. It probably is unusual for
>> files named 'y', 'n', etc. to exist in the top-level directory, but
>> the gitignore patterns already provide an escape hatch for these
>> unusual cases.
>
> But how does the user know that?

Documentation. Junio also mentioned having a '?' in each prompt explaining the options at that point.

Show 5 quoted lines
> I'd rather stay away from dwim that works in 99% of cases but do
> something dangerous in the 1% remaining, and complex un-guessable escape
> scheme to solve these few cases. The two stages (yes/no/edit, and then
> escape patterns) is clear, and does not require so many additional
> keystrokes.

The scheme doesn't have to be unsafe. git-clean *knows* which files are up for deletion. If one of those filenames conflicts with one of the prompt options, --interactive mode can warn about the ambiguity at the point the user types that particular ambiguous response, and ask for clarification ("did you mean 'yes, delete everything' or 'exclude filename y'?"). You get DWIM for 99.9% of the cases, and an extra prompt for the other 0.1%. Nothing unsafe. Is such an implementation more complicated or ugly than the separate 'edit' mode? Is the user experience better or worse (more or less convenient)? Is it easier or harder to document and explain?

Another observation which came to mind after my original email:

Would it make sense for --interactive mode to launch an editor with the list of files scheduled for deletion and allow the user to remove lines he does not want deleted (similar to "git-rebase --interactive"). Depending upon case, this could be more or less convenient than the proposed gitignore-patterned 'edit' mode. It could be yet another option in the yes/no/prompt/edit menu or it could be the default and only behavior of "git-clean --interactive" (again similar to "git-rebase --interactive).

I'm not advocating any particular user interface. The observations and questions about convenience and user experience both here and in my original email were made with the hope of promoting discussion before the interface gets locked in. How clunky or fluid should it be? How verbose or terse?

-- ES
Previous: Matthieu MoyNext: Jiang Xin
Message 9 of 22 in “interactive git clean”
  1. 0/3 interactive git cleanJiang Xin, May 3, 2013
  2. 1/3 Add support for -i/--interactive to git-cleanJiang Xin, May 3, 2013
  3. 2/3 Show items of interactive git-clean in columnsJiang Xin, May 3, 2013
  4. 3/3 Add colors to interactive git-cleanJiang Xin, May 3, 2013
  5. Eric SunshineMay 3, 2013
  6. Jiang XinMay 4, 2013
  7. Eric SunshineMay 5, 2013
  8. Matthieu MoyMay 6, 2013
  9. Eric SunshineMay 6, 2013
  10. 0/7 interactive git cleanJiang Xin, May 6, 2013
  11. 1/7 Add support for -i/--interactive to git-cleanJiang Xin, May 6, 2013
  12. 2/7 Show items of interactive git-clean in columnsJiang Xin, May 6, 2013
  13. 3/7 Add colors to interactive git-cleanJiang Xin, May 6, 2013
  14. 4/7 git-clean: use a git-add-interactive compatible UIJiang Xin, May 6, 2013
  15. 5/7 git-clean: interactive cleaning by select numbersJiang Xin, May 6, 2013
  16. 6/7 git-clean: rm -i style interactive cleaningJiang Xin, May 6, 2013
  17. 7/7 git-clean: update document for interactive git-cleanJiang Xin, May 6, 2013
  18. Jiang XinMay 7, 2013
  19. Jiang XinMay 7, 2013
  20. Junio C HamanoMay 7, 2013
  21. Jiang XinMay 8, 2013
  22. Junio C HamanoMay 3, 2013

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.