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

Re: [PATCH 0/1] Allow the 'revert' option in Git Gui to operate on untracked files, deleting them

From
Jonathan Gilbert <logic@deltaq.org>
Date
Oct 29, 2019, 01:45 UTC
Message-ID
<CAPSOpYu4pHymWpSrph41JsbR00dvpFUVrSPAx3S+RqRUi8t+ig@mail.gmail.com>
In-Reply-To
<20191029001253.2lxsntgcivs2jhax@camp.crustytoothpaste.net>
> Is there a reason these new files can't be ignored, with one of the.gitignore file, .git/info/exclude, or core.excludesFile?

I guess it's implied in the way I worded the message, but I have fallen into the habit of using Git-Gui to manage the state of the working copy (at least in detail). I am primarily doing .NET development, for which projects can have a file App.config that stores various settings that apply to the project at runtime. The NuGet package manager sometimes edits App.config on your behalf as part of installing a package, and if a project doesn't already have an App.config file, it adds one. It has also updated a packages.config file and the main project file. If I decide that I actually don't want the change after all, Git-Gui permits me to revert the packages.config change and revert the project file change. If an existing App.config file was edited, I can revert that too, but if it was newly-generated, then I want to delete that file, but I don't want to ignore App.config files going forward, because there's a good chance a future change may introduce a different need for an App.config file.

With the current Git-Gui version, I need to exit the Git-Gui UI/flow, navigate to the project in a console window (which probably isn't already in the correct folder) and manually delete the unwanted file. This deletion requires me to identify the file explicitly as well. With the proposed change, the untracked file, which Git-Gui already lists, can be selected, and then activating the "revert" function performs a UI flow for deleting the file. Without these changes, Git-Gui simply does nothing at all when you tell it to revert an untracked file.

Another example is when I go to review changes and discover a VIM crash dump or a spurious temporary file from a code analyzer, files that aren't _expected_ to normally come into existence at all. While we could try to anticipate every type of spurious file and .gitignore them all, I prefer to simply delete the files, and for similar reasons as before, navigating a separate tool to the correct folder to perform the deletion is a manual, time-consuming and context-switching process. This is what led me to want this feature directly from the Git-Gui tool, which is what identifies the rogue file to me in the first place.

If you can think of a concise way to say that, I'll be happy to add it to the commit message. My intuition is that that's too wordy as-written, but if that intuition is wrong, I can copy/paste this text too. :-)

Thanks,
Jonathan Gilbert

On Mon, Oct 28, 2019 at 7:12 PM brian m. carlson sandals-at-crustytoothpaste.net |GitHub Public/Example Allow| <92ue75mvem3o2ht@sneakemail.com> wrote:

Show 16 quoted lines
>
> On 2019-10-28 at 18:58:06, Jonathan Gilbert via GitGitGadget wrote:
> > My development environment sometimes makes automatic changes that I don't
> > want to keep. In some cases, this involves new files being added that I
> > don't want to commit or keep. I have typically had to explicitly delete
> > those files externally to Git Gui, and I want to be able to just select
> > those newly-created untracked files and "revert" them into oblivion.
>
> Is there a reason these new files can't be ignored, with one of the
> .gitignore file, .git/info/exclude, or core.excludesFile?
>
> If so, it would be helpful to explain that in the commit message so we
> can more fully understand the rationale here.
> --
> brian m. carlson: Houston, Texas, US
> OpenPGP: https://keybase.io/bk2204
Previous: brian m. carlsonNext: Bert Wesarg
Message 6 of 10 in “Allow the 'revert' option in Git Gui to operate on untracked files, deleting them”
  1. 0/1 Allow the 'revert' option in Git Gui to operate on untracked files, deleting themJonathan Gilbert via GitGitGadget, Oct 28, 2019
  2. 1/1 git-gui: Revert untracked files by deleting themJonathan Gilbert via GitGitGadget, Oct 28, 2019
  3. Pratyush YadavOct 29, 2019
  4. Jonathan GilbertOct 29, 2019
  5. brian m. carlsonOct 29, 2019
  6. Jonathan GilbertOct 29, 2019
  7. Bert WesargOct 29, 2019
  8. Jonathan GilbertOct 29, 2019
  9. Jonathan GilbertOct 29, 2019
  10. Pratyush YadavOct 29, 2019

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.