All of lore.kernel.org
 help / color / mirror / Atom feed
* Git: "No you can't handle my root!" (?)
@ 2009-10-12  5:28 sylvain
  2009-10-12 17:59 ` sylvain
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: sylvain @ 2009-10-12  5:28 UTC (permalink / raw)
  To: git

Git is good, Git is great! All praise the Git! :-D

What do you people think about this strange phenomena?

localhost / # git --version
git version 1.6.4.4

localhost / # git init
Initialized empty Git repository in //.git/

localhost / # cd etc
localhost etc # git add X11/xorg.conf
fatal: pathspec 'etc/X11/xorg.conf' did not match any files

Aside from the obvious question of why would I want to Git the whole
tree ("But all files deserve the Holy Presence of the Git!"), why does
Git refuse the love offering from "/etc/X11/xorg.conf"? Is it because
it contains font directory configurations?

Commit and [ENTER] to all,

S! :-)

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12  5:28 Git: "No you can't handle my root!" (?) sylvain
@ 2009-10-12 17:59 ` sylvain
  2009-10-12 18:06   ` Steven Noonan
  2009-10-12 18:30 ` Markus Heidelberg
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 18+ messages in thread
From: sylvain @ 2009-10-12 17:59 UTC (permalink / raw)
  To: git

Hello there. I know I was being goofy, but here is the real down to  
earth question :

Is there a known bug/feature that prevents Git from being used at "/"?  
It seems that there is a problem either at "git init" or "git add"  
when the repository is located at "/.git". (Git 1.6.4.4, see example  
below)

Thank you!

Quoting sylvain@demarque.qc.ca:

> Git is good, Git is great! All praise the Git! :-D
>
> What do you people think about this strange phenomena?
>
> localhost / # git --version
> git version 1.6.4.4
>
> localhost / # git init
> Initialized empty Git repository in //.git/
>
> localhost / # cd etc
> localhost etc # git add X11/xorg.conf
> fatal: pathspec 'etc/X11/xorg.conf' did not match any files
>
> Aside from the obvious question of why would I want to Git the whole
> tree ("But all files deserve the Holy Presence of the Git!"), why does
> Git refuse the love offering from "/etc/X11/xorg.conf"? Is it because
> it contains font directory configurations?
>
> Commit and [ENTER] to all,
>
> S! :-)
> --
> 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

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 17:59 ` sylvain
@ 2009-10-12 18:06   ` Steven Noonan
  2009-10-12 18:15     ` Alex Riesen
  0 siblings, 1 reply; 18+ messages in thread
From: Steven Noonan @ 2009-10-12 18:06 UTC (permalink / raw)
  To: sylvain; +Cc: git

I've had this problem too, but I eventually realized it was git's way
of telling me I shouldn't do that. But even so, it'd be good if we
_could_.

- Steven

On Mon, Oct 12, 2009 at 10:59 AM,  <sylvain@demarque.qc.ca> wrote:
> Hello there. I know I was being goofy, but here is the real down to
> earth question :
>
> Is there a known bug/feature that prevents Git from being used at "/"?
> It seems that there is a problem either at "git init" or "git add"
> when the repository is located at "/.git". (Git 1.6.4.4, see example
> below)
>
> Thank you!
>
> Quoting sylvain@demarque.qc.ca:
>
>> Git is good, Git is great! All praise the Git! :-D
>>
>> What do you people think about this strange phenomena?
>>
>> localhost / # git --version
>> git version 1.6.4.4
>>
>> localhost / # git init
>> Initialized empty Git repository in //.git/
>>
>> localhost / # cd etc
>> localhost etc # git add X11/xorg.conf
>> fatal: pathspec 'etc/X11/xorg.conf' did not match any files
>>
>> Aside from the obvious question of why would I want to Git the whole
>> tree ("But all files deserve the Holy Presence of the Git!"), why does
>> Git refuse the love offering from "/etc/X11/xorg.conf"? Is it because
>> it contains font directory configurations?
>>
>> Commit and [ENTER] to all,
>>
>> S! :-)
>> --
>> 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
> --
> 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
>

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:06   ` Steven Noonan
@ 2009-10-12 18:15     ` Alex Riesen
  2009-10-12 18:20       ` sylvain
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Riesen @ 2009-10-12 18:15 UTC (permalink / raw)
  To: Steven Noonan; +Cc: sylvain, git

