threads / discuss / 15577

A couple of TopGit tweaks

Subject: A couple of TopGit tweaks

## tl;dr

22 messages between Sep 18, 2008 and Sep 19, 2008.

replies: 21people: 8as markdown or json

Kirill Smelkov· Sep 18, 2008, 16:29 UTC · re: Kirill Smelkov · lore

[TopGit PATCH] .gitignore += vim swap files

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
---
 .gitignore |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 8868f2d..aa39db4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,5 @@ tg-import.txt
 tg-remote
 tg-remote.txt
 tg
+
+*.swp
-- 
1.6.0.2.250.g965aa
martin f krafft· Sep 18, 2008, 17:24 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

also sprach Kirill Smelkov <kirr@landau.phys.spbu.ru> [2008.09.18.1729 +0100]:
> +
> +*.swp
This should be .*.sw?
-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"and no one sings me lullabies,
 and no one makes me close my eyes,
 and so i throw the windows wide,
 and call to you across the sky"
                                                   -- pink floyd, 1971
 
spamtraps: madduck.bogus@madduck.net
Kirill Smelkov· Sep 18, 2008, 17:30 UTC · re: martin f krafft · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 06:24:18PM +0100, martin f krafft wrote:
Show 5 quoted lines
> also sprach Kirill Smelkov <kirr@landau.phys.spbu.ru> [2008.09.18.1729 +0100]:
> > +
> > +*.swp
> 
> This should be .*.sw?
Right.
Should I resend the patch or will Petr correct it when applying?
-- 
    Всего хорошего, Кирилл.
Bert Wesarg· Sep 18, 2008, 17:38 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
Show 15 quoted lines
> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> ---
>  .gitignore |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index 8868f2d..aa39db4 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -18,3 +18,5 @@ tg-import.txt
>  tg-remote
>  tg-remote.txt
>  tg
> +
> +*.swp
can't you do this in your .git/info/excludes?
bert
Show 8 quoted lines
> --
> 1.6.0.2.250.g965aa
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Kirill Smelkov· Sep 18, 2008, 17:43 UTC · re: Bert Wesarg · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 07:38:58PM +0200, Bert Wesarg wrote:
Show 19 quoted lines
> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> > ---
> >  .gitignore |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/.gitignore b/.gitignore
> > index 8868f2d..aa39db4 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -18,3 +18,5 @@ tg-import.txt
> >  tg-remote
> >  tg-remote.txt
> >  tg
> > +
> > +*.swp
> can't you do this in your .git/info/excludes?
> 
> bert

I sure can, but I think the question is what is the most convenient, and for me it is convenient to start hacking right on fresh topgit clone.

Also, if you'll look e.g. here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=.gitignore;h=869e1a3b64b6bf969eeced820691e955e03e3068;hb=HEAD#l65

It seems emacs is supported in Linux kernel, so I'm slowly restoring the balance in favour of vim :)

-- 
    Всего хорошего, Кирилл.
Bert Wesarg· Sep 18, 2008, 17:56 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 19:43, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
Show 31 quoted lines
> On Thu, Sep 18, 2008 at 07:38:58PM +0200, Bert Wesarg wrote:
>> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>> > ---
>> >  .gitignore |    2 ++
>> >  1 files changed, 2 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/.gitignore b/.gitignore
>> > index 8868f2d..aa39db4 100644
>> > --- a/.gitignore
>> > +++ b/.gitignore
>> > @@ -18,3 +18,5 @@ tg-import.txt
>> >  tg-remote
>> >  tg-remote.txt
>> >  tg
>> > +
>> > +*.swp
>> can't you do this in your .git/info/excludes?
>>
>> bert
>
> I sure can, but I think the question is what is the most convenient, and
> for me it is convenient to start hacking right on fresh topgit clone.
>
>
> Also, if you'll look e.g. here:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=.gitignore;h=869e1a3b64b6bf969eeced820691e955e03e3068;hb=HEAD#l65
>
> It seems emacs is supported in Linux kernel, so I'm slowly restoring the
> balance in favour of vim :)
than I want a pattern for NEdit too:
~*
Bert
>
> --
>    Всего хорошего, Кирилл.
>
Kirill Smelkov· Sep 18, 2008, 17:50 UTC · re: Bert Wesarg · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 07:56:40PM +0200, Bert Wesarg wrote:
Show 35 quoted lines
> On Thu, Sep 18, 2008 at 19:43, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > On Thu, Sep 18, 2008 at 07:38:58PM +0200, Bert Wesarg wrote:
> >> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> >> > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> >> > ---
> >> >  .gitignore |    2 ++
> >> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >> >
> >> > diff --git a/.gitignore b/.gitignore
> >> > index 8868f2d..aa39db4 100644
> >> > --- a/.gitignore
> >> > +++ b/.gitignore
> >> > @@ -18,3 +18,5 @@ tg-import.txt
> >> >  tg-remote
> >> >  tg-remote.txt
> >> >  tg
> >> > +
> >> > +*.swp
> >> can't you do this in your .git/info/excludes?
> >>
> >> bert
> >
> > I sure can, but I think the question is what is the most convenient, and
> > for me it is convenient to start hacking right on fresh topgit clone.
> >
> >
> > Also, if you'll look e.g. here:
> >
> > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=.gitignore;h=869e1a3b64b6bf969eeced820691e955e03e3068;hb=HEAD#l65
> >
> > It seems emacs is supported in Linux kernel, so I'm slowly restoring the
> > balance in favour of vim :)
> than I want a pattern for NEdit too:
> 
> ~*
I'm not against :)
-- 
    Всего хорошего, Кирилл.
martin f krafft· Sep 18, 2008, 17:54 UTC · re: Bert Wesarg · lore

Re: [TopGit PATCH] .gitignore += vim swap files

also sprach Bert Wesarg <bert.wesarg@googlemail.com> [2008.09.18.1838 +0100]:
> can't you do this in your .git/info/excludes?

Of course, but then I'd have to do it too, and on all machines where I have a topgit clone.

martin, who'd love to see '/*-stamp' added to the .gitignore file too to hide the temporary files created during the Debian build; mdadm recently added it. :)

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"in diving to the bottom of pleasure
 we bring up more gravel than pearls."
                                                   -- honoré de balzac
 
spamtraps: madduck.bogus@madduck.net
Daniel Barkalow· Sep 18, 2008, 19:30 UTC · re: Bert Wesarg · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, 18 Sep 2008, Bert Wesarg wrote:
Show 17 quoted lines
> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> > ---
> >  .gitignore |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/.gitignore b/.gitignore
> > index 8868f2d..aa39db4 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -18,3 +18,5 @@ tg-import.txt
> >  tg-remote
> >  tg-remote.txt
> >  tg
> > +
> > +*.swp
> can't you do this in your .git/info/excludes?

It's generally better to put a core.excludesfile entry in your ~/.gitconfig pointing to a ignore file with editor temporaries for the editor(s) you personally use. This will then apply to all git projects you work on.

	-Daniel
*This .sig left intentionally blank*
Kirill Smelkov· Sep 19, 2008, 05:06 UTC · re: Daniel Barkalow · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
Show 24 quoted lines
> On Thu, 18 Sep 2008, Bert Wesarg wrote:
> 
> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> > > ---
> > >  .gitignore |    2 ++
> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/.gitignore b/.gitignore
> > > index 8868f2d..aa39db4 100644
> > > --- a/.gitignore
> > > +++ b/.gitignore
> > > @@ -18,3 +18,5 @@ tg-import.txt
> > >  tg-remote
> > >  tg-remote.txt
> > >  tg
> > > +
> > > +*.swp
> > can't you do this in your .git/info/excludes?
> 
> It's generally better to put a core.excludesfile entry in your 
> ~/.gitconfig pointing to a ignore file with editor temporaries for the 
> editor(s) you personally use. This will then apply to all git projects you 
> work on.
Yes, this makes sense, thanks.
I've had to add the following to my ~/.gitconfig
[core]
    excludesfile= /home/kirr/.gitignore-kirr
because it does not work when '~' is used for $HOME
[core]
    excludesfile= ~/.gitignore-kirr # does not work
Is it intended?

Still I think since a lot of people have to do the same operation, maybe it makes sense to put ignores for popular tools right into project's .gitignore.

-- 
    Всего хорошего, Кирилл.
Bert Wesarg· Sep 19, 2008, 07:10 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
Show 38 quoted lines
> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>
>> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>> > > ---
>> > >  .gitignore |    2 ++
>> > >  1 files changed, 2 insertions(+), 0 deletions(-)
>> > >
>> > > diff --git a/.gitignore b/.gitignore
>> > > index 8868f2d..aa39db4 100644
>> > > --- a/.gitignore
>> > > +++ b/.gitignore
>> > > @@ -18,3 +18,5 @@ tg-import.txt
>> > >  tg-remote
>> > >  tg-remote.txt
>> > >  tg
>> > > +
>> > > +*.swp
>> > can't you do this in your .git/info/excludes?
>>
>> It's generally better to put a core.excludesfile entry in your
>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>> editor(s) you personally use. This will then apply to all git projects you
>> work on.
>
> Yes, this makes sense, thanks.
>
> I've had to add the following to my ~/.gitconfig
>
> [core]
>    excludesfile= /home/kirr/.gitignore-kirr
>
>
> because it does not work when '~' is used for $HOME
>
> [core]
>    excludesfile= ~/.gitignore-kirr # does not work
Have you tried:
  [core]
     excludesfile = .gitignore-kirr
There was a discussion about relative files in config. but I didn't tried this.
Anyway, I think this is the best solution. Don't globber the repos with this.
Bert
Kirill Smelkov· Sep 19, 2008, 07:28 UTC · re: Bert Wesarg · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
Show 44 quoted lines
> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
> >> On Thu, 18 Sep 2008, Bert Wesarg wrote:
> >>
> >> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> >> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
> >> > > ---
> >> > >  .gitignore |    2 ++
> >> > >  1 files changed, 2 insertions(+), 0 deletions(-)
> >> > >
> >> > > diff --git a/.gitignore b/.gitignore
> >> > > index 8868f2d..aa39db4 100644
> >> > > --- a/.gitignore
> >> > > +++ b/.gitignore
> >> > > @@ -18,3 +18,5 @@ tg-import.txt
> >> > >  tg-remote
> >> > >  tg-remote.txt
> >> > >  tg
> >> > > +
> >> > > +*.swp
> >> > can't you do this in your .git/info/excludes?
> >>
> >> It's generally better to put a core.excludesfile entry in your
> >> ~/.gitconfig pointing to a ignore file with editor temporaries for the
> >> editor(s) you personally use. This will then apply to all git projects you
> >> work on.
> >
> > Yes, this makes sense, thanks.
> >
> > I've had to add the following to my ~/.gitconfig
> >
> > [core]
> >    excludesfile= /home/kirr/.gitignore-kirr
> >
> >
> > because it does not work when '~' is used for $HOME
> >
> > [core]
> >    excludesfile= ~/.gitignore-kirr # does not work
> Have you tried:
> 
>   [core]
>      excludesfile = .gitignore-kirr
> There was a discussion about relative files in config. but I didn't tried this.

It does not work for me -- it picks ./.gitignore-kirr instead of ~/.gitignore-kirr

> Anyway, I think this is the best solution. Don't globber the repos with this.
Don't you care more about machines than humans? :)

I think when we work on a tree, all the autogenerated files should be ignored. This includes *.o and friends for sure, but since we also use editors, and most people use same editors it makes sense to tune repo to be ready to hack on with common setups.

And I think this
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf
just justifies my words.
-- 
    Всего хорошего, Кирилл.
Andreas Ericsson· Sep 19, 2008, 07:51 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

Kirill Smelkov wrote:
Show 56 quoted lines
> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>>>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>>>
>>>>> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>>>> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>>>>>> ---
>>>>>>  .gitignore |    2 ++
>>>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>>>
>>>>>> diff --git a/.gitignore b/.gitignore
>>>>>> index 8868f2d..aa39db4 100644
>>>>>> --- a/.gitignore
>>>>>> +++ b/.gitignore
>>>>>> @@ -18,3 +18,5 @@ tg-import.txt
>>>>>>  tg-remote
>>>>>>  tg-remote.txt
>>>>>>  tg
>>>>>> +
>>>>>> +*.swp
>>>>> can't you do this in your .git/info/excludes?
>>>> It's generally better to put a core.excludesfile entry in your
>>>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>>>> editor(s) you personally use. This will then apply to all git projects you
>>>> work on.
>>> Yes, this makes sense, thanks.
>>>
>>> I've had to add the following to my ~/.gitconfig
>>>
>>> [core]
>>>    excludesfile= /home/kirr/.gitignore-kirr
>>>
>>>
>>> because it does not work when '~' is used for $HOME
>>>
>>> [core]
>>>    excludesfile= ~/.gitignore-kirr # does not work
>> Have you tried:
>>
>>   [core]
>>      excludesfile = .gitignore-kirr
>> There was a discussion about relative files in config. but I didn't tried this.
> 
> It does not work for me -- it picks ./.gitignore-kirr instead of
> ~/.gitignore-kirr
> 
>> Anyway, I think this is the best solution. Don't globber the repos with this.
> 
> Don't you care more about machines than humans? :)
> 
> I think when we work on a tree, all the autogenerated files should be
> ignored. This includes *.o and friends for sure, but since we also use
> editors, and most people use same editors it makes sense to tune repo to
> be ready to hack on with common setups.
> 

Most people do not use same editors. In our office there's 8 programmers and 6 editors in use (geany, jed, vim, nedit, zend studio, kate).

Show 6 quoted lines
> And I think this
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf
> 
> just justifies my words.
> 

If topgit had 4374 contributors since 10 minor versions back, I'd be more inclined to agree with you. Even so, you'll have to accept that this patch gets dropped[1] and stop trying to argue for it after it's already been discussed (at length).

[1] I'm not too sure who the topgit maintainer actually is, but the majority seem to be against this patch.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Kirill Smelkov· Sep 19, 2008, 07:52 UTC · re: Andreas Ericsson · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Fri, Sep 19, 2008 at 09:51:25AM +0200, Andreas Ericsson wrote:
Show 76 quoted lines
> Kirill Smelkov wrote:
>> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>>>>> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>>>>>
>>>>>> On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>>>>>>> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>>>>>>> ---
>>>>>>>  .gitignore |    2 ++
>>>>>>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>>>>>>
>>>>>>> diff --git a/.gitignore b/.gitignore
>>>>>>> index 8868f2d..aa39db4 100644
>>>>>>> --- a/.gitignore
>>>>>>> +++ b/.gitignore
>>>>>>> @@ -18,3 +18,5 @@ tg-import.txt
>>>>>>>  tg-remote
>>>>>>>  tg-remote.txt
>>>>>>>  tg
>>>>>>> +
>>>>>>> +*.swp
>>>>>> can't you do this in your .git/info/excludes?
>>>>> It's generally better to put a core.excludesfile entry in your
>>>>> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>>>>> editor(s) you personally use. This will then apply to all git projects you
>>>>> work on.
>>>> Yes, this makes sense, thanks.
>>>>
>>>> I've had to add the following to my ~/.gitconfig
>>>>
>>>> [core]
>>>>    excludesfile= /home/kirr/.gitignore-kirr
>>>>
>>>>
>>>> because it does not work when '~' is used for $HOME
>>>>
>>>> [core]
>>>>    excludesfile= ~/.gitignore-kirr # does not work
>>> Have you tried:
>>>
>>>   [core]
>>>      excludesfile = .gitignore-kirr
>>> There was a discussion about relative files in config. but I didn't tried this.
>>
>> It does not work for me -- it picks ./.gitignore-kirr instead of
>> ~/.gitignore-kirr
>>
>>> Anyway, I think this is the best solution. Don't globber the repos with this.
>>
>> Don't you care more about machines than humans? :)
>>
>> I think when we work on a tree, all the autogenerated files should be
>> ignored. This includes *.o and friends for sure, but since we also use
>> editors, and most people use same editors it makes sense to tune repo to
>> be ready to hack on with common setups.
>>
>
> Most people do not use same editors. In our office there's 8 programmers
> and 6 editors in use (geany, jed, vim, nedit, zend studio, kate).
>
>> And I think this
>>
>> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7088655477b51a5a248fa54190388e1283ba7ebf
>>
>> just justifies my words.
>>
>
> If topgit had 4374 contributors since 10 minor versions back, I'd be
> more inclined to agree with you. Even so, you'll have to accept that
> this patch gets dropped[1] and stop trying to argue for it after it's
> already been discussed (at length).
>
> [1]
> I'm not too sure who the topgit maintainer actually is, but the majority
> seem to be against this patch.
I'm ok with this patch being dropped.
-- 
    Всего хорошего, Кирилл.
Bert Wesarg· Sep 19, 2008, 10:50 UTC · re: Kirill Smelkov · lore

Re: [TopGit PATCH] .gitignore += vim swap files

On Fri, Sep 19, 2008 at 09:28, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
Show 48 quoted lines
> On Fri, Sep 19, 2008 at 09:10:24AM +0200, Bert Wesarg wrote:
>> On Fri, Sep 19, 2008 at 07:06, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> > On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
>> >> On Thu, 18 Sep 2008, Bert Wesarg wrote:
>> >>
>> >> > On Thu, Sep 18, 2008 at 18:29, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
>> >> > > Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
>> >> > > ---
>> >> > >  .gitignore |    2 ++
>> >> > >  1 files changed, 2 insertions(+), 0 deletions(-)
>> >> > >
>> >> > > diff --git a/.gitignore b/.gitignore
>> >> > > index 8868f2d..aa39db4 100644
>> >> > > --- a/.gitignore
>> >> > > +++ b/.gitignore
>> >> > > @@ -18,3 +18,5 @@ tg-import.txt
>> >> > >  tg-remote
>> >> > >  tg-remote.txt
>> >> > >  tg
>> >> > > +
>> >> > > +*.swp
>> >> > can't you do this in your .git/info/excludes?
>> >>
>> >> It's generally better to put a core.excludesfile entry in your
>> >> ~/.gitconfig pointing to a ignore file with editor temporaries for the
>> >> editor(s) you personally use. This will then apply to all git projects you
>> >> work on.
>> >
>> > Yes, this makes sense, thanks.
>> >
>> > I've had to add the following to my ~/.gitconfig
>> >
>> > [core]
>> >    excludesfile= /home/kirr/.gitignore-kirr
>> >
>> >
>> > because it does not work when '~' is used for $HOME
>> >
>> > [core]
>> >    excludesfile= ~/.gitignore-kirr # does not work
>> Have you tried:
>>
>>   [core]
>>      excludesfile = .gitignore-kirr
>> There was a discussion about relative files in config. but I didn't tried this.
>
> It does not work for me -- it picks ./.gitignore-kirr instead of
> ~/.gitignore-kirr
I found the thread with exactly this problem:
http://thread.gmane.org/gmane.comp.version-control.git/93250
Bert
Petr Baudis· Sep 19, 2008, 14:22 UTC · re: Kirill Smelkov · lore

Default exclude rules for Git

On Fri, Sep 19, 2008 at 09:06:12AM +0400, Kirill Smelkov wrote:
Show 26 quoted lines
> On Thu, Sep 18, 2008 at 03:30:35PM -0400, Daniel Barkalow wrote:
> > It's generally better to put a core.excludesfile entry in your 
> > ~/.gitconfig pointing to a ignore file with editor temporaries for the 
> > editor(s) you personally use. This will then apply to all git projects you 
> > work on.
> 
> Yes, this makes sense, thanks.
> 
> I've had to add the following to my ~/.gitconfig
> 
> [core]
>     excludesfile= /home/kirr/.gitignore-kirr
> 
> 
> because it does not work when '~' is used for $HOME
> 
> [core]
>     excludesfile= ~/.gitignore-kirr # does not work
> 
> 
> Is it intended?
> 
> 
> Still I think since a lot of people have to do the same operation, maybe
> it makes sense to put ignores for popular tools right into project's
> .gitignore.

I'm reluctant to put these universal rules to a project-specific .gitignores, that doesn't feel like the proper solution to me.

I think it would actually make most sense to insert some conservative default ignore rules to the Git's stock excludes template. (Or better, have a single file with default Git's exclude rules. Tools newly installed on the system could even add their entries there during installation as Git's quest on world dominations progresses.) I'd shamelessly propose Cogito's set of default excludes for starters:

	*.[ao]
	.*
	!.git*
	tags
	*~
	#*

(or omit the first line if that feels too C-specific - but I think it should be extremely rare to find files you _want_ to track even in non-C projects; and I'd argue anytime that by default ignoring hidden files is absolutely the sanest thing to do.)

I'm not sure if there wouldn't be opposition from others to this, though. Especially as Junio is extra-careful about backwards compatibility now after 1.6.0. :-(

-- 
				Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC.  -- Bill Gates
Junio C Hamano· Sep 19, 2008, 15:46 UTC · re: Petr Baudis · lore

Re: Default exclude rules for Git

Petr Baudis <pasky@suse.cz> writes:
Show 18 quoted lines
> I think it would actually make most sense to insert some conservative
> default ignore rules to the Git's stock excludes template. (Or better,
> have a single file with default Git's exclude rules. Tools newly
> installed on the system could even add their entries there during
> installation as Git's quest on world dominations progresses.) I'd
> shamelessly propose Cogito's set of default excludes for starters:
>
> 	*.[ao]
> 	.*
> 	!.git*
> 	tags
> 	*~
> 	#*
>
> (or omit the first line if that feels too C-specific - but I think it
> should be extremely rare to find files you _want_ to track even in non-C
> projects; and I'd argue anytime that by default ignoring hidden files
> is absolutely the sanest thing to do.)

I do not see a need to change any canned template shipped with git. I actually think it is a grave regression to add anything arbitrary, even if one person happens to think the choice is conservative, to the set of tool-wide ignore patterns. And here is why.

I haven't personally seen any project that wants its users to _edit_ a file whose names end with ".a" or ".o" and track it. That does not however mean that there can be no project and/or environment that validly wants to track files with ".o" suffix (isn't it the case that windows shop use ".obj" for object files and ".o" suffix do not have any particular meaning to them?) By placing "*.o" to tool-wide ignore file, your version of git is making life for participants in such a project harder because they can now easily forget to add a newly created "*.o" files (status won't show them). The tool should be extremely conservative not to encourage such mistakes.

The best place to express such a project wide policy (e.g. "in this project, '*.o' files will never, or rarely if ever, be tracked and we expect our developers to appreciate not seeing them in status output by default") is a tracked .gitignore file.

I earlier said that "*~" should not be in project-wide .gitignore file because use of Emacs vs vi is a matter of personal taste, and Emacs specific "*~" pattern does not belong to a project policy, just like vim "*.swp" pattern doesn't.

But I think that reasoning is flawed. The right criteria should not be about "use of Emacs vs vi", but about "do we in this project ever want to track files that match *~ or *.swp as legitimate contents". If a project expects not to have a tracked file whose name ends with ".swp", even if it does _not_ mean to encourage use of vim over Emacs or any other editor, I think it is fine to add such to its tracked .gitignore file for its developer's benefit.

Petr Baudis· Sep 19, 2008, 16:33 UTC · re: Junio C Hamano · lore

Re: Default exclude rules for Git

On Fri, Sep 19, 2008 at 08:46:34AM -0700, Junio C Hamano wrote:
Show 20 quoted lines
> I do not see a need to change any canned template shipped with git.  I
> actually think it is a grave regression to add anything arbitrary, even if
> one person happens to think the choice is conservative, to the set of
> tool-wide ignore patterns.  And here is why.
> 
> I haven't personally seen any project that wants its users to _edit_ a
> file whose names end with ".a" or ".o" and track it.  That does not
> however mean that there can be no project and/or environment that validly
> wants to track files with ".o" suffix (isn't it the case that windows shop
> use ".obj" for object files and ".o" suffix do not have any particular
> meaning to them?)  By placing "*.o" to tool-wide ignore file, your version
> of git is making life for participants in such a project harder because
> they can now easily forget to add a newly created "*.o" files (status
> won't show them).  The tool should be extremely conservative not to
> encourage such mistakes.
> 
> The best place to express such a project wide policy (e.g. "in this
> project, '*.o' files will never, or rarely if ever, be tracked and we
> expect our developers to appreciate not seeing them in status output by
> default") is a tracked .gitignore file.

Yes, but the idea here is to give both the projects and the users sensible default to work on, in case of users even one that might change system to system based on tools behavior. It is that VAST MAJORITY of projects won't care about object or (most kinds of) hidden files, so to me it makes sense to make people opt out instead of opt in.

If a particular policy is unsuitable for some (rare) project, it can still undo the ignore rules by adding !*.o to its .gitignore file. The only issue is that this gets noticed first time a particular new ignore pattern appears, and I admit I don't have a good solution here.

-- 
				Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC.  -- Bill Gates
Avery Pennarun· Sep 19, 2008, 16:42 UTC · re: Petr Baudis · lore

Re: Default exclude rules for Git

On Fri, Sep 19, 2008 at 12:33 PM, Petr Baudis <pasky@suse.cz> wrote:
Show 5 quoted lines
> Yes, but the idea here is to give both the projects and the users
> sensible default to work on, in case of users even one that might change
> system to system based on tools behavior. It is that VAST MAJORITY of
> projects won't care about object or (most kinds of) hidden files, so to
> me it makes sense to make people opt out instead of opt in.

The problem here is that the cost of a false positive (ie. too much ignored) is much greater than the cost of a false negative (ie. too little ignored).

In the very worst case, if too few files are ignored and a developer is paying no attention at all, then a *.o or *~ file gets committed; you can just delete it again. But if too *many* files are ignored, you can work on your private branch for weeks at a time, thinking you're keeping regular snapshots, and actually all your commits are useless because an important file was never versioned.

I never, ever want to end up in the latter situation, so even though I start virtually every git project by putting "*.[oa]" and "*~" in my .gitignore, I'm glad it's *me* doing that and not somebody else.

Have fun,
Avery
Kirill Smelkov· Sep 18, 2008, 16:29 UTC · re: Kirill Smelkov · lore

[TopGit PATCH] tg help: <something>: improve readability

Previously tg help was not showing Usage line, and with this change, now it looks like e.g.:

$ tg help import
Usage: tg [...] import [-p PREFIX] RANGE...
        Import commits within the given revision range into TopGit,
        creating one topic branch per commit, the dependencies forming
        a linear sequence starting on your current branch.
        The branch names are auto-guessed from the commit messages
        and prefixed by t/ by default; use '-p PREFIX' to specify
        an alternative prefix (even an empty one).
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
---
 tg.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tg.sh b/tg.sh
index 545e1b8..08975ae 100644
--- a/tg.sh
+++ b/tg.sh
@@ -224,8 +224,12 @@ do_help()
 
 		echo "TopGit v0.3 - A different patch queue manager"
 		echo "Usage: tg [-r REMOTE] ($cmds|help) ..."
-	elif [ -r "@sharedir@/tg-$1.txt" ] ; then
-		cat "@sharedir@/tg-$1.txt"
+	elif [ -r "@cmddir@"/tg-$1 ] ; then
+		@cmddir@/tg-$1 -h || :
+		echo
+		if [ -r "@sharedir@/tg-$1.txt" ] ; then
+			cat "@sharedir@/tg-$1.txt"
+		fi
 	else
 		echo "`basename $0`: no help for $1" 1>&2
 	fi
-- 
1.6.0.2.250.g965aa
Kirill Smelkov· Sep 18, 2008, 16:29 UTC · re: Kirill Smelkov · lore

[TopGit PATCH] tg import: fix + make more robust

a5bf892d0900cbf9949f628c3e05db599341a02c (tg import: Check out new files as we go) broke tg-import. This is how it fails after that change:

    $ tg import Z~~..Z
    tg: ---- Importing e3e8c1382fe4cedca31e955910914ae0033455eb to t/Z
    tg: Automatically marking dependency on master
    tg: Creating t/Z base from master...
    Switched to a new branch "t/Z"
    tg: Topic branch t/Z set up. Please fill .topmsg now and make initial commit.
    tg: To abort: git rm -f .top* && git checkout master && tg delete t/Z
    fatal: pathspec '.topdeps' did not match any files

That's why, when we do git read-tree -u -m it _kills_ .topmsg and .topdep both in index and in working tree!

Also, imagine that we are going to import patch C onto A
o---B---A
     \
      C

With read-tree we'll *override* any change in common files between A and B, so I think read-tree is wrong here (it was ok if we are importing on top of B).

What is right it seems, is to work on diff level -- to use cherry-pick. And since cherry-pick does not kill our already-in-index .topmsg and .topdeps we automatically fix the breakage.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
---
 tg-import.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tg-import.sh b/tg-import.sh
index 68477f0..799efc9 100644
--- a/tg-import.sh
+++ b/tg-import.sh
@@ -61,7 +61,7 @@ process_commit()
 	branch_name=$(get_branch_name "$commit")
 	info "---- Importing $commit to $branch_prefix$branch_name"
 	tg create "$branch_prefix""$branch_name"
-	git read-tree -u -m "$commit"
+	git cherry-pick --no-commit "$commit"
 	get_commit_msg "$commit" > .topmsg
 	git add -f .topmsg .topdeps
 	git commit -C "$commit"
-- 
1.6.0.2.250.g965aa

← back to recent threads