
I'm trying desperately to follow the instructions on https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules for how to update haddock to follow a small change to GHC. I've checked out the haddock master, made my patch, and want to push to haddock. But my push is rejected for an inscrutable reason: git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # nothing to commit (working directory clean) simonpj@cam-05-unx:~/code/HEAD-2/utils/haddock$ git push Counting objects: 9, done. Delta compression using up to 32 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 470 bytes, done. Total 5 (delta 4), reused 0 (delta 0) remote: W refs/heads/master haddock simonpj DENIED by refs/.* remote: error: hook declined to update refs/heads/master To ssh://git@ghc.haskell.org/haddock.git ! [remote rejected] HEAD -> master (hook declined) error: failed to push some refs to 'ssh://git@ghc.haskell.org/haddock.git' simonpj@cam-05-unx:~/code/HEAD-2/utils/haddock$ What do I do now? Presumably once that's done I include the change to utils/haddock in my patch to HEAD, correct? Getting to Haddock HEAD added 12 new patches on the haddock branch so I suppose they'll be included too. I don't know whether that is good or bad. help! Simon

On 2014-06-06 at 13:47:03 +0200, Simon Peyton Jones wrote:
I'm trying desperately to follow the instructions on https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules for how to update haddock to follow a small change to GHC. I've checked out the haddock master, made my patch, and want to push to haddock. But my push is rejected for an inscrutable reason:
Sorry, I haven't gotten to provide more guidance for haddock.git, which is the first repo whose primary repo has been relocated to GitHub. So you have to push via GitHub now. Short story: you have to use ssh://git@github.com/haskell/haddock.git as push-url git push ssh://git@github.com/haskell/haddock.git <refspec> where <refspec> refers to the kind of branch-update operation you want to push, like e.g. 'HEAD:master' to update the remote master branch to what your current local HEAD points to. There will be a more "guided" process as soon as I get to provide some tooling + additional docs for that. [...]
What do I do now? Presumably once that's done I include the change to utils/haddock in my patch to HEAD, correct? Getting to Haddock HEAD added 12 new patches on the haddock branch so I suppose they'll be included too. I don't know whether that is good or bad. help!
Once you were able to push the commits to GitHub's haddock.git repo, they'll be mirrored to git.haskell.org within one minute. At which point you'll be able to push the Git submodule/gitlink update to ghc.git pointing to the new 'master'-tip of haddock.git (if that was your question)

| Short story: you have to use ssh://git@github.com/haskell/haddock.git as | push-url | | git push ssh://git@github.com/haskell/haddock.git <refspec> | | where <refspec> refers to the kind of branch-update operation you want | to push, like e.g. 'HEAD:master' to update the remote master branch to | what your current local HEAD points to. Can't I just set the push-url and then say git push I just did that and it appeared to work. | Once you were able to push the commits to GitHub's haddock.git repo, | they'll be mirrored to git.haskell.org within one minute. At which point | you'll be able to push the Git submodule/gitlink update to ghc.git | pointing to the new 'master'-tip of haddock.git (if that was your | question) How exactly do I do that? That is, when I'm back in the ghc repo, I just stage utils/haddock along with the rest of my changes, and push? What if I did so "too early" before the mirroring happened? Anyway, I did as above and pushed to GHC. Would you like to just check that I did it right. It would be ABSOLUTELY FANTASTIC to have these new workflows documented. Please! Thanks for a very prompt reply Simon | -----Original Message----- | From: Herbert Valerio Riedel [mailto:hvriedel@gmail.com] | Sent: 06 June 2014 12:56 | To: Simon Peyton Jones | Cc: ghc-devs@haskell.org | Subject: Re: pushing to haddock | | On 2014-06-06 at 13:47:03 +0200, Simon Peyton Jones wrote: | > I'm trying desperately to follow the instructions on | > https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodule | > s for how to update haddock to follow a small change to GHC. | > I've checked out the haddock master, made my patch, and want to push | > to haddock. But my push is rejected for an inscrutable reason: | | Sorry, I haven't gotten to provide more guidance for haddock.git, which | is the first repo whose primary repo has been relocated to GitHub. So | you have to push via GitHub now. | | Short story: you have to use ssh://git@github.com/haskell/haddock.git as | push-url | | git push ssh://git@github.com/haskell/haddock.git <refspec> | | where <refspec> refers to the kind of branch-update operation you want | to push, like e.g. 'HEAD:master' to update the remote master branch to | what your current local HEAD points to. | | There will be a more "guided" process as soon as I get to provide some | tooling + additional docs for that. | | [...] | | > What do I do now? | > Presumably once that's done I include the change to utils/haddock in | my patch to HEAD, correct? | > Getting to Haddock HEAD added 12 new patches on the haddock branch so | > I suppose they'll be included too. I don't know whether that is good | > or bad. | > help! | | Once you were able to push the commits to GitHub's haddock.git repo, | they'll be mirrored to git.haskell.org within one minute. At which point | you'll be able to push the Git submodule/gitlink update to ghc.git | pointing to the new 'master'-tip of haddock.git (if that was your | question)