On Mon, Oct 12, 2009 at 20:06, Steven Noonan <steven@uplinklabs.net> wrote:
> I've had this problem too, but I eventually realized it was git's way
> of telling me I shouldn't do that. But even so, it'd be good if we
> _could_.

It's more of "a note to the future generation of developers": "Hey guys,
we didn't need that working, but if you have a night to spare could you
please finish that?"

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:15     ` Alex Riesen
@ 2009-10-12 18:20       ` sylvain
  2009-10-12 18:30         ` Alex Riesen
  2009-10-12 18:35         ` Jeff King
  0 siblings, 2 replies; 18+ messages in thread
From: sylvain @ 2009-10-12 18:20 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Steven Noonan, git

Quoting Alex Riesen <raa.lkml@gmail.com>:

> On Mon, Oct 12, 2009 at 20:06, Steven Noonan <steven@uplinklabs.net> wrote:
>> I've had this problem too, but I eventually realized it was git's way
>> of telling me I shouldn't do that. But even so, it'd be good if we
>> _could_.
>
> It's more of "a note to the future generation of developers": "Hey guys,
> we didn't need that working, but if you have a night to spare could you
> please finish that?"

Ok, then I won't wait for it to work. I will dive in Git's code and  
play the "future generation of developers" part... some day. ;-)

Thank you! :-)

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12  5:28 Git: "No you can't handle my root!" (?) sylvain
  2009-10-12 17:59 ` sylvain
@ 2009-10-12 18:30 ` Markus Heidelberg
  2009-10-12 19:02 ` Matthieu Moy
  2009-10-12 21:37 ` Daniele Segato
  3 siblings, 0 replies; 18+ messages in thread
From: Markus Heidelberg @ 2009-10-12 18:30 UTC (permalink / raw)
  To: sylvain; +Cc: git

sylvain@demarque.qc.ca, 12.10.2009:
> Git is good, Git is great! All praise the Git! :-D
> 
> What do you people think about this strange phenomena?
> 
> localhost / # git --version
> git version 1.6.4.4
> 
> localhost / # git init
> Initialized empty Git repository in //.git/
> 
> localhost / # cd etc
> localhost etc # git add X11/xorg.conf
> fatal: pathspec 'etc/X11/xorg.conf' did not match any files

"git add etc/X11/xorg.conf" works, seems to be a bug.

Markus

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:20       ` sylvain
@ 2009-10-12 18:30         ` Alex Riesen
  2009-10-12 18:35         ` Jeff King
  1 sibling, 0 replies; 18+ messages in thread
From: Alex Riesen @ 2009-10-12 18:30 UTC (permalink / raw)
  To: sylvain; +Cc: Steven Noonan, git

On Mon, Oct 12, 2009 at 20:20,  <sylvain@demarque.qc.ca> wrote:
> Quoting Alex Riesen <raa.lkml@gmail.com>:
>> It's more of "a note to the future generation of developers": "Hey guys,
>> we didn't need that working, but if you have a night to spare could you
>> please finish that?"
>
> Ok, then I won't wait for it to work. I will dive in Git's code and play the
> "future generation of developers" part... some day. ;-)
>
> Thank you! :-)
>

Hmm... This strategy to encourage new contributors didn't quite worked out.
Must try something else next time. Do you like sweets? Just asking...

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:20       ` sylvain
  2009-10-12 18:30         ` Alex Riesen
@ 2009-10-12 18:35         ` Jeff King
  2009-10-12 19:08           ` sylvain
  2009-10-13 17:46           ` Tony Finch
  1 sibling, 2 replies; 18+ messages in thread
From: Jeff King @ 2009-10-12 18:35 UTC (permalink / raw)
  To: sylvain; +Cc: Alex Riesen, Steven Noonan, git

On Mon, Oct 12, 2009 at 02:20:17PM -0400, sylvain@demarque.qc.ca wrote:

> >It's more of "a note to the future generation of developers": "Hey guys,
> >we didn't need that working, but if you have a night to spare could you
> >please finish that?"
> 
> Ok, then I won't wait for it to work. I will dive in Git's code and
> play the "future generation of developers" part... some day. ;-)
> 
> Thank you! :-)

