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

Re: [PATCH] .gitignore: Ignore editor backup and swap files

From
David Kastrup <dak@gnu.org>
Date
Jan 17, 2014, 04:48 UTC
Message-ID
<87fvonz008.fsf@fencepost.gnu.org>
In-Reply-To
<xmqqtxd3y43b.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 26 quoted lines
> Alexander Berntsen <alexander@plaimi.net> writes:
>
>> Signed-off-by: Alexander Berntsen <alexander@plaimi.net>
>> ---
>>  .gitignore | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/.gitignore b/.gitignore
>> index b5f9def..2905c21 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -240,3 +240,5 @@
>>  *.pdb
>>  /Debug/
>>  /Release/
>> +*~
>> +.*.swp
>
> I personally do not mind listing these common ones too much, but if
> I am not mistaken, our policy on this file so far has been that it
> lists build artifacts, and not personal preference (the *.swp entry
> is useless for those who never use vim, for example).
>
> These paths that depend on your choice of the editor and other tools
> can still be managed in your personal .git/info/exclude in the
> meantime.

Here is a somewhat related question: if one places a file .dir-locals.el in the top directory of the checkout with the contents:

;;; Directory Local Variables ;;; See Info node `(emacs) Directory Variables' for more information.

((c-mode
  (c-default-style . "linux")
  (indent-tabs-mode . t)))

Then all edits in the whole checkout done with Emacs in C files use the right indentation style. Obviously, that's a "personal preference" setting in that it is useless for those who never use Emacs (the file can be written/edited using M-x add-dir-local-variable RET). It's still providing significant convenience for a number of users while touching only a single file.

-- 
David Kastrup
Previous: Ramsay Jones
Message 7 of 7 in “.gitignore: Ignore editor backup and swap files”
  1. .gitignore: Ignore editor backup and swap filesAlexander Berntsen, Jan 16, 2014
  2. Junio C HamanoJan 16, 2014
  3. Alexander BerntsenJan 16, 2014
  4. Jonathan NiederJan 16, 2014
  5. Duy NguyenJan 17, 2014
  6. Ramsay JonesJan 16, 2014
  7. David KastrupJan 17, 2014

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.