On 2014-06-06 at 14:07:44 +0200, Simon Peyton Jones wrote:
| Short story: you have to use ssh://git@github.com/haskell/haddock.git as | push-url | | git push ssh://git@github.com/haskell/haddock.git <refspec> | | where <refspec> refers to the kind of branch-update operation you want | to push, like e.g. 'HEAD:master' to update the remote master branch to | what your current local HEAD points to.
Can't I just set the push-url and then say
git push
I just did that and it appeared to work.
Yes, that'd be another way to accomplish that... Git supports many roads leading to rome :-)
| Once you were able to push the commits to GitHub's haddock.git repo, | they'll be mirrored to git.haskell.org within one minute. At which point | you'll be able to push the Git submodule/gitlink update to ghc.git | pointing to the new 'master'-tip of haddock.git (if that was your | question)
How exactly do I do that? That is, when I'm back in the ghc repo, I just stage utils/haddock along with the rest of my changes, and push?
What if I did so "too early" before the mirroring happened?
The validation hook would reject your ghc.git push telling you it couldn't find the referenced haddock.git commit (on git.haskell.org)
Anyway, I did as above and pushed to GHC. Would you like to just check that I did it right.
Everything looks perfect to me.
It would be ABSOLUTELY FANTASTIC to have these new workflows documented. Please!
I'm planning to! haddock.git was just the first repo to be migrated in order to be able to work out the workflow a bit more isolated (as typically only few devs push to haddock.git these days) w/o breaking multiple repos at once :-)
Thanks for a very prompt reply

On 2014-06-06 at 13:47:03 +0200, Simon Peyton Jones wrote: [...]
To ssh://git@ghc.haskell.org/haddock.git
PS: you could also try to configure the following (assuming your Git is new enough): git config --global \ url."ssh://git@github.com/haskell/haddock.git".pushInsteadOf \ ssh://git@ghc.haskell.org/haddock.git This would instruct Git to redirect pushes to ssh://git@ghc.haskell.org/haddock.git to go via ssh://git@github.com/haskell/haddock.git instead (the idea is generally described on https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules and is what the tooling I'm planning to code up would help you manage based on the ./packages file)

I ran that command and it didn't complain. No idea whether it worked or not though! This now appears in .gitconfig [url "ssh://git@github.com/haskell/haddock.git"] pushInsteadOf = ssh://git@ghc.haskell.org/haddock.git But shouldn't sync-all set this push-url stuff up correctly? Having to remember to look for redirects in .gitconfig seems like one more way to get confused when looking at a .git/config file. Simon | -----Original Message----- | From: Herbert Valerio Riedel [mailto:hvriedel@gmail.com] | Sent: 06 June 2014 13:05 | To: Simon Peyton Jones | Cc: ghc-devs@haskell.org | Subject: Re: pushing to haddock | | On 2014-06-06 at 13:47:03 +0200, Simon Peyton Jones wrote: | | [...] | | > To ssh://git@ghc.haskell.org/haddock.git | | PS: you could also try to configure the following (assuming your Git is | new enough): | | git config --global \ | url."ssh://git@github.com/haskell/haddock.git".pushInsteadOf \ | ssh://git@ghc.haskell.org/haddock.git | | This would instruct Git to redirect pushes to | ssh://git@ghc.haskell.org/haddock.git to go via | ssh://git@github.com/haskell/haddock.git instead | | (the idea is generally described on | https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules | and is what the tooling I'm planning to code up would help you manage | based on the ./packages file)

On 2014-06-06 at 14:11:21 +0200, Simon Peyton Jones wrote:
I ran that command and it didn't complain. No idea whether it worked or not though! This now appears in .gitconfig
[url "ssh://git@github.com/haskell/haddock.git"] pushInsteadOf = ssh://git@ghc.haskell.org/haddock.git
But shouldn't sync-all set this push-url stuff up correctly? Having to remember to look for redirects in .gitconfig seems like one more way to get confused when looking at a .git/config file.
That's a valid argument of course. Otoh, I consider the {insteadOf,pushInsteadOf} more convenient, as it allows for simpler workflows, here's a few benefits I can see from the top of my head: - You have to set it up once, and then something like git clone --recursive git://git.haskell.org/ghc.git simply works, even when you want to use the GitHub mirror and git.haskell.org is unreachable. (without that, you'd have to first clone ghc.git non-recursively from GitHub, then 'git submodule init', then rewrite the submodule urls, and then finally 'git submodule update') - If git.haskell.org goes down suddenly or you need to switch from git:// to https:// suddenly, simply reconfigure your git-redirects to point to the new Git urls. And everything works as before -- for *all* your local GHC clones, but uses the new locations. If git.haskell.org is back up, you can revert the redirects. - When working with multiple local GHC clones, you don't have to keep track whether you need to update the push-urls/fetch-urls for submodules for the invidual clone. If you have configured the global redirects properly in some other GHC clone, it'll just work for the other clones as well. - When switching between post/pre-submodule conversion states, the global redirects take care of preserving/providing the proper push-url mappings. - For the previously used standard use-case, the following simple git config --global \ url."ssh://git@git.haskell.org/".pushInsteadOf \ git://git.haskell.org/ one-time "parametric" redirect rule setup, IMHO beats the complexity of the current './sync-all set-url --push' implementation which has nasty corner-cases to take into account.
participants (2)
-
Herbert Valerio Riedel
-
Simon Peyton Jones