All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] .gitignore: Ignore editor backup and swap files
@ 2014-01-16 21:19 Alexander Berntsen
  2014-01-16 22:06 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Berntsen @ 2014-01-16 21:19 UTC (permalink / raw)
  To: git; +Cc: alexander

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 21:19 [PATCH] .gitignore: Ignore editor backup and swap files Alexander Berntsen
@ 2014-01-16 22:06 ` Junio C Hamano
  2014-01-16 22:15   ` Alexander Berntsen
                     ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Junio C Hamano @ 2014-01-16 22:06 UTC (permalink / raw)
  To: Alexander Berntsen; +Cc: git

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 22:06 ` Junio C Hamano
@ 2014-01-16 22:15   ` Alexander Berntsen
  2014-01-16 22:43   ` Jonathan Nieder
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Alexander Berntsen @ 2014-01-16 22:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 16/01/14 23:06, Junio C Hamano wrote:
> 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).
I don't see any downside to having this in .gitignore. However, not
including it doesn't significantly impede my workflow either. I will
not argue ferociously for this patch's inclusion. :-)

- -- 
Alexander
alexander@plaimi.net
http://plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlLYWh8ACgkQRtClrXBQc7X7WAD9GTUId4ipGdL334Oo6Yn9duSA
qixEG95nJ2FsGz5/KNsA/icUkn2BYZRCHevsnYyUFkinOiApckkqpMOTAk5Wsd4D
=7Fvb
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 22:06 ` Junio C Hamano
  2014-01-16 22:15   ` Alexander Berntsen
@ 2014-01-16 22:43   ` Jonathan Nieder
  2014-01-17  6:20     ` Duy Nguyen
  2014-01-16 22:56   ` Ramsay Jones
  2014-01-17  4:48   ` David Kastrup
  3 siblings, 1 reply; 7+ messages in thread
From: Jonathan Nieder @ 2014-01-16 22:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Alexander Berntsen, git

Junio C Hamano wrote:

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

Or $HOME/.config/git/ignore to not have to make the same setting
in every repository. :)

Maybe it would make sense to add a hint about that somewhere to
user-manual.txt.  Even better would be to automatically include some
common exclude patterns globally without requiring any manual
configuration, but that would take some care to make sure the patterns
and how to disable them are documented clearly.

-- >8 --
Subject: gitignore doc: add global gitignore to synopsis

The gitignore(5) manpage already documents $XDG_CONFIG_HOME/git/ignore
but it is easy to forget that it exists.  Add a reminder to the
synopsis.

Noticed while looking for a place to put a list of scratch filenames
in the cwd used by one's editor of choice.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Documentation/gitignore.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt
index f971960..37c9470 100644
--- a/Documentation/gitignore.txt
+++ b/Documentation/gitignore.txt
@@ -7,7 +7,7 @@ gitignore - Specifies intentionally untracked files to ignore
 
 SYNOPSIS
 --------
-$GIT_DIR/info/exclude, .gitignore
+$HOME/.config/git/ignore, $GIT_DIR/info/exclude, .gitignore
 
 DESCRIPTION
 -----------
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 22:06 ` Junio C Hamano
  2014-01-16 22:15   ` Alexander Berntsen
  2014-01-16 22:43   ` Jonathan Nieder
@ 2014-01-16 22:56   ` Ramsay Jones
  2014-01-17  4:48   ` David Kastrup
  3 siblings, 0 replies; 7+ messages in thread
From: Ramsay Jones @ 2014-01-16 22:56 UTC (permalink / raw)
  To: Junio C Hamano, Alexander Berntsen; +Cc: git

On 16/01/14 22:06, Junio C Hamano wrote:
> 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.

As a vim user, I have these set in my ~/.gitignore file, which I refer
to from ~/.gitconfig using core.excludesfile. ;-)


ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 22:06 ` Junio C Hamano
                     ` (2 preceding siblings ...)
  2014-01-16 22:56   ` Ramsay Jones
@ 2014-01-17  4:48   ` David Kastrup
  3 siblings, 0 replies; 7+ messages in thread
From: David Kastrup @ 2014-01-17  4:48 UTC (permalink / raw)
  To: git

Junio C Hamano <gitster@pobox.com> writes:

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] .gitignore: Ignore editor backup and swap files
  2014-01-16 22:43   ` Jonathan Nieder
@ 2014-01-17  6:20     ` Duy Nguyen
  0 siblings, 0 replies; 7+ messages in thread
From: Duy Nguyen @ 2014-01-17  6:20 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, Alexander Berntsen, Git Mailing List

On Fri, Jan 17, 2014 at 5:43 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Subject: gitignore doc: add global gitignore to synopsis
>
> The gitignore(5) manpage already documents $XDG_CONFIG_HOME/git/ignore
> but it is easy to forget that it exists.  Add a reminder to the
> synopsis.

Yes! I knew about the xdg thing but was not aware about
$xdg/git/ignore. No more updating .git/info/exclude on every newly
cloned repo..
-- 
Duy

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-17  6:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 21:19 [PATCH] .gitignore: Ignore editor backup and swap files Alexander Berntsen
2014-01-16 22:06 ` Junio C Hamano
2014-01-16 22:15   ` Alexander Berntsen
2014-01-16 22:43   ` Jonathan Nieder
2014-01-17  6:20     ` Duy Nguyen
2014-01-16 22:56   ` Ramsay Jones
2014-01-17  4:48   ` David Kastrup

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.