* Git repository mesh?
@ 2009-11-25 4:07 Nguyen Thai Ngoc Duy
2009-11-25 7:55 ` Matthieu Moy
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2009-11-25 4:07 UTC (permalink / raw)
To: Git Mailing List
Hi,
I work on a few machines so I have repositories on all of them. One
repository can pull from or push to any other repositories (in case of
push, it pushes on remote branches). I avoid a central repository
because it's quite inconvenient when you just need to push some
changes to a machine, you have to push it to the central repository
then pull from that (and if the central repository is on WAN, double
inconvenient). Maybe this model is just plain wrong, but it'd be fun
to see if Git can work with this model.
The first thing that annoys me is remote repository management.
Everytime I add a new repository to the mesh, I need to update .config
of all repositories. Putting part of $GIT_DIR/config into working
directory may help (though there will be security concerns, perhaps
only remote.* should be allowed in in-tree config file). Next thing is
sometimes I want to see how many commits ahead/behind other
repositories, from a repository. "git status" does not help much.
Never used Mercurial but the idea of "git in" and "git out" to see how
many commits ahead/behind would be nice.
Has anyone done something like this? Any suggestions?
--
Duy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 4:07 Git repository mesh? Nguyen Thai Ngoc Duy
@ 2009-11-25 7:55 ` Matthieu Moy
2009-11-25 8:00 ` Nguyen Thai Ngoc Duy
2009-11-25 8:42 ` Sergio
2009-11-25 10:08 ` Alex Riesen
2 siblings, 1 reply; 9+ messages in thread
From: Matthieu Moy @ 2009-11-25 7:55 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> Never used Mercurial but the idea of "git in" and "git out" to see how
> many commits ahead/behind would be nice.
In Git, you'd run "git fetch" to get everything locally, and then
git log ..origin/master => what origin/master has that you don't
git log origin/master.. => what you have that origin/master doesn't
(and you can define aliases for that)
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 7:55 ` Matthieu Moy
@ 2009-11-25 8:00 ` Nguyen Thai Ngoc Duy
2009-11-25 11:54 ` Matthieu Moy
0 siblings, 1 reply; 9+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2009-11-25 8:00 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Git Mailing List
On Wed, Nov 25, 2009 at 2:55 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> Never used Mercurial but the idea of "git in" and "git out" to see how
>> many commits ahead/behind would be nice.
>
> In Git, you'd run "git fetch" to get everything locally, and then
>
> git log ..origin/master => what origin/master has that you don't
> git log origin/master.. => what you have that origin/master doesn't
>
> (and you can define aliases for that)
But I have many origins (any repository could be origin). "git status"
also have this kind of information, but only for "origin".
--
Duy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 4:07 Git repository mesh? Nguyen Thai Ngoc Duy
2009-11-25 7:55 ` Matthieu Moy
@ 2009-11-25 8:42 ` Sergio
2009-11-25 10:08 ` Alex Riesen
2 siblings, 0 replies; 9+ messages in thread
From: Sergio @ 2009-11-25 8:42 UTC (permalink / raw)
To: git
Nguyen Thai Ngoc Duy <pclouds <at> gmail.com> writes:
>
> Hi,
>
> I work on a few machines so I have repositories on all of them. One
> repository can pull from or push to any other repositories (in case of
> push, it pushes on remote branches). I avoid a central repository
> because it's quite inconvenient when you just need to push some
> changes to a machine, you have to push it to the central repository
> then pull from that (and if the central repository is on WAN, double
> inconvenient). Maybe this model is just plain wrong, but it'd be fun
> to see if Git can work with this model.
>
> The first thing that annoys me is remote repository management.
> Everytime I add a new repository to the mesh, I need to update .config
> of all repositories.
If I remember correctly, there was in the past the idea of allowing some limited
shell variable substitution in the config file.
This would allow to have a single config for all the machines with remote
entries. Something like
[remote "host1"]
url = ssh://host1/path
fetch = +refs/heads/*:refs/remotes/host1/*
push = +refs/heads/*:refs/remotes/$hostname/*
[remote "host2"]
url = ssh://host2/path
fetch = +refs/heads/*:refs/remotes/host2/*
push = +refs/heads/*:refs/remotes/$hostname/*
...
In other terms, admitting that all the candidate machines are known at the very
start, you could start a repo on any of the host, placing in the config file all
the possible hosts. Moreover, not needing to have a different config for each
host may make it easier to manage (propagate by simple scp) or even to version
control.
To the best of my knowledge the idea was not implemented in the end, but I think
that a patch for variable substitution in the config file might still be found
on the ML.
Sergio
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 4:07 Git repository mesh? Nguyen Thai Ngoc Duy
2009-11-25 7:55 ` Matthieu Moy
2009-11-25 8:42 ` Sergio
@ 2009-11-25 10:08 ` Alex Riesen
2 siblings, 0 replies; 9+ messages in thread
From: Alex Riesen @ 2009-11-25 10:08 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List
On Wed, Nov 25, 2009 at 05:07, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> I work on a few machines so I have repositories on all of them. One
> repository can pull from or push to any other repositories (in case of
> push, it pushes on remote branches). I avoid a central repository
> because it's quite inconvenient when you just need to push some
> changes to a machine, you have to push it to the central repository
> then pull from that (and if the central repository is on WAN, double
> inconvenient). Maybe this model is just plain wrong, but it'd be fun
> to see if Git can work with this model.
You can always use fetch (and pull) without specifying a remote:
$ git fetch host:/path/repo some-branch
$ git log ..FETCH_HEAD # git merge FETCH_HEAD
Maybe fetch should be extended to record this operation in .git/config?
$ git fetch ---save=host-some host:/path/repo some-branch some-branch
$ git remote -v
...
host-some host:/path/repo (fetch)
$
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 8:00 ` Nguyen Thai Ngoc Duy
@ 2009-11-25 11:54 ` Matthieu Moy
2009-11-25 12:16 ` Nguyen Thai Ngoc Duy
0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Moy @ 2009-11-25 11:54 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> On Wed, Nov 25, 2009 at 2:55 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>>
>>> Never used Mercurial but the idea of "git in" and "git out" to see how
>>> many commits ahead/behind would be nice.
>>
>> In Git, you'd run "git fetch" to get everything locally, and then
>>
>> git log ..origin/master => what origin/master has that you don't
>> git log origin/master.. => what you have that origin/master doesn't
>>
>> (and you can define aliases for that)
>
> But I have many origins (any repository could be origin). "git status"
> also have this kind of information, but only for "origin".
Then, fetch from all of them and:
git log ^HEAD repo1/master repo2/master repo3/master
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 11:54 ` Matthieu Moy
@ 2009-11-25 12:16 ` Nguyen Thai Ngoc Duy
2009-11-25 13:26 ` Jakub Narebski
2009-11-25 18:23 ` Matthieu Moy
0 siblings, 2 replies; 9+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2009-11-25 12:16 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Git Mailing List
On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> Then, fetch from all of them and:
>
> git log ^HEAD repo1/master repo2/master repo3/master
Very nice. Thanks I did not know about "^HEAD". Now I need to think of
how to avoid typing all "repo*/master" stuff..
--
Duy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 12:16 ` Nguyen Thai Ngoc Duy
@ 2009-11-25 13:26 ` Jakub Narebski
2009-11-25 18:23 ` Matthieu Moy
1 sibling, 0 replies; 9+ messages in thread
From: Jakub Narebski @ 2009-11-25 13:26 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Matthieu Moy, Git Mailing List
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> > Then, fetch from all of them and:
> >
> > git log ^HEAD repo1/master repo2/master repo3/master
>
> Very nice. Thanks I did not know about "^HEAD". Now I need to think of
> how to avoid typing all "repo*/master" stuff..
Hmmm... shouldn't 'repo1' expand to 'repo1/HEAD', which is 'repo1/master'?
I mean shouldn't simply
git log ^HEAD repo1 repo2 repo3
work?
Also, git aliases (so you would be able to just say "git in").
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Git repository mesh?
2009-11-25 12:16 ` Nguyen Thai Ngoc Duy
2009-11-25 13:26 ` Jakub Narebski
@ 2009-11-25 18:23 ` Matthieu Moy
1 sibling, 0 replies; 9+ messages in thread
From: Matthieu Moy @ 2009-11-25 18:23 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: Git Mailing List
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> On 11/25/09, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
>> Then, fetch from all of them and:
>>
>> git log ^HEAD repo1/master repo2/master repo3/master
>
> Very nice. Thanks I did not know about "^HEAD".
Read "not HEAD", this means "remove the ancestry of HEAD in the output".
See "man git-rev-parse" for details.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-11-25 18:26 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 4:07 Git repository mesh? Nguyen Thai Ngoc Duy
2009-11-25 7:55 ` Matthieu Moy
2009-11-25 8:00 ` Nguyen Thai Ngoc Duy
2009-11-25 11:54 ` Matthieu Moy
2009-11-25 12:16 ` Nguyen Thai Ngoc Duy
2009-11-25 13:26 ` Jakub Narebski
2009-11-25 18:23 ` Matthieu Moy
2009-11-25 8:42 ` Sergio
2009-11-25 10:08 ` Alex Riesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox