{"thread":{"id":"6128","subject":"branch.pu.forcefetch","startedAt":"2006-12-27T20:31:59Z","lastAt":"2006-12-29T16:39:28Z","messageCount":14,"participants":["Pavel Roskin","Jakub Narebski","Junio C Hamano","Shawn Pearce","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30360","messageId":"1167251519.2247.10.camel@dv","threadId":"6128","inReplyTo":null,"subject":"branch.pu.forcefetch","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-12-27T20:31:59Z","receivedAt":"2006-12-27T20:31:59Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nI'm testing the current git from the master branch, and I like the idea\nof moving the remotes to the config file, but I think there is a\nsignificant omission in the new syntax.  There is no way to specify that\nsome branches are fast forward.\n\nFor example, I clone the git repository anew, and I try to update it by\ngit-fetch a few days later.  I get an error:\n\n* refs/remotes/origin/pu: not updating to non-fast forward branch 'pu'\nof git://www.kernel.org/pub/scm/git/git\n\nIt would be great to have a \"non-fastforward\" option in the config file\nfor every branch.  I'm thinking about something like:\n\n[branch \"pu\"]\n        forcefetch = 1\n\nIt would be even better to initialize such option while cloning.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"30362","messageId":"emunic$fn$1@sea.gmane.org","threadId":"6128","inReplyTo":"1167251519.2247.10.camel@dv","subject":"Re: branch.pu.forcefetch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-27T21:14:27Z","receivedAt":"2006-12-27T21:14:27Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Pavel Roskin wrote:\n\n> I'm testing the current git from the master branch, and I like the idea\n> of moving the remotes to the config file, but I think there is a\n> significant omission in the new syntax.  There is no way to specify that\n> some branches are fast forward.\n> \n> For example, I clone the git repository anew, and I try to update it by\n> git-fetch a few days later.  I get an error:\n> \n> * refs/remotes/origin/pu: not updating to non-fast forward branch 'pu'\n> of git://www.kernel.org/pub/scm/git/git\n> \n> It would be great to have a \"non-fastforward\" option in the config file\n> for every branch. I'm thinking about something like: \n> \n> [branch \"pu\"]\n>         forcefetch = 1\n\nCurrently the old '+' before refspec still works. So you should have\n[remote \"origin\"]\n        # ...\n        fetch = +refs/heads/pu:refs/remotes/origin/pu\n\n> It would be even better to initialize such option while cloning.\n\nThere was some talk about this, but I don't remember if there were any code.\n\nActually the talk was about marking branch as non-fast-forwardable (which\nis meant to have rewritten history) on _server_ side, and allowing to\nfetch all/parts of config while cloning to get this info.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"30363","messageId":"7vfyb159dn.fsf@assigned-by-dhcp.cox.net","threadId":"6128","inReplyTo":"1167251519.2247.10.camel@dv","subject":"Re: branch.pu.forcefetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-27T21:14:44Z","receivedAt":"2006-12-27T21:14:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> For example, I clone the git repository anew, and I try to update it by\n> git-fetch a few days later.  I get an error:\n>\n> * refs/remotes/origin/pu: not updating to non-fast forward branch 'pu'\n> of git://www.kernel.org/pub/scm/git/git\n\nPerhaps you would want something like this?\n\nif you are using separate remote layout:\n\n[remote \"origin\"]\n\tfetch = +refs/heads/pu:refs/remotes/origin/pu\n\tfetch = refs/heads/*:refs/remotes/origin/*\n\nOr traditional layout:\n\n[remote \"origin\"]\n\tfetch = refs/heads/master:refs/heads/origin\n\tfetch = refs/heads/next:refs/heads/next\n\tfetch = refs/heads/maint:refs/heads/maint\n\tfetch = +refs/heads/pu:refs/remotes/pu\n"},{"id":"30364","messageId":"emuntl$fn$2@sea.gmane.org","threadId":"6128","inReplyTo":"7vfyb159dn.fsf@assigned-by-dhcp.cox.net","subject":"Re: branch.pu.forcefetch","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-12-27T21:20:36Z","receivedAt":"2006-12-27T21:20:36Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Pavel Roskin <proski@gnu.org> writes:\n> \n>> For example, I clone the git repository anew, and I try to update it by\n>> git-fetch a few days later.  I get an error:\n>>\n>> * refs/remotes/origin/pu: not updating to non-fast forward branch 'pu'\n>> of git://www.kernel.org/pub/scm/git/git\n> \n> Perhaps you would want something like this?\n> \n> if you are using separate remote layout:\n> \n> [remote \"origin\"]\n>       fetch = +refs/heads/pu:refs/remotes/origin/pu\n>       fetch = refs/heads/*:refs/remotes/origin/*\n\nBy the way, does the ordering matter here, i.e. does it matter if 'pu' fetch\nline is before or after wildcards line?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"30443","messageId":"1167341346.12660.17.camel@dv","threadId":"6128","inReplyTo":"7vfyb159dn.fsf@assigned-by-dhcp.cox.net","subject":"Re: branch.pu.forcefetch","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-12-28T21:29:06Z","receivedAt":"2006-12-28T21:29:06Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nOn Wed, 2006-12-27 at 13:14 -0800, Junio C Hamano wrote:\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> > For example, I clone the git repository anew, and I try to update it by\n> > git-fetch a few days later.  I get an error:\n> >\n> > * refs/remotes/origin/pu: not updating to non-fast forward branch 'pu'\n> > of git://www.kernel.org/pub/scm/git/git\n> \n> Perhaps you would want something like this?\n> \n> if you are using separate remote layout:\n> \n> [remote \"origin\"]\n> \tfetch = +refs/heads/pu:refs/remotes/origin/pu\n> \tfetch = refs/heads/*:refs/remotes/origin/*\n\nThat works.\n\nActually, it's strange that I don't actually have refs/heads/pu\nunder .git, and it doesn't get created even if I run \"git-pull\" or\n\"git-pull origin pu\".\n\nI realize that I'm far behind in my understanding of GIT, but it seems\nto me that something is wrong in the new layout.\n\nWe have a line that says: \"pull from pu branch of origin and merge it\ninto local pu branch even if fast-forward is impossible\".  However,\nthere it no local pu branch.  Yet not having this line blocks updating\nof master branch.\n\nIt's like saying: I won't update master branch because there is another\nbranch that you are not tracking locally, but if you were, it would not\nfast forward.  Seems quite perverse to me.\n\nMy .git/config file is:\n\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        logallrefupdates = true\n[remote \"origin\"]\n        url = git://www.kernel.org/pub/scm/git/git.git\n        fetch = refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n        remote = origin\n        merge = refs/heads/master\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"30446","messageId":"7vzm97tzbt.fsf@assigned-by-dhcp.cox.net","threadId":"6128","inReplyTo":"1167341346.12660.17.camel@dv","subject":"Re: branch.pu.forcefetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-28T22:44:54Z","receivedAt":"2006-12-28T22:44:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"[jc: some people CC'ed because I'll talk about logallrefupdates\n at the end]\n\nPavel Roskin <proski@gnu.org> writes:\n\n> Actually, it's strange that I don't actually have refs/heads/pu\n> under .git, and it doesn't get created even if I run \"git-pull\" or\n> \"git-pull origin pu\".\n\n\"git-pull\" without argument (and \"git-pull origin\") are affected\nby the config (and .git/remotes/origin), so we will look at your\nconfig later.\n\nWith \"git-pull origin pu\", you are saying \"use URL for origin\nbut this time I am not interested in the set of branches to\nfetch by default specified in my config\".  And single token \"pu\"\nmeans you do not want to store the fetch result in any tracking\nbranch (otherwise you would explicitly say \"pu:refs/heads/pu\" or\n\"pu:/refs/remotes/origin/pu\").\n\n> We have a line that says: \"pull from pu branch of origin and merge it\n> into local pu branch even if fast-forward is impossible\".\n\nAre you talking about \"remote.origin.fetch = +pu:refs/heads/pu\"?\n\nIf so, the line does _not_ say that.  It does not talk about\npulling nor merging.  What it says is \"My refs/heads/pu is used\nas a tracking branch for keeping track of the progress of his\n'pu'; because I know he rewinds and rebases, please override the\nfast-forward check when you store the updated value of his 'pu'\nto my 'refs/heads/pu'\".\n\n> However,\n> there it no local pu branch.  Yet not having this line blocks updating\n> of master branch.\n\nNow that is worrisome.  \"git pull\"  and \"git pull origin\" (but\nnot \"git pull pu\" for the reason I mentioned earlier) should\ncreate your \"pu\" branch if you have the configuration.\n\nLet me understand the situation.  Your config file is:\n\n> My .git/config file is:\n>\n> [core]\n>         repositoryformatversion = 0\n>         filemode = true\n>         logallrefupdates = true\n> [remote \"origin\"]\n>         url = git://www.kernel.org/pub/scm/git/git.git\n>         fetch = refs/heads/*:refs/remotes/origin/*\n> [branch \"master\"]\n>         remote = origin\n>         merge = refs/heads/master\n\nSo you may not have refs/heads/pu (iow, you do not build on top\nof my 'pu'), but the config says refs/remotes/origin/ is used to\ntrack all my branches.  Do you have refs/remotes/origin/pu?\n\nIf so, then \"git fetch\" would error out exactly because 'pu'\nwould not fast forward and the config says it does not allow\nnon-fast-forward fetch.\n\nIt might make sense to make the default configuration git\nclone creates to say\n\n        [remote \"origin\"]\n                url = git://www.kernel.org/pub/scm/git/git.git\n                fetch = +refs/heads/*:refs/remotes/origin/*\n\ninstead.\n\nI think I suggested this once but vaguely recall some people\nobjected, for the reason that an unusual situation such as\nnon-fast-forward should always error out for safety and should\nrequire an explicit override by the user.\n\nBut come to think of it, I think failing to update the remote\ntracking branch for non-fast-forward does not buy us very much.\nLetting the user to be aware of the situation has value, but at\nthat point, I do not think there is much else the user can do.\nThe purpose of the tracking branches is to track what happens on\nthe remote side, and the user is in no position to override what\nhas already happend on the remote side (otherwise it stops being\n\"tracking branches\").  If reflogs are enabled on remote tracking\nbraches, you can always get back the older state if you wanted\nto.\n\nThat makes me notice another thing.  We do not seem to create\nreflog for remotes/ hierarchy even when logallrefupdates is set\nto true.  Would people object if we did this?\n\ndiff --git a/refs.c b/refs.c\nindex 8b2a3c1..e88ed8b 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -925,7 +925,8 @@ static int log_ref_write(struct ref_lock *lock,\n \tconst char *committer;\n \n \tif (log_all_ref_updates &&\n-\t    !strncmp(lock->ref_name, \"refs/heads/\", 11)) {\n+\t    (!strncmp(lock->ref_name, \"refs/heads/\", 11) ||\n+\t     !strncmp(lock->ref_name, \"refs/remotes/\", 13))) {\n \t\tif (safe_create_leading_directories(lock->log_file) < 0)\n \t\t\treturn error(\"unable to create directory for %s\",\n \t\t\t\tlock->log_file);\n"},{"id":"30450","messageId":"7vodpntud6.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6128","inReplyTo":"7vzm97tzbt.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH 1/2] core.logallrefupdates: log remotes/ tracking branches.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-29T00:32:05Z","receivedAt":"2006-12-29T00:32:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Not using reflog for tags/ was very sensible; not giving reflog\nfor the remotes/ was not.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n refs.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 8b2a3c1..e88ed8b 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -925,7 +925,8 @@ static int log_ref_write(struct ref_lock *lock,\n \tconst char *committer;\n \n \tif (log_all_ref_updates &&\n-\t    !strncmp(lock->ref_name, \"refs/heads/\", 11)) {\n+\t    (!strncmp(lock->ref_name, \"refs/heads/\", 11) ||\n+\t     !strncmp(lock->ref_name, \"refs/remotes/\", 13))) {\n \t\tif (safe_create_leading_directories(lock->log_file) < 0)\n \t\t\treturn error(\"unable to create directory for %s\",\n \t\t\t\tlock->log_file);\n-- \n1.5.0.rc0.gf5c587\n"},{"id":"30451","messageId":"7vk60btucu.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6128","inReplyTo":"7vzm97tzbt.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH 2/2] Allow non-fast-forward of remote tracking branches in default clone","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-29T00:32:17Z","receivedAt":"2006-12-29T00:32:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This changes the default remote.origin.fetch configuration\ncreated by git-clone so that it allows non-fast-forward updates.\n\nWhen using the separate-remote layout with reflog enabled, it\ndoes not make much sense to refuse to update the remote tracking\nbranch just because some of them do not fast-forward.  git-fetch\nissues warnings on non-fast-forwardness, and the user can peek\nat what the previous state was using the reflog.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n git-clone.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex f37eb9d..3d388de 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -388,7 +388,7 @@ then\n \n \t\t# Set up the mappings to track the remote branches.\n \t\tgit-repo-config remote.\"$origin\".fetch \\\n-\t\t\t\"refs/heads/*:$remote_top/*\" '^$' &&\n+\t\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n \t\trm -f \"refs/remotes/$origin/HEAD\"\n \t\tgit-symbolic-ref \"refs/remotes/$origin/HEAD\" \\\n \t\t\t\"refs/remotes/$origin/$head_points_at\" &&\n-- \n1.5.0.rc0.gf5c587\n"},{"id":"30453","messageId":"1167355326.15189.34.camel@dv","threadId":"6128","inReplyTo":"7vzm97tzbt.fsf@assigned-by-dhcp.cox.net","subject":"Re: branch.pu.forcefetch","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-12-29T01:22:06Z","receivedAt":"2006-12-29T01:22:06Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Thu, 2006-12-28 at 14:44 -0800, Junio C Hamano wrote: \n> [jc: some people CC'ed because I'll talk about logallrefupdates\n>  at the end]\n\nOK.\n\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> > Actually, it's strange that I don't actually have refs/heads/pu\n> > under .git, and it doesn't get created even if I run \"git-pull\" or\n> > \"git-pull origin pu\".\n> \n> \"git-pull\" without argument (and \"git-pull origin\") are affected\n> by the config (and .git/remotes/origin), so we will look at your\n> config later.\n> \n> With \"git-pull origin pu\", you are saying \"use URL for origin\n> but this time I am not interested in the set of branches to\n> fetch by default specified in my config\".  And single token \"pu\"\n> means you do not want to store the fetch result in any tracking\n> branch (otherwise you would explicitly say \"pu:refs/heads/pu\" or\n> \"pu:/refs/remotes/origin/pu\").\n\nOK, I'm going to take a \"bird's view\" of it.  If you happen to think I'm\nsaying stupid things, it's just because I'm playing an even less\nexperienced user than I am.\n\nI don't think it's a good idea to expose the layout under .git to the\nend user.  I do realize that git is just \"plumbing\", but things like\n\"refs/heads/\" should probably be hidden from the user in any case.\nUsing path as an indicator that something should be saved looks like a\nkludge.\n\nMaybe we could have a notation for branches on remotes (e.g. pu@origin\nor origin#pu), tracking branches and non-tracking branches?  I would be\nhappy if the same name could be used for all of them.  After all, that's\nthe way CVS and Subversion do it, and it's fine for most users.  As for\nthe locations under refs, let's leave it to git.\n\n> > We have a line that says: \"pull from pu branch of origin and merge it\n> > into local pu branch even if fast-forward is impossible\".\n> \n> Are you talking about \"remote.origin.fetch = +pu:refs/heads/pu\"?\n\nYes, I'm talking about that line.  And I don't like that I have to use a\nmagic token \"refs/heads/pu\" that doesn't correspond to a real file to\nmake it possible to keep git up-to-date.\n\n[skip]\n\n> > However,\n> > there it no local pu branch.  Yet not having this line blocks updating\n> > of master branch.\n> \n> Now that is worrisome.  \"git pull\"  and \"git pull origin\" (but\n> not \"git pull pu\" for the reason I mentioned earlier) should\n> create your \"pu\" branch if you have the configuration.\n> \n> Let me understand the situation.  Your config file is:\n> \n> > My .git/config file is:\n> >\n> > [core]\n> >         repositoryformatversion = 0\n> >         filemode = true\n> >         logallrefupdates = true\n> > [remote \"origin\"]\n> >         url = git://www.kernel.org/pub/scm/git/git.git\n> >         fetch = refs/heads/*:refs/remotes/origin/*\n> > [branch \"master\"]\n> >         remote = origin\n> >         merge = refs/heads/master\n> \n> So you may not have refs/heads/pu (iow, you do not build on top\n> of my 'pu'), but the config says refs/remotes/origin/ is used to\n> track all my branches.  Do you have refs/remotes/origin/pu?\n\nYes.  I'm doing a clean checkout now with the current git from the\n\"master\" branch:\n\n[proski@dv git]$ git-clone git://www.kernel.org/pub/scm/git/git.git\nInitialized empty Git repository in /home/proski/tmp/git/git/.git/\nremote: Generating pack...\nremote: Done counting 35273 objects.\nremote: Deltifying 35273 objects.\nremote:  100% (35273/35273) done\nIndexing 35273 objects.\nremote: Total 35273, written 35273 (delta 24484), reused 35217 (delta 24444)\n 100% (35273/35273) done\nResolving 24484 deltas.\n 100% (24484/24484) done\nChecking files out...\n 100% (761/761) done\n[proski@dv git]$ git --version\ngit version 1.5.0.rc0.g4a4d\n[proski@dv git]$ ls git/.git/refs/remotes/origin/\nHEAD  html  maint  man  master  next  pu  todo\n[proski@dv git]$ ls git/.git/refs/heads/         \nmaster\n[proski@dv git]$ cd git/\n[proski@dv git]$ git-pull\nAlready up-to-date.\n[proski@dv git]$ ls .git/refs/heads/\nmaster\n[proski@dv git]$\n\n> If so, then \"git fetch\" would error out exactly because 'pu'\n> would not fast forward and the config says it does not allow\n> non-fast-forward fetch.\n> \n> It might make sense to make the default configuration git\n> clone creates to say\n> \n>         [remote \"origin\"]\n>                 url = git://www.kernel.org/pub/scm/git/git.git\n>                 fetch = +refs/heads/*:refs/remotes/origin/*\n> \n> instead.\n> \n> I think I suggested this once but vaguely recall some people\n> objected, for the reason that an unusual situation such as\n> non-fast-forward should always error out for safety and should\n> require an explicit override by the user.\n\nIn this particular case of the GIT project, it's very rare that I would\nbe interested in the \"pu\" branch.  I'm mostly interested in \"master\",\nand I can be occasionally interested in \"next\".\n\nThe default for git-clone is to clone all branches.  It's OK for me\nbecause I'm on a fast connection (I hear angry voices of modem users).\nActually, I don't see an option to git-clone to clone HEAD or selected\nbranches only.  The \"-o\" option seems to be something different, even\nthough the manual mention branches.\n\nUnfortunately, updating the current branch fails because pu is not\nfast-forwarding.  Why fail if I'm not even on pu?\n\nIn other words, the basic default functionality is hampered because of a\nbranch the user is not even using in any way.  And the fix involves\nediting the config file.\n\n> But come to think of it, I think failing to update the remote\n> tracking branch for non-fast-forward does not buy us very much.\n> Letting the user to be aware of the situation has value, but at\n> that point, I do not think there is much else the user can do.\n> The purpose of the tracking branches is to track what happens on\n> the remote side, and the user is in no position to override what\n> has already happend on the remote side (otherwise it stops being\n> \"tracking branches\").  If reflogs are enabled on remote tracking\n> braches, you can always get back the older state if you wanted\n> to.\n\nI tend to agree.  Of course, if any porcelains require or prefer\nfast-forward, they should be able to prevent non-fast-forward updates.\nPerhaps they would be OK with non-fast-forward updates on branches other\nthan those they are specifically managing?\n\n> That makes me notice another thing.  We do not seem to create\n> reflog for remotes/ hierarchy even when logallrefupdates is set\n> to true.  Would people object if we did this?\n\nNo objection on my part.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"30457","messageId":"7v8xgrsabr.fsf@assigned-by-dhcp.cox.net","threadId":"6128","inReplyTo":"1167355326.15189.34.camel@dv","subject":"Re: branch.pu.forcefetch","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-29T02:30:16Z","receivedAt":"2006-12-29T02:30:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n>> Are you talking about \"remote.origin.fetch = +pu:refs/heads/pu\"?\n>\n> Yes, I'm talking about that line.  And I don't like that I have to use a\n> magic token \"refs/heads/pu\" that doesn't correspond to a real file to\n> make it possible to keep git up-to-date.\n\nI think we misunderstood each other.  That line is inconsistent\nwith what your config has, which is the separate-remote layout,\nwhich I did not know you were using.  In separate-remote layout,\nyou don't have refs/heads/pu so if we do not do the patches you\nare agreeing to, you would want to have something like:\n\n\t[remote \"origin\"]\n                fetch = +refs/heads/pu:refs/remotes/origin/pu\n        \tfetch = refs/heads/*:refs/remotes/origin/*\n\nIn other words, \"path does not correspond to a real file\"\nproblem does not exist.  If you tell git to track 'pu' at\nrefs/remotes/origin/pu, it will use that path -- so that path\nhas a corresponding real file.\n\n> Unfortunately, updating the current branch fails because pu is not\n> fast-forwarding.  Why fail if I'm not even on pu?\n\nYour being not on 'pu' does not have anything to do with it.  In\nfact, you do not even want to be _on_ any of your tracking\nbranches.  In the separate-remote layout, you cannot even be on\nremotes/origin/pu branch.\n\nWhat you are seeing is fetch's safety feature that stops and\nnotifies you the situation when the remote rewinds/rebases the\nbranch you are tracking with tracking branches.  We have had it\nturned on by default for a long time, and you have it turned on\nin your config because that is the default.  If you do not want\nto use that feature (and for git.git, you certainly don't), just\nturn it off.  When you know you do not want to use a feature,\nyou do not have to.\n\nTurning it off by default was not a wise thing to do in general\nfor a long time, because rewound/rebased tip loses information,\nand we did not have reflog enabled by default.  Your message\nraised this issue to attention of the list, and I suggested two\npatches out of it, both of which I think are sane things to do.\nIf the list agrees, we can turn it off by default now.\n"},{"id":"30459","messageId":"1167363263.15189.79.camel@dv","threadId":"6128","inReplyTo":"7v8xgrsabr.fsf@assigned-by-dhcp.cox.net","subject":"Re: branch.pu.forcefetch","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-12-29T03:34:23Z","receivedAt":"2006-12-29T03:34:23Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Thu, 2006-12-28 at 18:30 -0800, Junio C Hamano wrote:\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> >> Are you talking about \"remote.origin.fetch = +pu:refs/heads/pu\"?\n> >\n> > Yes, I'm talking about that line.  And I don't like that I have to use a\n> > magic token \"refs/heads/pu\" that doesn't correspond to a real file to\n> > make it possible to keep git up-to-date.\n> \n> I think we misunderstood each other.\n\nI just didn't notice that your question used a different line.  I was\ntalking about\n\n\tfetch = +refs/heads/pu:refs/remotes/origin/pu\n\n> That line is inconsistent\n> with what your config has, which is the separate-remote layout,\n> which I did not know you were using.  In separate-remote layout,\n> you don't have refs/heads/pu so if we do not do the patches you\n> are agreeing to, you would want to have something like:\n> \n> \t[remote \"origin\"]\n>                 fetch = +refs/heads/pu:refs/remotes/origin/pu\n>         \tfetch = refs/heads/*:refs/remotes/origin/*\n\nI get it now.  \"refs/heads/pu\" must be the path on the remote side.\n\nThe whole thing remains pretty hairy for my taste, but it looks like we\nare going to untangle it step-by-step.\n\n> Turning it off by default was not a wise thing to do in general\n> for a long time, because rewound/rebased tip loses information,\n> and we did not have reflog enabled by default.  Your message\n> raised this issue to attention of the list, and I suggested two\n> patches out of it, both of which I think are sane things to do.\n> If the list agrees, we can turn it off by default now.\n\nJust a random idea - if fast-forward fails, save the original head\nsomewhere under refs as a backup.  It's like \"patch\" saving *.orig files\nif there is any doubt that the patch was applied cleanly.\n\nBut I'm fine with reflog too.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"30461","messageId":"20061229043157.GB12072@spearce.org","threadId":"6128","inReplyTo":"1167363263.15189.79.camel@dv","subject":"Re: branch.pu.forcefetch","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-29T04:31:57Z","receivedAt":"2006-12-29T04:31:57Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Pavel Roskin <proski@gnu.org> wrote:\n> Just a random idea - if fast-forward fails, save the original head\n> somewhere under refs as a backup.  It's like \"patch\" saving *.orig files\n> if there is any doubt that the patch was applied cleanly.\n\nThat's the entire point of the reflog.  :-)\n\n-- \nShawn.\n"},{"id":"30462","messageId":"20061229043525.GC12072@spearce.org","threadId":"6128","inReplyTo":"7vk60btucu.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/2] Allow non-fast-forward of remote tracking branches in default clone","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-29T04:35:25Z","receivedAt":"2006-12-29T04:35:25Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> This changes the default remote.origin.fetch configuration\n> created by git-clone so that it allows non-fast-forward updates.\n\nAck'd, but only if '[PATCH 1/2] core.logallrefupdates: log remotes/\ntracking branches.' is also applied.\n\nI think both are worth applying.\n\n-- \nShawn.\n"},{"id":"30476","messageId":"Pine.LNX.4.63.0612291737490.19693@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6128","inReplyTo":"7vk60btucu.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/2] Allow non-fast-forward of remote tracking branches in default clone","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-29T16:39:28Z","receivedAt":"2006-12-29T16:39:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 28 Dec 2006, Junio C Hamano wrote:\n\n>  \t\tgit-repo-config remote.\"$origin\".fetch \\\n> -\t\t\t\"refs/heads/*:$remote_top/*\" '^$' &&\n> +\t\t\t\"+refs/heads/*:$remote_top/*\" '^$' &&\n\nMinor nit: these days, it is cleaner (and clearer) to use \"git-repo-config \n--add\" instead of using the \"^$\" construct yourself. However, I don't \nthink this patch has to be changed.\n\nCiao,\nDscho\n"}]}