3 ms·
what's the difference? hg status -someflag | xargs do-something git-status -someflag | xargs do-something as far as usage is concerned -- is hg really less t
by utx00 18y ago
what's the difference?
hg status -someflag | xargs do-something
git-status -someflag | xargs do-something
as far as usage is concerned -- is hg really less tool like? you're right, it is partly semantics. however the article over-simplifies things to the point of being misleading.
- silentbicycle 18y agoOne semantic/aesthetic difference is that git floods tab completion with all the git- items, which is needlessly annoying. Namespacing the entire public interface behind one executable feels cleaner. I suspect the underlying reason people complain about this is that it's a particularly visible instance of hg having a vastly cleaner public interface than git. Of course, one person's "feeling cleaner" is another person's "easier to write scripts/extensions for that won't break every time the public interface to the relevant exposed internals change in the slightest way". There seems to be much less effort to encapsulate the git interface for consistent external usage.* Some people will prefer git for just this reason, though: You can easily get at the internals, if necessary. Like most of these "holy wars", it's a trade-off, and different people have different values. Make an informed decision. (Git's design values seem to resemble C's, while hg more closely fits Python's. I strongly prefer the latter.) * This is unsurprising, though: Linus has spoken rather condescendingly of monotone's "nice object-oriented libraries". (http://lwn.net/Articles/249460/ http://lwn.net/Articles/249460/) (He also complained that it was slow, though he caught it at a particularly bad time -- one of the lead developers had just gone on sabbatical (and was preparing to move across the country), and the issues causing the sluggishness were fixed shortly after.)
- utx00 18y agogit is pretty good at dealing with lots of local branches. it has git-stash which supports that even further (stash it now, come back to it later). it has a staging area which allows you to slice and dice your commits. it seems to be better and allowing you to rewrite the commit history. i don't like git-repack, git-gc. i prefer the hg revlog approach. hg can package all of its state from a given commit into what they call bundles. git only has git-format. can git-format be as self-describing as a bundle? you can't delete named branches from mercurial. i say, so what. we have an inactive branch. we merge uninteresting branches into there. hg branches -a then shows you the unmerged (active) branches. they're both good. it mostly depends on the way you and your team work.
- silentbicycle 18y agoAgreed. I prefer hg overall, but I know it's more due to style than a clear technical advantage one way or the other. Is it possible to set branches -a to be the default in your hgrc, by the way? (I was going to check on that this weekend.)
- utx00 18y agoi don't think so no. you may have to go with a wrapper script or an alias. do you know if it's possible to do bundles in git?
- silentbicycle 18y agoHaven't tried, sorry. It looks like you can add [defaults] branches = -a to your hgrc to ignore inactive branches by default, though.