I think that it sort of works, actually. It seems to do OK if you do
something like:

  $ GIT_DIR=/path/to/store/repo; export GIT_DIR
  $ GIT_WORK_TREE=/; export GIT_WORK_TREE
  $ git init
  $ cd /etc/whatever
  $ git add .

But it does not work if you try to make things work automatically:

  $ cd /
  $ git init
  $ cd /etc/whatever
  $ git add .

So probably the bug is in detecting the location of the work tree when
it is not explicitly given. You can use the explicit style as a
workaround for now.

-Peff

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12  5:28 Git: "No you can't handle my root!" (?) sylvain
  2009-10-12 17:59 ` sylvain
  2009-10-12 18:30 ` Markus Heidelberg
@ 2009-10-12 19:02 ` Matthieu Moy
  2009-10-12 21:37 ` Daniele Segato
  3 siblings, 0 replies; 18+ messages in thread
From: Matthieu Moy @ 2009-10-12 19:02 UTC (permalink / raw)
  To: sylvain; +Cc: git

sylvain@demarque.qc.ca writes:

> localhost / # cd etc
> localhost etc # git add X11/xorg.conf
> fatal: pathspec 'etc/X11/xorg.conf' did not match any files

cd ..
git add etc/X11/xorg.conf

works. I don't know why the other doesn't (just tested adding from an
untracked directory in another project, it does work).

If you want to version a large directory like /, I'd advise putting
"*" in /.gitignore to make sure Git never tries to traverse the whole
filesystem.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:35         ` Jeff King
@ 2009-10-12 19:08           ` sylvain
  2009-10-13 17:46           ` Tony Finch
  1 sibling, 0 replies; 18+ messages in thread
From: sylvain @ 2009-10-12 19:08 UTC (permalink / raw)
  To: Jeff King; +Cc: Alex Riesen, Steven Noonan, git

Quoting Jeff King <peff@peff.net>:

> On Mon, Oct 12, 2009 at 02:20:17PM -0400, sylvain@demarque.qc.ca wrote:
>
> I think that it sort of works, actually. It seems to do OK if you do
> something like:
>
>   $ GIT_DIR=/path/to/store/repo; export GIT_DIR
>   $ GIT_WORK_TREE=/; export GIT_WORK_TREE
>   $ git init
>   $ cd /etc/whatever
>   $ git add .
>
> So probably the bug is in detecting the location of the work tree when
> it is not explicitly given. You can use the explicit style as a
> workaround for now.
>
> -Peff

Thank you! Great idea!

export GIT_DIR=/root/.git
export GIT_WORK_TREE=/
echo "*" >> /root/.git/info/exclude

The Golden Solution of the Gods! :-D

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12  5:28 Git: "No you can't handle my root!" (?) sylvain
                   ` (2 preceding siblings ...)
  2009-10-12 19:02 ` Matthieu Moy
@ 2009-10-12 21:37 ` Daniele Segato
  2009-10-12 21:57   ` Avery Pennarun
                     ` (3 more replies)
  3 siblings, 4 replies; 18+ messages in thread
From: Daniele Segato @ 2009-10-12 21:37 UTC (permalink / raw)
  To: sylvain; +Cc: git

Il giorno lun, 12/10/2009 alle 01.28 -0400, sylvain@demarque.qc.ca ha
scritto:
> localhost / # git init


I don't see the point of using git on the root directory :)

but that made me think that it could actually be a good idea
for /etc/ :)
I happen to modify some configuration and then I forgot which one... and
sometimes updates broke something


And that make me think of another question...

is there a way to have a git repo for a subset of directory that match a
pattern?

for instance...

can I have a git report of $HOME/.* (without . and ..)? (all user
setting)

Or better: provide a list of directory under $HOME I want to track 

Instead of providing the list of directory I want to ignore i would like
to provide the list of the directory and files I want to track :)

