* git remote update -> rejected @ 2008-04-22 9:48 Mike Galbraith 2008-04-22 10:34 ` Jeff King 0 siblings, 1 reply; 28+ messages in thread From: Mike Galbraith @ 2008-04-22 9:48 UTC (permalink / raw) To: git Greetings, Does anyone know what could lead to this? git doesn't have any trouble (well, hasn't had any yet) with any trees other than x86 and sched-devel. Nobody but little old me seems to be having this trouble... git is pulled nearly every day, but checking out older versions doesn't make any difference (unless i go too far back of course). marge:..git/linux-2.6 # git remote update Updating origin Updating linux-next Updating stable Updating x86 >From git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 ! [rejected] latest -> x86/latest (non fast forward) ! [rejected] master -> x86/master (non fast forward) ! [rejected] testing -> x86/testing (non fast forward) Updating sched-devel >From git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel ! [rejected] for-akpm -> sched-devel/for-akpm (non fast forward) ! [rejected] latest -> sched-devel/latest (non fast forward) ! [rejected] master -> sched-devel/master (non fast forward) If I rm/add the remote back, all goes fine... until it says rejected. marge:..git/linux-2.6 # git remote rm x86 marge:..git/linux-2.6 # git remote add x86 git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git marge:..git/linux-2.6 # git remote update Updating origin Updating linux-next Updating stable Updating sched-devel Updating x86 >From git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 * [new branch] base -> x86/base * [new branch] for-akpm -> x86/for-akpm * [new branch] for-linus -> x86/for-linus * [new branch] latest -> x86/latest * [new branch] master -> x86/master * [new branch] origin -> x86/origin * [new branch] testing -> x86/testing marge:..git/linux-2.6 # ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 9:48 git remote update -> rejected Mike Galbraith @ 2008-04-22 10:34 ` Jeff King 2008-04-22 10:55 ` Mike Galbraith 0 siblings, 1 reply; 28+ messages in thread From: Jeff King @ 2008-04-22 10:34 UTC (permalink / raw) To: Mike Galbraith; +Cc: git On Tue, Apr 22, 2008 at 11:48:53AM +0200, Mike Galbraith wrote: > marge:..git/linux-2.6 # git remote update > Updating origin > Updating linux-next > Updating stable > Updating x86 > >From git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 > ! [rejected] latest -> x86/latest (non fast forward) > ! [rejected] master -> x86/master (non fast forward) > ! [rejected] testing -> x86/testing (non fast forward) The x86 tree was presumably rewound or rebased, which means that fetching their new position would overwrite your old. This is probably OK, since it looks like you have x86/* as tracking branches, and only they would get overwritten. So it is probably safe to put a '+' in front of the 'fetch' line in your config file. E.g., [remote "x86"] url = ... fetch = +refs/heads/*:refs/remotes/x86/* See 'git help fetch' for details. -Peff ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 10:34 ` Jeff King @ 2008-04-22 10:55 ` Mike Galbraith 2008-04-22 11:11 ` Jeff King 0 siblings, 1 reply; 28+ messages in thread From: Mike Galbraith @ 2008-04-22 10:55 UTC (permalink / raw) To: Jeff King; +Cc: git On Tue, 2008-04-22 at 06:34 -0400, Jeff King wrote: > On Tue, Apr 22, 2008 at 11:48:53AM +0200, Mike Galbraith wrote: > > > marge:..git/linux-2.6 # git remote update > > Updating origin > > Updating linux-next > > Updating stable > > Updating x86 > > >From git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86 > > ! [rejected] latest -> x86/latest (non fast forward) > > ! [rejected] master -> x86/master (non fast forward) > > ! [rejected] testing -> x86/testing (non fast forward) > > The x86 tree was presumably rewound or rebased, which means that > fetching their new position would overwrite your old. This is probably > OK, since it looks like you have x86/* as tracking branches, and only > they would get overwritten. So it is probably safe to put a '+' in front > of the 'fetch' line in your config file. E.g., > > [remote "x86"] > url = ... > fetch = +refs/heads/*:refs/remotes/x86/* > > See 'git help fetch' for details. Thanks a bunch. I'll try it. I notice that origin and linux-next already had + prefix. Presumably that came from the home repo. -Mike ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 10:55 ` Mike Galbraith @ 2008-04-22 11:11 ` Jeff King 2008-04-22 11:58 ` Johannes Schindelin 2008-04-22 12:41 ` Teemu Likonen 0 siblings, 2 replies; 28+ messages in thread From: Jeff King @ 2008-04-22 11:11 UTC (permalink / raw) To: Mike Galbraith; +Cc: Johannes Schindelin, Junio C Hamano, git On Tue, Apr 22, 2008 at 12:55:03PM +0200, Mike Galbraith wrote: > > [remote "x86"] > > url = ... > > fetch = +refs/heads/*:refs/remotes/x86/* > > > > See 'git help fetch' for details. > > Thanks a bunch. I'll try it. I notice that origin and linux-next > already had + prefix. Presumably that came from the home repo. Cloning creates an origin with '+' in the fetch line, but "git remote add" doesn't seem to. Hrm, it looks like this is a regression from the recent rewrite in C. Dscho, is this a bug, or was there a conscious decision that I missed? If a bug, the fix is below. -- >8 -- remote: create fetch config lines with '+' Since git-remote always uses remote tracking branches, it should be safe to always force updates of those branches. I.e., we should generate fetch = +refs/heads/*:refs/remotes/$remote/* instead of fetch = refs/heads/*:refs/remotes/$remote/* This was the behavior of the perl version, which seems to have been lost in the C rewrite. Signed-off-by: Jeff King <peff@peff.net> --- builtin-remote.c | 1 + t/t5505-remote.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/builtin-remote.c b/builtin-remote.c index 9d4432b..8b63619 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -107,6 +107,7 @@ static int add(int argc, const char **argv) struct path_list_item *item = track.items + i; strbuf_reset(&buf2); + strbuf_addch(&buf2, '+'); if (mirror) strbuf_addf(&buf2, "refs/%s:refs/%s", item->path, item->path); diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index af2d077..48ff2d4 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -77,6 +77,16 @@ test_expect_success 'add another remote' ' ) ' +test_expect_success 'remote forces tracking branches' ' +( + cd test && + case `git config remote.second.fetch` in + +*) true ;; + *) false ;; + esac +) +' + test_expect_success 'remove remote' ' ( cd test && -- 1.5.5.1.116.g0023.dirty ^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 11:11 ` Jeff King @ 2008-04-22 11:58 ` Johannes Schindelin 2008-04-22 12:56 ` Jeff King 2008-04-22 17:00 ` git remote update -> rejected Junio C Hamano 2008-04-22 12:41 ` Teemu Likonen 1 sibling, 2 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 11:58 UTC (permalink / raw) To: Jeff King; +Cc: Mike Galbraith, Junio C Hamano, git Hi Peff, On Tue, 22 Apr 2008, Jeff King wrote: > On Tue, Apr 22, 2008 at 12:55:03PM +0200, Mike Galbraith wrote: > > > > [remote "x86"] > > > url = ... > > > fetch = +refs/heads/*:refs/remotes/x86/* > > > > > > See 'git help fetch' for details. > > > > Thanks a bunch. I'll try it. I notice that origin and linux-next > > already had + prefix. Presumably that came from the home repo. > > Cloning creates an origin with '+' in the fetch line, but "git remote > add" doesn't seem to. Hrm, it looks like this is a regression from the > recent rewrite in C. Thanks for working on this: I missed this thread (had too many mails to catch up with). > Dscho, is this a bug, or was there a conscious decision that I missed? It was a concious decision, but maybe it was wrong. My rationale was this: if I mirror another person's repository, I want all the history. And I do want to keep it, even if the other person decides to clean the original repository out. (In this case, the reflogs would not help, since I do not have a HEAD reflog for all the deleted branches, and deleting the refs deletes their reflogs, too.) But as I said, my rationale may very well be wrong. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 11:58 ` Johannes Schindelin @ 2008-04-22 12:56 ` Jeff King 2008-04-22 13:03 ` Johannes Schindelin 2008-04-22 17:00 ` git remote update -> rejected Junio C Hamano 1 sibling, 1 reply; 28+ messages in thread From: Jeff King @ 2008-04-22 12:56 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Mike Galbraith, Junio C Hamano, git Mike wrote: > > > Thanks a bunch. I'll try it. I notice that origin and linux-next > > > already had + prefix. Presumably that came from the home repo. Dscho wrote: > It was a concious decision, but maybe it was wrong. > > My rationale was this: if I mirror another person's repository, I want all > the history. And I do want to keep it, even if the other person decides > to clean the original repository out. > > (In this case, the reflogs would not help, since I do not have a HEAD > reflog for all the deleted branches, and deleting the refs deletes their > reflogs, too.) Hmm, there is an inconsistency here, though, since we set it up one way on clone and another way on "remote add". Though if clone does finally become "init + remote add + checkout" that will resolve itself. Still, I think I prefer the old "+" behavior. We don't actually _delete_ branches, we just allow non-fast-forward updates. The reflogs will still be there. -Peff ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 12:56 ` Jeff King @ 2008-04-22 13:03 ` Johannes Schindelin 2008-04-22 13:09 ` Jeff King 0 siblings, 1 reply; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 13:03 UTC (permalink / raw) To: Jeff King; +Cc: Mike Galbraith, Junio C Hamano, git Hi, On Tue, 22 Apr 2008, Jeff King wrote: > Dscho wrote: > > > It was a concious decision, but maybe it was wrong. > > > > My rationale was this: if I mirror another person's repository, I want > > all the history. And I do want to keep it, even if the other person > > decides to clean the original repository out. > > > > (In this case, the reflogs would not help, since I do not have a HEAD > > reflog for all the deleted branches, and deleting the refs deletes > > their reflogs, too.) > > Hmm, there is an inconsistency here, though, since we set it up one way > on clone and another way on "remote add". Though if clone does finally > become "init + remote add + checkout" that will resolve itself. > > Still, I think I prefer the old "+" behavior. We don't actually > _delete_ branches, we just allow non-fast-forward updates. The reflogs > will still be there. Oh, that's right: only "git remote prune" will delete stale refs only. But my other point about possibly interfering with local branches still holds true. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 13:03 ` Johannes Schindelin @ 2008-04-22 13:09 ` Jeff King 2008-04-22 13:26 ` [PATCH] builtin-remote: resurrect forced updates to tracked branches Johannes Schindelin 0 siblings, 1 reply; 28+ messages in thread From: Jeff King @ 2008-04-22 13:09 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Mike Galbraith, Junio C Hamano, git On Tue, Apr 22, 2008 at 02:03:43PM +0100, Johannes Schindelin wrote: > Oh, that's right: only "git remote prune" will delete stale refs only. > > But my other point about possibly interfering with local branches still > holds true. In that case, I think that the '+' should come only without --mirror, and my complaint is then that "--mirror" is a horrible name for that option. Though when I saw it, I really expected it to do something about the _push_ line, since that is the only other place we have a --mirror option. It would make sense to me for it to set up remote.$x.mirror (which is newly added in next). But then, git-remote doesn't seem to be geared towards pushing at all. -Peff ^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] builtin-remote: resurrect forced updates to tracked branches 2008-04-22 13:09 ` Jeff King @ 2008-04-22 13:26 ` Johannes Schindelin 0 siblings, 0 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 13:26 UTC (permalink / raw) To: Jeff King; +Cc: Mike Galbraith, Junio C Hamano, git During the rewrite of git-remote as a builtin, the ability to force updating the tracked branches (i.e. forcing non-fast-forwards) was lost. This patch fixes that. Noticed by Mike Galbraith, analyzed by Jeff King. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> --- On Tue, 22 Apr 2008, Jeff King wrote: > On Tue, Apr 22, 2008 at 02:03:43PM +0100, Johannes Schindelin wrote: > > > Oh, that's right: only "git remote prune" will delete stale refs only. > > > > But my other point about possibly interfering with local > > branches still holds true. > > In that case, I think that the '+' should come only without > --mirror, and my complaint is then that "--mirror" is a horrible name > for that option. Though when I saw it, I really expected it to do > something about the _push_ line, since that is the only other place we > have a --mirror option. It would make sense to me for it to set up > remote.$x.mirror (which is newly added in next). But then, git-remote > doesn't seem to be geared towards pushing at all. I still think that the --mirror option has merit, but I missed that your patch did fix the behviour _without_ --mirror. This is my attempt. builtin-remote.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/builtin-remote.c b/builtin-remote.c index d4f2132..117ff60 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -114,7 +114,7 @@ static int add(int argc, const char **argv) strbuf_addf(&buf2, "refs/%s:refs/%s", item->path, item->path); else - strbuf_addf(&buf2, "refs/heads/%s:refs/remotes/%s/%s", + strbuf_addf(&buf2, "+refs/heads/%s:refs/remotes/%s/%s", item->path, name, item->path); if (git_config_set_multivar(buf.buf, buf2.buf, "^$", 0)) return 1; ^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 11:58 ` Johannes Schindelin 2008-04-22 12:56 ` Jeff King @ 2008-04-22 17:00 ` Junio C Hamano 1 sibling, 0 replies; 28+ messages in thread From: Junio C Hamano @ 2008-04-22 17:00 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Jeff King, Mike Galbraith, git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: >> Dscho, is this a bug, or was there a conscious decision that I missed? > ... > But as I said, my rationale may very well be wrong. Whatever the rationale was, it is very wrong if the series was about rewriting the scripted version in another language. That is an independent behaviour change. And I do think the fix should be applied to --mirror case as well. If it does not "mirror" as it is told, what use would there be? ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 11:11 ` Jeff King 2008-04-22 11:58 ` Johannes Schindelin @ 2008-04-22 12:41 ` Teemu Likonen 2008-04-22 12:56 ` Johannes Schindelin 1 sibling, 1 reply; 28+ messages in thread From: Teemu Likonen @ 2008-04-22 12:41 UTC (permalink / raw) To: Jeff King; +Cc: Mike Galbraith, Johannes Schindelin, Junio C Hamano, git Jeff King wrote (2008-04-22 07:11 -0400): > remote: create fetch config lines with '+' > > Since git-remote always uses remote tracking branches, it > should be safe to always force updates of those branches. > I.e., we should generate > > fetch = +refs/heads/*:refs/remotes/$remote/* > > instead of > > fetch = refs/heads/*:refs/remotes/$remote/* > > This was the behavior of the perl version, which seems to > have been lost in the C rewrite. I agree, the "+" should be there. I see remote tracking branches as, well, branches that track remote repository - no matter what happens there. Local branches are under user's personal control, so if user wants to save/keep the information of remote branches he can create local ones out of them: git branch localcopy $remote/$branch ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 12:41 ` Teemu Likonen @ 2008-04-22 12:56 ` Johannes Schindelin 2008-04-22 13:01 ` Jeff King ` (2 more replies) 0 siblings, 3 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 12:56 UTC (permalink / raw) To: Teemu Likonen; +Cc: Jeff King, Mike Galbraith, Junio C Hamano, git Hi, On Tue, 22 Apr 2008, Teemu Likonen wrote: > Local branches are under user's personal control, so if user wants to > save/keep the information of remote branches he can create local ones > out of them: git branch localcopy $remote/$branch For your benefit, I just assume that you did not yet read my reply to Peff's mail. With the --mirror mode, you can no longer discern clearly between local and remote branches. This is basically what we had in the beginning, before the "separate remotes layout". So your point is not valid, an update will interfer with "local" branches. And when those branches are deleted via "git fetch", you will not be able to reconstruct them easily, because the reflogs are deleted, too. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 12:56 ` Johannes Schindelin @ 2008-04-22 13:01 ` Jeff King 2008-04-22 13:05 ` Johannes Schindelin 2008-04-22 13:39 ` Teemu Likonen 2008-04-22 16:50 ` Junio C Hamano 2 siblings, 1 reply; 28+ messages in thread From: Jeff King @ 2008-04-22 13:01 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Teemu Likonen, Mike Galbraith, Junio C Hamano, git On Tue, Apr 22, 2008 at 01:56:36PM +0100, Johannes Schindelin wrote: > With the --mirror mode, you can no longer discern clearly between local > and remote branches. This is basically what we had in the beginning, > before the "separate remotes layout". > > So your point is not valid, an update will interfer with "local" branches. > > And when those branches are deleted via "git fetch", you will not be able > to reconstruct them easily, because the reflogs are deleted, too. I think I'm a little confused. Is it possible to delete branches on a fetch? It looks like remote's --mirror option just specifies "don't use separate remote layout". So again, there is no way to blow away reflogs through a fetch. OTOH, if you are using non-separate-remote layout, I think it makes sense to _not_ have the "+". OTOOH, when you call the option --mirror, it makes me think of "push --mirror" which implies "+". -Peff ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 13:01 ` Jeff King @ 2008-04-22 13:05 ` Johannes Schindelin 2008-04-22 13:53 ` Paolo Bonzini 0 siblings, 1 reply; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 13:05 UTC (permalink / raw) To: Jeff King; +Cc: Teemu Likonen, Mike Galbraith, Junio C Hamano, git Hi, On Tue, 22 Apr 2008, Jeff King wrote: > OTOH, if you are using non-separate-remote layout, I think it makes > sense to _not_ have the "+". OTOOH, when you call the option --mirror, > it makes me think of "push --mirror" which implies "+". I am glad somebody else than me finds this to be a dilemma. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 13:05 ` Johannes Schindelin @ 2008-04-22 13:53 ` Paolo Bonzini 0 siblings, 0 replies; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 13:53 UTC (permalink / raw) To: Johannes Schindelin Cc: Jeff King, Teemu Likonen, Mike Galbraith, Junio C Hamano, git Johannes Schindelin wrote: > Hi, > > On Tue, 22 Apr 2008, Jeff King wrote: > >> OTOH, if you are using non-separate-remote layout, I think it makes >> sense to _not_ have the "+". OTOOH, when you call the option --mirror, >> it makes me think of "push --mirror" which implies "+". > > I am glad somebody else than me finds this to be a dilemma. Pushing to a mirror implies a "+". But pulling from a mirror had better not imply a "+", as Dscho pointed out in this thread and implemented in his patch. Non-fast-forward pulls from a non-mirror are safe, so they can imply a "+". Maybe, "git remote add --mirror" should add a "push" line instead of a "fetch" line, and should not allow -f or -t options. Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 12:56 ` Johannes Schindelin 2008-04-22 13:01 ` Jeff King @ 2008-04-22 13:39 ` Teemu Likonen 2008-04-22 13:49 ` Johannes Schindelin 2008-04-22 16:50 ` Junio C Hamano 2 siblings, 1 reply; 28+ messages in thread From: Teemu Likonen @ 2008-04-22 13:39 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Jeff King, Mike Galbraith, Junio C Hamano, git Johannes Schindelin wrote (2008-04-22 13:56 +0100): > With the --mirror mode, you can no longer discern clearly between > local and remote branches. This is basically what we had in the > beginning, before the "separate remotes layout". Hmm, to me it looks like --mirror is for mirroring remote repository and hence the "+" makes sense in here too. It's like "I want to make my repository a copy of that remote repository" hence the name 'mirror'. It'll possibly overwrite local branches but in my way of thinking mirroring implies that possibility. The 'git remote' manual says that --mirror "only makes sense in bare repositories", so the manual seems to guide towards not having local working directory nor changes. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 13:39 ` Teemu Likonen @ 2008-04-22 13:49 ` Johannes Schindelin 2008-04-22 14:04 ` Teemu Likonen 0 siblings, 1 reply; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 13:49 UTC (permalink / raw) To: Teemu Likonen; +Cc: Jeff King, Mike Galbraith, Junio C Hamano, git Hi, On Tue, 22 Apr 2008, Teemu Likonen wrote: > Johannes Schindelin wrote (2008-04-22 13:56 +0100): > > > With the --mirror mode, you can no longer discern clearly between > > local and remote branches. This is basically what we had in the > > beginning, before the "separate remotes layout". > > Hmm, to me it looks like --mirror is for mirroring remote repository and > hence the "+" makes sense in here too. It's like "I want to make my > repository a copy of that remote repository" hence the name 'mirror'. > It'll possibly overwrite local branches but in my way of thinking > mirroring implies that possibility. The 'git remote' manual says that > --mirror "only makes sense in bare repositories", so the manual seems to > guide towards not having local working directory nor changes. Okay, how about this: take Peff's patch, but add a warning if --mirror is used on a non-bare repository? Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 13:49 ` Johannes Schindelin @ 2008-04-22 14:04 ` Teemu Likonen 2008-04-22 14:10 ` Paolo Bonzini 0 siblings, 1 reply; 28+ messages in thread From: Teemu Likonen @ 2008-04-22 14:04 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Jeff King, Mike Galbraith, Junio C Hamano, git Johannes Schindelin wrote (2008-04-22 14:49 +0100): > On Tue, 22 Apr 2008, Teemu Likonen wrote: > > > Hmm, to me it looks like --mirror is for mirroring remote repository > > and hence the "+" makes sense in here too. It's like "I want to make > > my repository a copy of that remote repository" hence the name > > 'mirror'. It'll possibly overwrite local branches but in my way of > > thinking mirroring implies that possibility. The 'git remote' manual > > says that --mirror "only makes sense in bare repositories", so the > > manual seems to guide towards not having local working directory nor > > changes. > > Okay, how about this: take Peff's patch, but add a warning if --mirror > is used on a non-bare repository? Sounds good to me. Indeed, giving a warning is _very_ good idea as --mirror is potentially, even likely, destructive with local changes and working directory. ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 14:04 ` Teemu Likonen @ 2008-04-22 14:10 ` Paolo Bonzini 2008-04-22 15:08 ` Johannes Schindelin 0 siblings, 1 reply; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 14:10 UTC (permalink / raw) To: Teemu Likonen Cc: Johannes Schindelin, Jeff King, Mike Galbraith, Junio C Hamano, git >> Okay, how about this: take Peff's patch, but add a warning if --mirror >> is used on a non-bare repository? > > Sounds good to me. Indeed, giving a warning is _very_ good idea as > --mirror is potentially, even likely, destructive with local changes and > working directory. What about changing --mirror to add a push line instead of a fetch line? Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 14:10 ` Paolo Bonzini @ 2008-04-22 15:08 ` Johannes Schindelin 2008-04-22 15:26 ` Paolo Bonzini 0 siblings, 1 reply; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 15:08 UTC (permalink / raw) To: Paolo Bonzini; +Cc: git, Jeff King, Mike Galbraith, Junio C Hamano Hi, On Tue, 22 Apr 2008, Paolo Bonzini wrote: > > > Okay, how about this: take Peff's patch, but add a warning if > > > --mirror is used on a non-bare repository? > > > > Sounds good to me. Indeed, giving a warning is _very_ good idea as > > --mirror is potentially, even likely, destructive with local changes > > and working directory. > > What about changing --mirror to add a push line instead of a fetch line? I would not expect --mirror to add a push line when "git-remote add" without --mirror does not a push line either. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 15:08 ` Johannes Schindelin @ 2008-04-22 15:26 ` Paolo Bonzini 2008-04-22 16:23 ` Paolo Bonzini 0 siblings, 1 reply; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 15:26 UTC (permalink / raw) To: Johannes Schindelin; +Cc: git, Jeff King, Mike Galbraith, Junio C Hamano Johannes Schindelin wrote: > Hi, > > On Tue, 22 Apr 2008, Paolo Bonzini wrote: > >>>> Okay, how about this: take Peff's patch, but add a warning if >>>> --mirror is used on a non-bare repository? >>> Sounds good to me. Indeed, giving a warning is _very_ good idea as >>> --mirror is potentially, even likely, destructive with local changes >>> and working directory. >> What about changing --mirror to add a push line instead of a fetch line? > > I would not expect --mirror to add a push line when "git-remote add" > without --mirror does not a push line either. Let me reverse the question. When does it make sense to use "git-remote add --mirror" with the current implementation? It's not a rhetoric question. I know when it would make sense to have push refspecs on a remote for which you plan to use "git push --mirror" (and in "next", that is the case if you create the remote with "git-remote add --mirror"). But I'm a total newbie for things that do not fit my workflows, so I don't know when it would make sense to pull from that kind of remote. Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 15:26 ` Paolo Bonzini @ 2008-04-22 16:23 ` Paolo Bonzini 2008-04-22 16:42 ` Johannes Schindelin 0 siblings, 1 reply; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 16:23 UTC (permalink / raw) Cc: Johannes Schindelin, git, Jeff King, Mike Galbraith, Junio C Hamano >>> What about changing --mirror to add a push line instead of a fetch line? >> >> I would not expect --mirror to add a push line when "git-remote add" >> without --mirror does not a push line either. > > Let me reverse the question. When does it make sense to use "git-remote > add --mirror" with the current implementation? > > It's not a rhetoric question. I know when it would make sense to have > push refspecs on a remote for which you plan to use "git push --mirror" > (and in "next", that is the case if you create the remote with > "git-remote add --mirror"). But I'm a total newbie for things that do > not fit my workflows, so I don't know when it would make sense to pull > from that kind of remote. And actually, I just realized that what I expected from --mirror is this: [remote "mirror"] url = blah fetch = +refs/heads/*:refs/remotes/mirror/* push = +refs/heads/*:refs/heads/* mirror ... so that I can check the state of the mirror with "git log -1 mirror/master", and still the push refspec is there so that my local remotes are not entirely mirrored. Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 16:23 ` Paolo Bonzini @ 2008-04-22 16:42 ` Johannes Schindelin 0 siblings, 0 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 16:42 UTC (permalink / raw) To: Paolo Bonzini; +Cc: git, Jeff King, Mike Galbraith, Junio C Hamano Hi, On Tue, 22 Apr 2008, Paolo Bonzini wrote: > > > > What about changing --mirror to add a push line instead of a fetch > > > > line? > > > > > > I would not expect --mirror to add a push line when "git-remote add" > > > without --mirror does not a push line either. > > > > Let me reverse the question. When does it make sense to use > > "git-remote add --mirror" with the current implementation? > > > > It's not a rhetoric question. I know when it would make sense to have push > > refspecs on a remote for which you plan to use "git push --mirror" (and in > > "next", that is the case if you create the remote with "git-remote add > > --mirror"). But I'm a total newbie for things that do not fit my workflows, > > so I don't know when it would make sense to pull from that kind of remote. > > And actually, I just realized that what I expected from --mirror is this: > > [remote "mirror"] > url = blah > fetch = +refs/heads/*:refs/remotes/mirror/* > push = +refs/heads/*:refs/heads/* > mirror > > ... so that I can check the state of the mirror with "git log -1 > mirror/master", and still the push refspec is there so that my local remotes > are not entirely mirrored. AFAICT this contradicts everything in the original thread resulting in the --mirror patch. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: git remote update -> rejected 2008-04-22 12:56 ` Johannes Schindelin 2008-04-22 13:01 ` Jeff King 2008-04-22 13:39 ` Teemu Likonen @ 2008-04-22 16:50 ` Junio C Hamano 2008-04-22 17:23 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories Johannes Schindelin 2 siblings, 1 reply; 28+ messages in thread From: Junio C Hamano @ 2008-04-22 16:50 UTC (permalink / raw) To: Johannes Schindelin; +Cc: Teemu Likonen, Jeff King, Mike Galbraith, git Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > For your benefit, I just assume that you did not yet read my reply to > Peff's mail. > > With the --mirror mode, you can no longer discern clearly between local > and remote branches. This is basically what we had in the beginning, > before the "separate remotes layout". > > So your point is not valid, an update will interfer with "local" branches. I personally do not think _your_ point is valid. Doesn't --mirror mean you do not have local branches? At least that was my understanding of the intention of the --mirror option. You give control away to the other end on the ref namespace, so that you can treat it as a, eh, "mirror". Perhaps you would want to have a single such repository behind a firewall or this side of slow link and use it as a feeder repository to serve many other clones on this side. I personally do not think --mirror option makes sense with --track, nor it makes sense in a non-bare repository for that matter. ^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH] remote add: disallow --master and --mirror with non-bare repositories 2008-04-22 16:50 ` Junio C Hamano @ 2008-04-22 17:23 ` Johannes Schindelin 2008-04-22 18:45 ` Paolo Bonzini 2008-04-22 18:46 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) Paolo Bonzini 0 siblings, 2 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 17:23 UTC (permalink / raw) To: Junio C Hamano; +Cc: Teemu Likonen, Jeff King, Mike Galbraith, git In most cases, --master or --mirror in a non-bare repository is an error. In those cases where it is not, the user is most likely editing the config herself anyway. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> --- On Tue, 22 Apr 2008, Junio C Hamano wrote: > I personally do not think --mirror option makes sense with > --track, nor it makes sense in a non-bare repository for that matter. Obviously meant for application together with Peff's patch. builtin-remote.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/builtin-remote.c b/builtin-remote.c index d4f2132..63f025c 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -79,6 +79,12 @@ static int add(int argc, const char **argv) argc = parse_options(argc, argv, options, builtin_remote_usage, 0); + if (mirror && is_bare_repository()) + die("--mirror with non-bare repository."); + + if (master && is_bare_repository()) + die("--master with non-bare repository."); + if (argc < 2) usage_with_options(builtin_remote_usage, options); ^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH] remote add: disallow --master and --mirror with non-bare repositories 2008-04-22 17:23 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories Johannes Schindelin @ 2008-04-22 18:45 ` Paolo Bonzini 2008-04-22 18:46 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) Paolo Bonzini 1 sibling, 0 replies; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 18:45 UTC (permalink / raw) To: Johannes Schindelin Cc: Junio C Hamano, Teemu Likonen, Jeff King, Mike Galbraith, git Johannes Schindelin wrote: > In most cases, --master or --mirror in a non-bare repository is an > error. In those cases where it is not, the user is most likely editing > the config herself anyway. Ah, so I think we're speaking about two different features... sorry for the noise. Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) 2008-04-22 17:23 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories Johannes Schindelin 2008-04-22 18:45 ` Paolo Bonzini @ 2008-04-22 18:46 ` Paolo Bonzini 2008-04-22 22:04 ` Johannes Schindelin 1 sibling, 1 reply; 28+ messages in thread From: Paolo Bonzini @ 2008-04-22 18:46 UTC (permalink / raw) To: git; +Cc: Junio C Hamano, Teemu Likonen, Jeff King, Mike Galbraith, git > + if (mirror && is_bare_repository()) > + die("--mirror with non-bare repository."); > + Missing bang. I think you need to adjust the testsuite, in fact. Paolo ^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) 2008-04-22 18:46 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) Paolo Bonzini @ 2008-04-22 22:04 ` Johannes Schindelin 0 siblings, 0 replies; 28+ messages in thread From: Johannes Schindelin @ 2008-04-22 22:04 UTC (permalink / raw) To: Paolo Bonzini Cc: Junio C Hamano, Teemu Likonen, Jeff King, Mike Galbraith, git Hi, On Tue, 22 Apr 2008, Paolo Bonzini wrote: > > + if (mirror && is_bare_repository()) > > + die("--mirror with non-bare repository."); > > + > > Missing bang. I think you need to adjust the testsuite, in fact. Yep, I probably do. If Junio nobody else beats me to it. Ciao, Dscho ^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2008-04-22 22:05 UTC | newest] Thread overview: 28+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-04-22 9:48 git remote update -> rejected Mike Galbraith 2008-04-22 10:34 ` Jeff King 2008-04-22 10:55 ` Mike Galbraith 2008-04-22 11:11 ` Jeff King 2008-04-22 11:58 ` Johannes Schindelin 2008-04-22 12:56 ` Jeff King 2008-04-22 13:03 ` Johannes Schindelin 2008-04-22 13:09 ` Jeff King 2008-04-22 13:26 ` [PATCH] builtin-remote: resurrect forced updates to tracked branches Johannes Schindelin 2008-04-22 17:00 ` git remote update -> rejected Junio C Hamano 2008-04-22 12:41 ` Teemu Likonen 2008-04-22 12:56 ` Johannes Schindelin 2008-04-22 13:01 ` Jeff King 2008-04-22 13:05 ` Johannes Schindelin 2008-04-22 13:53 ` Paolo Bonzini 2008-04-22 13:39 ` Teemu Likonen 2008-04-22 13:49 ` Johannes Schindelin 2008-04-22 14:04 ` Teemu Likonen 2008-04-22 14:10 ` Paolo Bonzini 2008-04-22 15:08 ` Johannes Schindelin 2008-04-22 15:26 ` Paolo Bonzini 2008-04-22 16:23 ` Paolo Bonzini 2008-04-22 16:42 ` Johannes Schindelin 2008-04-22 16:50 ` Junio C Hamano 2008-04-22 17:23 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories Johannes Schindelin 2008-04-22 18:45 ` Paolo Bonzini 2008-04-22 18:46 ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) Paolo Bonzini 2008-04-22 22:04 ` Johannes Schindelin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).