|
|
Log in / Subscribe / Register

Git + launchpad

Git + launchpad

Posted May 6, 2015 1:52 UTC (Wed) by smurf (subscriber, #17840)
Parent article: Git code hosting beta (launchpadblog)

Finally.

Bets as to when BZR will be deprecated, anybody? I'd guess at most two years.


to post comments

Git + launchpad

Posted May 6, 2015 3:05 UTC (Wed) by roskegg (subscriber, #105) [Link] (35 responses)

If bzr is less like using sharp pointy objects than git is, maybe this move will encourage more people to give bzr a try.

Git + launchpad

Posted May 6, 2015 5:36 UTC (Wed) by edomaur (subscriber, #14520) [Link]

from my point of view, bzr is more like walking blindly into a room where there is some hard furniture at shin height... (don't like it much)

Git + launchpad

Posted May 6, 2015 6:24 UTC (Wed) by epa (subscriber, #39769) [Link] (4 responses)

It might be a bit better but the big improvement in usability and learnability comes not from some slightly improved and incompatible tool, but from having everyone use the same tool. Then there is only one set of weirdness to get used to.

Git + launchpad

Posted May 6, 2015 7:00 UTC (Wed) by bangert (subscriber, #28342) [Link] (3 responses)

i guess that would be windows then...

Git + launchpad

Posted May 6, 2015 10:46 UTC (Wed) by rvfh (guest, #31018) [Link]

Still haven't got used to it...

Re: i guess that would be windows then...

Posted May 8, 2015 6:04 UTC (Fri) by ldo (guest, #40946) [Link] (1 responses)

Unfortunately (or otherwise), Linux has already surpassed Windows to become the world’s most popular OS.

Re: i guess that would be windows then...

Posted May 18, 2015 9:55 UTC (Mon) by epa (subscriber, #39769) [Link]

Linux is everywhere but in 99.99% of cases it provides no user interface. Only a minority of users even know that the device is running Linux. Possibly Android might now have beaten Windows as the most common UI.

Git + launchpad

Posted May 6, 2015 6:52 UTC (Wed) by smurf (subscriber, #17840) [Link] (24 responses)

Frankly I have no idea which sharp pointy objects you're talking about, given that you can trivially undo any goof-up you commit with some judicious use of "git reset".

"bzr uncommit" seems to do roughly the same thing, except that you can't undo _that_.

Git + launchpad

Posted May 6, 2015 7:56 UTC (Wed) by NAR (subscriber, #1313) [Link] (13 responses)

You can undo commits, but can't undo interactive rebases or pushes. I have met the sharp pointy end of these commands. Of course it was my fault (in fact, I expected to err, so I saved the diff before the rebase), but nevertheless the tool has sharp pointy ends. The scalpel of a surgeon has also sharp pointy end, otherwise the surgeon couldn't do it's job...

Git + launchpad

Posted May 6, 2015 8:17 UTC (Wed) by cebewee (guest, #94775) [Link] (5 responses)

Of course you can undo interactive rebases in Git. The reflog (git log -g) is your friend.

Git + launchpad

Posted May 6, 2015 9:36 UTC (Wed) by tpo (subscriber, #25713) [Link] (4 responses)

git log -g? First time I've heard of that.

<rant>
And *of course* there's also git's own virtual machine and C like language that can be used to fix further stuff, because you can't really expect to use such advanced machinery as a "commit" without knowing the third order relations of quantum git algebra.
</rant>

Git + launchpad

Posted May 6, 2015 12:31 UTC (Wed) by mathstuf (subscriber, #69389) [Link] (2 responses)

What? Commit doesn't require that knowledge. It *helps* to know what git is doing behind the scenes, but is by no means necessary.

Git's flexibility let's me write a tool that uses one clone to spawn X empty directories in which to do manipulations on the repository (such as running hooks, merging, etc.) without actually checking a workdir out (an bottleneck when you do it thousands of times a day on large repositories). Now, most people don't need to know about things like update-index, ls-files, or read-tree, but I really don't know how'd I'd even approach the problem with another VCS while staying in the requirements (though I admit ignorance, at least to the same depth I know of git, of other tools) since I don't think they give me the same tools. It also let's me atomically write references out to avoid race conditions when these parallel workdirs write back notes to keep the work they do around from being garbage collected.

Git + launchpad

Posted May 6, 2015 15:36 UTC (Wed) by pboddie (guest, #50784) [Link] (1 responses)

By "without actually checking a workdir out", do you mean like Mercurial clones which have been updated to the null revision? (You get the .hg directory and nothing else.)

I imagine bzr permits the same, although my experience with bzr has been mostly to dip into some repository someone has asked me to look at, and to run some fairly intuitively-named commands, which did what I expected. Quite a contrast to Git, in fact.

(It seems to be the case that criticism of Git's usability is frequently met by retorts that it's an object filesystem and sink-cleaner all in one, and that the frustrated user should feel the power. The manpages, despite probably having had a few iterations, reinforce this impression: git-checkout is my current "favourite".)

Git + launchpad

Posted May 6, 2015 21:11 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

You make a file path and an empty directory, set GIT_INDEX_FILE and GIT_WORK_TREE in the environment pointing to those and set GIT_DIR pointing to the bare repository with all the objects. We then prep the index with the right revision (git read-tree), tell the index that the working tree is OK without hitting disk (git update-index), and then checkout the .gitmodules file (if it exists) (git checkout-index followed by git update-index to update it that there's a real file on disk now) so that submodules work properly. This can be done concurrently with a single clone of a repository and each chain of commands thinking they are working on a real thing (you need the directory so that conflict files have a place to be dropped).

So basically, can I work with a single clone from multiple directories at once where all of them think they are in their own little sandbox and don't interfere with each other (even to the point of avoiding race conditions when asking for available names in refs/)?

I agree that the git docs are not as end-user-oriented as they could be. I'm also not *too* concerned with intuitiveness (cf. my use of Vim, XMonad, tmux, uzbl, etc.), but rather that things *make sense*. As an example, the "standard" cut/copy/paste shortcuts are convenient, but are not composable like Vim's versions of them. That's what I like about git; it gives me a toolbox with some pre-made tools composed of the bare bits rather than a completed sawsall or something which, while nice, can't quite be made into a hammer when I need one without some sanity checks.

Git + launchpad

Posted May 6, 2015 20:45 UTC (Wed) by nix (subscriber, #2304) [Link]

Git's own what? It doesn't have a virtual machine, nor a C like language. Its revision specifiers look more like the shell than anything.

You may be thinking of Mercurial here (which *also* doesn't have a virtual machine of any sort, but which has ways to specify revisions that look more like a conventional programming language).

Git + launchpad

Posted May 6, 2015 8:17 UTC (Wed) by alexl (guest, #19068) [Link] (1 responses)

You can undo an interactive rebase, or any changes to a (local) git repository that has been commited (but not if you accidentally lose outstanding changes). Every single commit is kept in the repo as long as you don't trigger a GC, so the head before the interactive rebase is still there, and can be found via "git reflog".

Git + launchpad

Posted May 6, 2015 12:35 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

FTR, commits stay around if they have a name (branch, tag, other arbitrary ref, reflog entry, etc.), or a path from a name, or are younger than 30 days (by default).

Git + launchpad

Posted May 6, 2015 11:50 UTC (Wed) by agateau (subscriber, #57569) [Link]

While in the middle of an interactive rebase, you can undo it with `git rebase --abort`.

Furthermore, when I know I embark into some heavy rebase, I start by creating a branch for the rebase with `git checkout -b rebased`. I then do the rebase in this branch. This is quite handy because when I am done I can easy compare the two branches with `git diff name-of-original-branch`.

Git + launchpad

Posted May 6, 2015 18:05 UTC (Wed) by Wol (subscriber, #4433) [Link] (1 responses)

AIUI, if you make a note of what the current head is, you can ALWAYS get back to it unless BOTH you abandon that branch AND you do a garbage collect.

Otherwise, it's all part of your history, and knowing the commit means you can reset that to be you current working head. So if you reset the head back somewhere in the history (or abandon that head) a GC will detect the hanging end and garbage-collect backwards, but as long as there is an active commit after the one you want, it can't be GC'd, and it can be retrieved.

Oh - and aiui you can also back up your working directory - "git stash" if I've got it right. I don't use it, I don't understand it, but that's what it's for.

Cheers,
Wol

Git + launchpad

Posted May 6, 2015 20:47 UTC (Wed) by nix (subscriber, #2304) [Link]

AIUI, if you make a note of what the current head is, you can ALWAYS get back to it unless BOTH you abandon that branch AND you do a garbage collect.
The garbage collection also must have happened at least as long after the rebase as specified by the gc.pruneexpire config option (if unset, two weeks).

You need to really work to lose committed data in git.

Git + launchpad

Posted May 6, 2015 20:23 UTC (Wed) by andresfreund (subscriber, #69562) [Link]

git reflog?

Git + launchpad

Posted May 7, 2015 15:37 UTC (Thu) by smurf (subscriber, #17840) [Link]

Sure you can undo a push. "git push -f destination OLD_COMMIT_HASH:branch". Or, if you want to delete a remote branch, leave OLD_COMMIT_HASH empty.

Sure you can undo a rebase. "git reset --hard OLD_COMMIT_HASH".

You get the old commit hash from the reflog, or from a gitk window you conveniently left open, or whatever.

I never had to "save a diff", by the way. What would that accomplish?

Git + launchpad

Posted May 6, 2015 8:55 UTC (Wed) by Flimm (guest, #98097) [Link] (5 responses)

You can't undo git checkout -- filename or git reset --hard commit, whereas you can do that in Bazaar (it creates a hidden backup file every time).

Git + launchpad

Posted May 6, 2015 9:37 UTC (Wed) by juliank (guest, #45896) [Link] (1 responses)

Right. git's job is managing your version history, not making backups of your working directory.

Git + launchpad

Posted May 6, 2015 11:09 UTC (Wed) by nye (guest, #51576) [Link]

>git's job is managing your version history, not making backups of your working directory

You say that as if those are clearly two different tasks, but reasonable people can disagree on that point.

Git + launchpad

Posted May 9, 2015 9:46 UTC (Sat) by Wol (subscriber, #4433) [Link] (2 responses)

> You can't undo git checkout -- filename or git reset --hard commit, whereas you can do that in Bazaar (it creates a hidden backup file every time).

As has been pointed out, git DOES NOT delete anything unless you try very hard to make it. So "git reset --hard commit" should be easy to undo - "git reset --hard oldhead".

As for "git checkout -- filename", well I guess the old filename was never in git, so how can git recover it?

Cheers,
Wol

Git + launchpad

Posted May 9, 2015 14:33 UTC (Sat) by madscientist (subscriber, #16861) [Link] (1 responses)

I think Flimm is talking about modified files; if you run git reset --hard then all modified files are reset and the modifications are not saved anywhere. Apparently bzr will make a hidden backup copy of modified files.

In Git, you need to first run "git stash" or similar to keep a backup of modified files.

Git + launchpad

Posted May 16, 2015 6:46 UTC (Sat) by zenaan (guest, #3778) [Link]

And "git stash" can be simply added to a checkout hook, for the paranoid, for those for whom that risk is too great, it is easy to configure that pain away...

Git + launchpad

Posted May 6, 2015 11:03 UTC (Wed) by cjwatson (subscriber, #7322) [Link] (3 responses)

$ bzr uncommit
143 Colin Watson 2015-05-06
Sort imports and remove pyflakes lint.

The above revision(s) will be removed.
Uncommit these revisions? ([y]es, [n]o): yes
You can restore the old tip by running:
bzr pull . -r revid:cjwatson@canonical.com-20150506110304-negzvl15v4ytaknv

Git + launchpad

Posted May 6, 2015 12:36 UTC (Wed) by mathstuf (subscriber, #69389) [Link] (2 responses)

How would you discover that name if you put the output there into /dev/null?

Git + launchpad

Posted May 6, 2015 12:55 UTC (Wed) by cjwatson (subscriber, #7322) [Link] (1 responses)

"bzr heads --dead-only" will show it (as long as it hasn't been GCed yet, I think - I'm not a bzr expert).

FWIW: I've been working on git support in Launchpad for most of this year, and I'm really excited about getting it to the point where I can use it for everything, so this isn't intended to persuade people to use bzr. I just think that if we're criticising bzr it would be nice if the criticisms were in fact accurate.

Git + launchpad

Posted May 6, 2015 21:13 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

OK, good to know it isn't really lost then :) .

> I just think that if we're criticising bzr it would be nice if the criticisms were in fact accurate.

Understandable. I get the urge to pick nits with folks who claim rebase is a "never use it" tool, but there are only so many hours in the day :( .

Re: If bzr is less like using sharp pointy objects than git is

Posted May 8, 2015 6:15 UTC (Fri) by ldo (guest, #40946) [Link] (3 responses)

Seems unlikely at this stage. Git became popular entirely through its own merits, not because any big organization with any multi-billion-dollar budget was behind it (Microsoft Team Foundation Server, anybody?). Against all that deep-pocketed competition and insidious vendor lock-in, all those overwhelming odds stacked against it, Git has now reached the point that no other VCS, whether Free or proprietary, stands any hope of offering serious competition.

Re: If bzr is less like using sharp pointy objects than git is

Posted May 8, 2015 12:44 UTC (Fri) by intgr (subscriber, #39733) [Link] (2 responses)

> not because any big organization with any multi-billion-dollar budget was behind it

You mean like GitHub?

OK, replace "billion" with "million", but it's their sole business and I believe they are one of the biggest factors in git becoming the dominant VCS.

Back when GitHub got started, git, Mercurial and Bazaar were all quite close in mindshare and features. At one point it even seemed possible that Mercurial was winning due to many large projects adopting it (Python, Mozilla, OpenJDK, OpenOffice; Google Code added Mercurial support long before git; even kernel.org provided an official Mercurial mirror of the git repo).

But GitHub was the first website to offer such quick code hosting and convenient distributed workflows. People could just throw up some code and not worry about whether it's a "project" or not -- unlike "old school" FOSS hosting sites. And even though copycats like Bitbucket followed (Mercurial-only at first), network effects made sure that GitHub stays in the dominant position.

Re: If bzr is less like using sharp pointy objects than git is

Posted May 8, 2015 13:08 UTC (Fri) by mathstuf (subscriber, #69389) [Link]

Bitbucket has other problems (and always has). They support cloning over hg or git for all repos, but you can't make pull requests to any repo other than the one you forked directly (no cross-fork collaboration). They *still* lack 2FA support (they said they'd do it on Twitter a few years ago, but then nothing happened; their issue for it has no comments from Atlassian on any recent timescale). The web interface is a lot clunkier than GitHub. All emails for an issue share a Message-Id so MUAs which actually use it display the threads suboptimally. There are other things, but I can't think of them right now. Even if Bitbucket had come first, GitHub has been so much better at execution that I think they'd still have "won".

Honestly, GitLab is better than Bitbucket (though I replace all "hg clone" commands with "git clone hg::" because I just cannot grok Mercurial, so that difference doesn't mean much to me) in every way I've had to deal with either and you can host your own (and I haven't used the enterprise edition).

Re: You mean like GitHub?

Posted May 8, 2015 22:11 UTC (Fri) by ldo (guest, #40946) [Link]

Given the number of GitHub users who are clueless about Git, I don’t think many of them use it at all.

No, it was Git that made GitHub, not the other way round.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds