On 20/05/2013 15:00, Michael Bayer wrote:
>
>> If you can let me know what the bumps are, I'll see if I can help...
>
> basically if you want to have a repo that looks "just like" the one on bitbucket, you pretty much need to use "--mirror".
I have to admit I've never used --mirror. That may be because I've
always migrated repos from svn rather than mercurial.
If you do a hg-git push into a bare repo, what's missing?
Where does --mirror come in?
Out of interest, have you looked at felipec's git-remote-hg? Tweeted
about it recently and looked like an interesting take on
get-git-from-hg-server.
> To update the mirror, you do "git remote update".
Never used that, I generally either "git fetch" or, more common, "get
fetch".
> These aren't hard things, but compared to mercurial, it's very hard to learn - mercurial has none of these options and variants.
Haha, that's all perspective. I find Hg impenetrable.. branches? no
bookmarks, not these other things. What do you mean you forgot to enable
the extension that should never be disabled on any repo ever? ;-)
> In the mercurial case, all repos are the same (whether or not they have a working copy changes nothing), you can then "hg push" or "hg pull" between any of these repos, and it does exactly the same thing in all cases.
Yeah, but that's part of what makes git rock: the index and working copy
interaction. I don't know why you can't push into a repo with a working
copy (ie: non-bare) but I'll forgive the developers of git in return of
having an index/staging area at all...
> With git, now we have:
>
> 1. git pull - if you have a working copy
I think this is like "hg pull -u", it's what I used most.
> 2. git fetch - above, but also if you *dont* have a working copy
Unfortunately, this is like "hg pull", made worse by the fact that the
deprecated "hg fetch" was much more like "git pull"... Anyway, "git
fetch" just brings all the revisions from a remote repo into the local
repo, but leaves the current branch, working copy and index alone.
> 3. git fetch --update-head-ok / --tags / --prune - hey, git can't assume you want this, or that, or the other thing, who knows! please set your many, many flags based on the subtle use cases linus torvalds had or did not have one day.
I don't generally bother passing options to "get fetch" when I do use it.
My work cycle is mainly:
"git checkout -b something" - create a branch to work in and check it out
"git add -p somefiles" - add bits of my changes in a coherent commit
"git commit" - make the commit
"git push origin something" - push my new branch back to the server for
backup
*rinse and repeat before issuing pull request from github*
> 4. git remote update - better if you have --mirror, and this is different from fetch!
I think Hg is tripping you up, I've never used "git remote update" and I
rarely use "git fetch"...
> bonus! your various "push" hooks don't work if you're doing "fetch"!
Where are the hooks that aren't working? If in the local repo, well
yeah, would it really make sense to have push hooks fire when you're
doing a pull? ;-)
> because taking the data from another repo and updating the local one is entirely different from taking the data from another repo and updating the local one.
*chuckles* I do remember this feeling, it does pass, and you end up
realising that while often misnamed and confusing, some of the things
git does are really useful...
> But! i can edit the damn history finally ! (not only delete branches [FINALLY] but I learned rebase -i too, which is also why I had to get really good with --mirror if you want revision deletes and stuff to actually transfer over automatically).
Yep, that and "git add -p" are my favourite friends... Split a revision
into bits using rebase -i yet? Then you feel special :-)
> So yes, because of that the Mako migration is basically a rehearsal for the SQLAlchemy one, right now my only remaining concern is bumping the userbase that may be currently dependent on pulling from our mercurial tree.
How would you get stats on how many people that is? If there are
regulars, see if they have an active github account ;-)
Anyway, I did have some sqlalchemy-related questions a message or two
back ;-) - Is it legit to end up with specialist functions and
constraints in the dialect module (ie: sqlalchemy.dialects.postgresql)
or should they be in the main modules even though they'll only work with pg?
cheers,