I probably am going out of topic here but I hope you forgive me :)

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 21:37 ` Daniele Segato
@ 2009-10-12 21:57   ` Avery Pennarun
  2009-10-12 22:04   ` sylvain
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: Avery Pennarun @ 2009-10-12 21:57 UTC (permalink / raw)
  To: Daniele Segato; +Cc: Git Mailing List

On Mon, Oct 12, 2009 at 5:37 PM, Daniele Segato <daniele.bilug@gmail.com> wrote:
> can I have a git report of $HOME/.* (without . and ..)? (all user
> setting)
>
> Or better: provide a list of directory under $HOME I want to track
>
> Instead of providing the list of directory I want to ignore i would like
> to provide the list of the directory and files I want to track :)

You can probably do pretty much anything you want by twiddling with
options in .gitignore.  You should be able to add "don't ignore" names
by starting them with !, iirc.

Avery

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 21:37 ` Daniele Segato
  2009-10-12 21:57   ` Avery Pennarun
@ 2009-10-12 22:04   ` sylvain
  2009-10-13  1:43   ` Jeff King
  2009-10-15  3:02   ` Wesley J. Landaker
  3 siblings, 0 replies; 18+ messages in thread
From: sylvain @ 2009-10-12 22:04 UTC (permalink / raw)
  To: Daniele Segato; +Cc: git

Quoting Daniele Segato <daniele.bilug@gmail.com>:

> Il giorno lun, 12/10/2009 alle 01.28 -0400, sylvain@demarque.qc.ca ha
> scritto:
>> localhost / # git init
>
> I don't see the point of using git on the root directory :)
>
> but that made me think that it could actually be a good idea
> for /etc/ :)
> I happen to modify some configuration and then I forgot which one... and
> sometimes updates broke something
>
>
> And that make me think of another question...
>
> is there a way to have a git repo for a subset of directory that match a
> pattern?
>
> for instance...
>
> can I have a git report of $HOME/.* (without . and ..)? (all user
> setting)
>
> Or better: provide a list of directory under $HOME I want to track
>
> Instead of providing the list of directory I want to ignore i would like
> to provide the list of the directory and files I want to track :)
>
> I probably am going out of topic here but I hope you forgive me :)

I am still a Git newbee, but I am using GNU/Linux for a long time now.  
I have just reformatted my disk and installed Gentoo and I have to  
setup all these little things all over again. Since I clean install  
only every couple of years, I often forget some details, etc.

So I am trying something new. I have my "home Git" at "~/.git" and the  
"root Git" at "/root/.git" with the GIT_WORK_TREE at "/". Both have  
"*" in "info/exclude", so I do provide my list of directories and  
files I want to track explicitly by adding them one by one.

My home Git takes care of .bash* .vim* .emacs*, firefox passwords and  
bookmarks, etc. My root git takes care of some "/etc", "/var" configs,  
etc. (That is the reason why I wanted it on "/", because some  
configuration tweaks are done outside of "/etc". Oh, I forgot to  
mention "/usr/src/linux/.config")

My hope is that next time I'll clean install my system, I won't have  
to backup my whole disk and then mount it again to recover configs  
pieces by pieces. I'll just copy my two Git repositories and I'll  
should be OK.

All praise the Git. :-)

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 21:37 ` Daniele Segato
  2009-10-12 21:57   ` Avery Pennarun
  2009-10-12 22:04   ` sylvain
@ 2009-10-13  1:43   ` Jeff King
  2009-10-13  4:17     ` Daniele Segato
  2009-10-15  3:02   ` Wesley J. Landaker
  3 siblings, 1 reply; 18+ messages in thread
From: Jeff King @ 2009-10-13  1:43 UTC (permalink / raw)
  To: Daniele Segato; +Cc: sylvain, git

On Mon, Oct 12, 2009 at 11:37:39PM +0200, Daniele Segato wrote:

> I don't see the point of using git on the root directory :)
> 
> but that made me think that it could actually be a good idea
> for /etc/ :)
> I happen to modify some configuration and then I forgot which one... and
> sometimes updates broke something

Take a look at:

  http://joey.kitenet.net/code/etckeeper/

> can I have a git report of $HOME/.* (without . and ..)? (all user
> setting)

This seems to work:

  $ cd ~
  $ git init
  $ echo '*' >.gitignore
  $ echo '!.*' >.gitignore

> Or better: provide a list of directory under $HOME I want to track 

Same thing, but make your ! pattern more specific.

-Peff

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-13  1:43   ` Jeff King
@ 2009-10-13  4:17     ` Daniele Segato
  2009-10-13  5:01       ` Jeff King
  0 siblings, 1 reply; 18+ messages in thread
From: Daniele Segato @ 2009-10-13  4:17 UTC (permalink / raw)
  To: Jeff King; +Cc: sylvain, git

Il giorno lun, 12/10/2009 alle 21.43 -0400, Jeff King ha scritto:
> Take a look at:
> 
>   http://joey.kitenet.net/code/etckeeper/


thanks really interesting


> > can I have a git report of $HOME/.* (without . and ..)? (all user
> > setting)
> 
> This seems to work:
> 
>   $ cd ~
>   $ git init
>   $ echo '*' >.gitignore
>   $ echo '!.*' >.gitignore
> 
> > Or better: provide a list of directory under $HOME I want to track 
> 
> Same thing, but make your ! pattern more specific.

thanks again!

regards,
Daniele

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-13  4:17     ` Daniele Segato
@ 2009-10-13  5:01       ` Jeff King
  0 siblings, 0 replies; 18+ messages in thread
From: Jeff King @ 2009-10-13  5:01 UTC (permalink / raw)
  To: Daniele Segato; +Cc: sylvain, git

On Tue, Oct 13, 2009 at 06:17:13AM +0200, Daniele Segato wrote:

> > This seems to work:
> > 
> >   $ cd ~
> >   $ git init
> >   $ echo '*' >.gitignore
> >   $ echo '!.*' >.gitignore
> > 
> > > Or better: provide a list of directory under $HOME I want to track 
> > 
> > Same thing, but make your ! pattern more specific.
> 
> thanks again!

You're welcome, though while reading the quoted text I noticed a typo in
my instructions. The second echo should obviously be _appending_ to
.gitignore:

  $ echo '!.*' >>.gitignore

Hopefully that was obvious, but I thought I would point it out for the
record.

-Peff

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 18:35         ` Jeff King
  2009-10-12 19:08           ` sylvain
@ 2009-10-13 17:46           ` Tony Finch
  1 sibling, 0 replies; 18+ messages in thread
From: Tony Finch @ 2009-10-13 17:46 UTC (permalink / raw)
  To: Jeff King; +Cc: sylvain, Alex Riesen, Steven Noonan, git

On Mon, 12 Oct 2009, Jeff King wrote:
>
>   $ cd /
>   $ git init
>   $ cd /etc/whatever
>   $ git add .

One reason that you don't want to do this (even if it does work) is that
careless use of git (e.g. by a user who is not the sysadmin playing with
git in their home directory) is going to find the root repository when you
expect it not to find any repository.

Also, I suggest this little wrapper script:
http://dotat.at/cgi/git?p=git-deploy.git;a=blob;f=git-root.sh

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.

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

* Re: Git: "No you can't handle my root!" (?)
  2009-10-12 21:37 ` Daniele Segato
                     ` (2 preceding siblings ...)
  2009-10-13  1:43   ` Jeff King
@ 2009-10-15  3:02   ` Wesley J. Landaker
  3 siblings, 0 replies; 18+ messages in thread
From: Wesley J. Landaker @ 2009-10-15  3:02 UTC (permalink / raw)
  To: git

On Monday 12 October 2009 15:37:39 Daniele Segato wrote:
> Il giorno lun, 12/10/2009 alle 01.28 -0400, sylvain@demarque.qc.ca ha
>
> scritto:
> > localhost / # git init
>
> I don't see the point of using git on the root directory :)

Just a comment: this might be of serious use in e.g. a chroot.

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

end of thread, other threads:[~2009-10-15  3:12 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12  5:28 Git: "No you can't handle my root!" (?) sylvain
2009-10-12 17:59 ` sylvain
2009-10-12 18:06   ` Steven Noonan
2009-10-12 18:15     ` Alex Riesen
2009-10-12 18:20       ` sylvain
2009-10-12 18:30         ` Alex Riesen
2009-10-12 18:35         ` Jeff King
2009-10-12 19:08           ` sylvain
2009-10-13 17:46           ` Tony Finch
2009-10-12 18:30 ` Markus Heidelberg
2009-10-12 19:02 ` Matthieu Moy
2009-10-12 21:37 ` Daniele Segato
2009-10-12 21:57   ` Avery Pennarun
2009-10-12 22:04   ` sylvain
2009-10-13  1:43   ` Jeff King
2009-10-13  4:17     ` Daniele Segato
2009-10-13  5:01       ` Jeff King
2009-10-15  3:02   ` Wesley J. Landaker

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.