* Re: Terminology question: "tracking" branches
From: Björn Steinbrink @ 2008-10-27 16:17 UTC (permalink / raw)
To: Marc Branchaud; +Cc: Michael J Gruber, Peter Harris, git, Junio C Hamano
In-Reply-To: <4905E1B0.8040601@xiplink.com>
On 2008.10.27 11:43:44 -0400, Marc Branchaud wrote:
> Michael J Gruber wrote:
>>
>> remote tracking branch: Synonymous with tracking branch. [remote is a
>> noun, an object for track here]
>
> Er, "remote" is an adjective there... :)
Hm? It's a "branch that tracks (a branch of) a remote". Looks like a
noun to me.
>> [adjective to be found] branch: A local branch which is set up to pull
>> or rebase automatically from a tracking branch. Used for local
>> modifications to remote branches. [I'm tempted to use local tracking
>> branch here, but that would just add to the confusion.]
>
> I say there's no need for an adjective here, as this is just a plain old
> branch that git-branch creates by default (right?).
By default, no. It depends on the branch.automergesetup configuration
and whether you create the branch from a remote tracking branch, a local
branch or some other committish.
autosetupmerge = false
----
git branch foo origin/foo --> --no-track
git branch foo master --> --no-track
git branch foo origin/foo^0 --> --no-track
autosetupmerge = true
----
git branch foo origin/foo --> --track
git branch foo master --> --no-track
git branch foo origin/foo^0 --> --no-track
autosetupmerge = always
----
git branch foo origin/foo --> --track
git branch foo master --> --track
git branch foo origin/foo^0 --> --no-track
> What's needed is an adjective for when git-branch is given the
> --no-track option (or when branch.automergesetup is false).
> "Non-tracking branch" perhaps?
Isn't that easily confused with "[remote] tracking branch"? Especially
since the "remote" is optional...
Björn
^ permalink raw reply
* Re: Terminology question: "tracking" branches
From: Marc Branchaud @ 2008-10-27 15:43 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Björn Steinbrink, Peter Harris, git, Junio C Hamano
In-Reply-To: <490030AB.8090207@drmicha.warpmail.net>
Michael J Gruber wrote:
>
> remote tracking branch: Synonymous with tracking branch. [remote is a
> noun, an object for track here]
Er, "remote" is an adjective there... :)
> [adjective to be found] branch: A local branch which is set up to pull
> or rebase automatically from a tracking branch. Used for local
> modifications to remote branches. [I'm tempted to use local tracking
> branch here, but that would just add to the confusion.]
I say there's no need for an adjective here, as this is just a plain old
branch that git-branch creates by default (right?).
What's needed is an adjective for when git-branch is given the
--no-track option (or when branch.automergesetup is false).
"Non-tracking branch" perhaps?
Marc
^ permalink raw reply
* Re: rebase, file permissions and removed file
From: Pascal Obry @ 2008-10-27 15:33 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
In-Reply-To: <4905DC90.6050503@viscovery.net>
On Mon, Oct 27, 2008 at 4:21 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Pascal Obry schrieb:
>> On Mon, Oct 27, 2008 at 3:38 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>>> Since you don't have any content to lose, you can always just
>>>
>>> $ touch file1
>>> $ git add file1
>>> $ git rm file1
>>
>> Does not work:
>
> Yes, it did! ;)
Well, on my side I add to use:
$ git rm --cached file1
For the last command.
> This is an entirely different matter. My interpretation is that the
> permission change of file1 was the only change in this commit. Since this
> is no longer needed, you should run 'git rebase --skip'.
No no :) Too easy! I have plenty of other permission changes in my commit
that I do not want to loose!
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
^ permalink raw reply
* Gitk/Cygwin bug: phony local changes
From: Hannu Koivisto @ 2008-10-27 15:22 UTC (permalink / raw)
To: git
Greetings,
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
gitk
with Cygwin build of git version 1.6.0.3.523.g304d0 in Windows XP
SP2 with Cygwin dll version 1.5.24 results to gitk showing "Local
uncommitted changes, not checked in to index" entry in the history
tree and if I select that entry, it seems to indicate that all
files have changed but without any actual content changes.
git status doesn't show any changes.
If I run git diff (which displays no changes) or git reset and then
run gitk again, there is no longer that "Local uncommitted
changes..." entry.
Since it was suggested on #irc, I tried "git config --global
core.trustctime false" but that didn't help, which I suppose was
expected since the documentation talks about differences between
the index and the working copy and I haven't added anything to the
index.
I can reproduce this problem with another (private) repository as
well.
--
Hannu
^ permalink raw reply
* Re: rebase, file permissions and removed file
From: Johannes Sixt @ 2008-10-27 15:21 UTC (permalink / raw)
To: Pascal Obry; +Cc: Git Mailing List
In-Reply-To: <a2633edd0810270809w7fec93b2rc314cc025f41d41f@mail.gmail.com>
Pascal Obry schrieb:
> On Mon, Oct 27, 2008 at 3:38 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
>> Since you don't have any content to lose, you can always just
>>
>> $ touch file1
>> $ git add file1
>> $ git rm file1
>
> Does not work:
Yes, it did! ;)
> $ git rebase --continue
> Applying: Fix perm file1
> No changes - did you forget to use 'git add'?
This is an entirely different matter. My interpretation is that the
permission change of file1 was the only change in this commit. Since this
is no longer needed, you should run 'git rebase --skip'.
-- Hannes
^ permalink raw reply
* Re: rebase, file permissions and removed file
From: Pascal Obry @ 2008-10-27 15:09 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
In-Reply-To: <4905D276.9020308@viscovery.net>
On Mon, Oct 27, 2008 at 3:38 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Since you don't have any content to lose, you can always just
>
> $ touch file1
> $ git add file1
> $ git rm file1
Does not work:
$ git rebase --continue
Applying: Fix perm file1
No changes - did you forget to use 'git add'?
When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
The only solution I found is to abort the rebase, edit my topic branch (fixperms
in this example) to remove file1 from the commit and redo the rebase... Not
that simple especially since there was many other commits on my topic branch.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Jakub Narebski @ 2008-10-27 14:57 UTC (permalink / raw)
To: 0000 vk; +Cc: mercurial, git
In-Reply-To: <fa27bd940810270729w488edd2clbd309093062558d6@mail.gmail.com>
On Mon, 27 Oct 2008, 0000 vk wrote:
> 2008/10/27 Jakub Narebski <jnareb@gmail.com>
> > By the way, going back to the matter of choosing version control
> > system for DragonflyBSD; some time ago I have written post
> > * "Mercurial's only true "plugin" extension: inotify...
> > and can it be done in Git?"
> > http://thread.gmane.org/gmane.comp.version-control.git/76661
> > (current answer: it is possible using 'assume unchanged' bit)
> > about how nearly every Mercurial extension has equivalent functionality
> > in Git.
> >
> > But what about the reverse, about the following features and
> > issues in Mercurial:
[...]
>
> Jakub,
>
> Do you know if git supports the equivalent of hg bundle?
> Thanks.
The equivalent of "hg bundle" (http://www.selenic.com/mercurial/hg.1.html#bundle)
would be "git bundle" (http://git.or.cz/man/git-bundle). I think
git-bundle was inspired by Mercurial feature, just like fast-import
format and bisect went in other direction.
P.S. Could you _please_ quote only relevant fragments of email you are
replying to, especially if it is so long?
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: rebase, file permissions and removed file
From: Johannes Sixt @ 2008-10-27 14:38 UTC (permalink / raw)
To: Pascal Obry; +Cc: Git Mailing List
In-Reply-To: <a2633edd0810270702x416bb659ke183b0cc6266071@mail.gmail.com>
Pascal Obry schrieb:
> # At this point there is a conflict as expected
> # file1 has been removed on master, and file1 had its permissions changed
> # on fixperms branch.
> #
> # What I find confusing is that:
> # $ git diff
> # and
> # $ git diff --cached
> #
> # are reporting nothing.
> #
> # Ok, file1 has been removed, let's then remove it as it is right:
> #
> # $ git rm file1
> # fatal: pathspec 'file1' did not match any files
> #
> # Ok, so what's the proper way to fix that! What should I do to be able to
> # continue the rebase:
Since you don't have any content to lose, you can always just
$ touch file1
$ git add file1
$ git rm file1
-- Hannes
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: 0000 vk @ 2008-10-27 14:29 UTC (permalink / raw)
To: Jakub Narebski; +Cc: mercurial, git
In-Reply-To: <200810271157.20313.jnareb@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 6464 bytes --]
2008/10/27 Jakub Narebski <jnareb@gmail.com>
> Dnia poniedziałek 27. października 2008 10:29, Benoit Boissinot napisał:
> > On Mon, Oct 27, 2008 at 2:52 AM, Jakub Narebski <jnareb@gmail.com>
> wrote:
> >> On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
> >>> Am Sonntag 26 Oktober 2008 19:55:09 schrieb Jakub Narebski:
> >>>>
> >>>> I agree, and I think it is at least partially because of Git having
> >>>> cleaner design, even if you have to understand more terms at first.
> >>>
> >>> What do you mean by "cleaner design"?
> >>
> >> Clean _underlying_ design. Git has very nice underlying model of graph
> >> (DAG) of commits (revisions), and branches and tags as pointers to this
> >> graph.
> >
> > Git and Mercurial are very close from that point of view.
> >
> > Mercurial explicitely disallow octopus merges (and we don't think there's
> > a good reason to allow them, although I agree with Linus, they look very
> nice
> > in gitk ;) ).
>
> From what I see Mercurial disallows octopus merges (merges with more
> than two parents) because of its rigid-record database repository
> design, while Git is more like object database. Fixed width records
> of VMS vs delimited records of Unix... There is simply place on
> zero, one or two parents (two parent fields, which can be null) in
> Mercurial changerev format.
>
> By the way flexibility of Git design allowed to add 'encoding' header
> to commit message (if commits message is encoded not in utf-8) after
> the fact, without affecting older repository data, and playing well
> with old git installations which do not understand this header.
>
> > And we don't have "branches as pointer" in core, but the bookmark
> > extension does that.
>
> I disagree. Mercurial implementation of tags is strange, and from
> what I remember and from discussion on #revctrl implementation
> of local named branches is also strange (CVS-like). They are IMHO
> not well designed.
>
> Also the 'hidden' branches after fetching from remote repository
> (hg pull) but before merging (hg update) are IMHO worse design
> than explicit remote-tracking branches in Git, especially in presence
> of multiple [named] branches in repositories.
>
> > Apart from that I think the underlying format are interchangeable,
> > someone could use the git format with the hg ui, or use revlogs
> > (the basic format of mercurial) like packs.
>
> I don't think so. The 'content addressed filesystem' idea of Git
> is quite pervasive along Git implementation and Git thoughtflows.
>
> >
> > The only special thing about revlogs is the linkrev stuff, it's a
> > pointer to the first revision that introduced an object, so we can
> > easily find what to send in our network protocol (we don't have to
> > read the manifest, ie the "tree" of objects"). linkrev can be useful
> > to speedup "hg log" too.
>
> At first I thought: what a nice idea... but then I realized that in
> distributed environment there is no way to define "first revision that
> introduced an object". Take for example the following history
> (independent introduction):
>
> .---.---.---.---x---.---.---.
> \
> --x---.---.
>
> where both 'x' have the same version of an object. The top branch
> appeared first in current repository, but the bottom branch had 'x'
> with earlier timestamp (earlier authordate).
>
>
> Git just relies on the fact that traversing revision is a part of it
> that is heavily optimized and really fast. Git very much by design
> doesn't store any backlinks in repository object database.
>
> >> I have read description of Mercurial's repository format, and it is not
> >> very clear in my opinion. File changesets, bound using manifest, bound
> >> using changerev / changelog.
> >>
> >
> > just do a s/// with the git terminology:
> > filelog -> blob
> > manifest -> tree
> > changelog -> commit object
>
> True. But as I see it they are bound in reverse order in Mercurial:
> deltas are stored in filelog, filelogs are bound together in manifest,
> manifest are bound using changelog, while in Git commit object
> references tree (and parents), trees references blobs, and blob store
> content of a file. But that might be just my impression.
>
>
> .......................................................................
>
> By the way, going back to the matter of choosing version control system
> for DragonflyBSD; some time ago I have written post
> * "Mercurial's only true "plugin" extension: inotify...
> and can it be done in Git?"
> http://thread.gmane.org/gmane.comp.version-control.git/76661
> (current answer: it is possible using 'assume unchanged' bit)
> about how nearly every Mercurial extension has equivalent functionality
> in Git.
>
> But what about the reverse, about the following features and
> issues in Mercurial:
>
> * Merging in presence of criss-cross merges[1], and in presence of
> file renames, i.e what merge-recursive does in Git.
>
> * git-rerere, reusing recorded resolution of conflicted merges.
> Resolving the same merge happens often if you use topic branches
> and trial merging.
>
> * git-grep that allows you to "and" the match criteria together,
> and also pick a file (not a line) that matches all the criteria;
> and of course allow searching given revision and not only working
> directory.
>
> * pickaxe search (git log -S) which contrary to blame/annotate
> allow to find commit which _deleted_ given fragment.
>
> * easy management of multiple repositories you fetch from with
> remote-tracking branches and git-remote command.
>
> * blame that follows block-of-line movement (it was invented by Linus
> as a vision long time ago, but it took very long time to materialize).
>
> * a way to review merge resolution, something that is done in git
> by using combined diff format
>
> * git-stash, allowing to stash away changes to go back to them later;
> it allows to stash away even partially resolved merge conflict
> (merge resolution in progress).
>
> * git-filter-branch (based on cg-admin-rewrite-hist), which allow
> to rewrite history for example to remove file which should never
> be added to version control (for example because of copyright
> or license).
>
> References:
> ===========
> [1] http://revctrl.org/CrissCrossMerge
> BTW I wonder why reverting spam is made so hard on revctrl.org wiki
>
> --
> Jakub Narebski
> Poland
>
Jakub,
Do you know if git supports the equivalent of hg bundle?
Thanks.
vk
[-- Attachment #1.2: Type: text/html, Size: 8102 bytes --]
^ permalink raw reply
* rebase, file permissions and removed file
From: Pascal Obry @ 2008-10-27 14:02 UTC (permalink / raw)
To: Git Mailing List
In short,
- a branch is created
- a file is removed from master
- the same file has its permissions changed on the branch
- we rebase the branch on master
- how to resolve the conflict?
Following is a script to reproduce the problem, see comment at the end.
Any idea? Thanks.
<<
-- #!/bin/sh
rm -fr repo
mkdir repo
cd repo
git init
touch file1 file2
chmod a+x file*
git add .
git ci -m "First rev"
git checkout -b fixperms
chmod a-x file1
git add file1
git ci -m "Fix perm file1"
git checkout master
git rm file1
git ci -m "Remove file1"
git checkout fixperms
git rebase master
# At this point there is a conflict as expected
# file1 has been removed on master, and file1 had its permissions changed
# on fixperms branch.
#
# What I find confusing is that:
# $ git diff
# and
# $ git diff --cached
#
# are reporting nothing.
#
# Ok, file1 has been removed, let's then remove it as it is right:
#
# $ git rm file1
# fatal: pathspec 'file1' did not match any files
#
# Ok, so what's the proper way to fix that! What should I do to be able to
# continue the rebase:
#
# $ git rebase --continue
>>
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
^ permalink raw reply
* Re: [RFC PATCH] detection of directory renames
From: Jakub Narebski @ 2008-10-27 13:35 UTC (permalink / raw)
To: Yann Dirson; +Cc: git
In-Reply-To: <20080925213819.27029.47944.stgit@gandelf.nowhere.earth>
Yann Dirson <ydirson@altern.org> writes:
> This is a first very preliminar patch, mostly so people can comment
> early on the big picture. It has a number of limitations, many but
> not all already listed as FIXME's in the patch itself. If anything in
> this patch seems so wrong it is not worth polishing it, it's the
> perfect time to say so :)
What happened to this work? I din't see it mentioned in "what's
cooking..." announcements...
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] Add support for uintmax_t type on FreeBSD 4.9
From: David Syzdek @ 2008-10-27 13:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v1vy2imt2.fsf@gitster.siamese.dyndns.org>
On Sun, Oct 26, 2008 at 10:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
> "David Syzdek" <syzdek@gmail.com> writes:
>
>> On Sun, Oct 26, 2008 at 9:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> ...
>>> I have a stupid question.
>>>
>>> Would it be a more appropriate improvement to do it like this:
>>>
>>> ifdef USE_THIS_AS_UINTMAX_T
>>> BASIC_CFLAGS += -Duintmax_t="$(USE_THIS_AS_UINTMAX_T)"
>>> endif
>>>
>>> and then add a section for FreeBSD 4.9-SECURITY like this:
>>>
>>> ifeq ($(uname_R),4.9-SECURITY)
>>> USE_THIS_AS_UINTMAX_T = uint32_t
>>> endif
>>>
>>> That way, an oddball 64-bit machine can use uint64_t here if it wants to,
>>> possibly including FreeBSD 4.9-SECURITY backported to 64-bit ;-).
>>>
>>
>> Your suggestion provides more flexibility for other environments. I
>> was making the assumption that 64-bit systems would define uintmax_t,
>> however in retrospect that would be unwise.
>> Would you like me to resubmit the patches with your modifications?
>
> Actually there was a reason why I said this was a "stupid" question. I
> think your assumption on 64-bit platforms would hold in practice, and my
> suggestion could be an unnecessary overengineering. If nobody knows of a
> system that would benefit from such a generalization, your original patch
> would be better, partly because I think:
>
> (1) USE_THIS_AS_UINTMAX_T is just for demonstration of concept and is a
> terrible name we cannot possibly use in our Makefile. We have to
> spend brain cycles to come up with a better name; and
>
> (2) It may be tricky to come up with autoconf macros to determine what to
> set USE_THIS_AS_UINTMAX_T to.
>
> As a slightly unrelated aside, I find it somewhat unfortunate that the
> conditional says "4.9-SECURITY", which is a bit too explicit and specific.
> to my taste. I do not know how FreeBSD versioning scheme works, but
> wouldn't your change work equally well for 4.9-RELEASE or 4.11-RELEASE?
>
> I suspect that you would want to say "$(uname_R) that begins with '4.' or
> smaller needs this workaround", as strtoul(3) manual page seems to appear
> first in FreeBSD 5.0-RELEASE (but not found in FreeBSD 4.11-RELEASE).
>
The following should match against FreeBSD 4.x:
FREEBSD_MAJOR := $(shell sh -c 'echo $(uname_R) |cut -d. -f1')
ifeq ($(FREEBSD_MAJOR),4)
NO_UINTMAX_T = YesPlease
NO_STRTOUMAX = YesPlease
endif
Is the use of FREEBSD_MAJOR okay, or would another name be more appropriate?
--
An earthquake wiped out Etchisketchistan today.
-- Onion TV
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Jakub Narebski @ 2008-10-27 12:48 UTC (permalink / raw)
To: Arne Babenhauserheide; +Cc: mercurial, SLONIK.AZ, git
In-Reply-To: <200810271114.03406.arne_bab@web.de>
On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
> Am Montag 27 Oktober 2008 10:41:53 schrieb Jakub Narebski:
>>>
>>> If you tell a disk "give me files a, b, c, d, e, f (of the whole abc)",
>>> it is faster then if you tell it "give me files a k p q s t", because the
>>> filesystem can easier optimize that call.
>>
>> I would expect _good_ filesystem to be able to optimize this call as
>> well. As I said it looks like Mercurial and Git are optimized for
>> different cases: Git relies on filesystem for caching, and optimizes
>> for warm cache performance.
>
> The problem is by which knowledge the filesystem should optimize this call
> when it is storing the files in the first place.
Well, that is a question for filesystem designer, and VFS designer...
What I want to emphasize that perhaps Mercurial is optimized for
"streaming access", but fully packed Git repository requires only
single (well, up to details) mmap, which I think is even better.
>>> relying on crontab which might not be available in all systems (I only
>>> use GNU/Linux, but what about friends of mine who have to use Windows?)
>>
>> But that doesn't matter in the context of this discussion, which is
>> DragonflyBSD; worse or better support for MS Windows doesn't matter
>> here, does it?
>
> It only matters, if some developers are forced to work on Windows
> machines at times.
DragonFly BSD developers? I think they would work on DragonFly BSD
(eating one's own dogfood and all that...).
Sidenote: I don't know if DragonFly BSD is more like Linux kernel, or
as Linux distribution. It would be in my opinion good idea to ask
similar projects about the impressions about SCM they use (Linux kernel,
Android, ALT Linux distribution, Debian (build tools etc.), CRUX Linux
distribution, Exherbo, grml, Source Mage GNU/Linux for impressions
on their Git usage; OpenSolaris, Conary, Heretix, Linux HA, perhaps
Mozilla for impressions on their Mercurial usage;
IIRC ALSA moved from Mercurial to Git, so they could be of help there.
[...]
>> Git just uses different way to keep operations atomic, different way
>> of implementing transactions.
>> And probably requires transactions and locks for that. Git simply uses
>> atomic write solution for atomic update of references.
>
> Doesn't atomic write also need locks, though on a lower level (to ensure
> atomicity)?
No, you can use create then rename to final place trick, making use
of the fact (assumption) that renames are atomic. And Git first write
data, then write references which are used to access this data (this
relies on pruning dangling objects).
I'm not saying that git does not use locks at all, because it does,
for example to edit config file, or update branch and its reflog as
atomic operation. But it needs locking in very few places.
>> Behind the scenes, at a lower level, Git does necessary delta resolving.
>> Delta chains in packs have limited length (as they have in Mercurial).
>
> So both do snapshots - they seem more and more similar to me :)
There are differences: Mercurial from what I understand uses forward
deltas (from older to never) while Git prefers recency order; delta
chains in Git doesn't need to form single line, but can be forest of
delta chains; Git searches for good delta basis from large range of
objects (see pack.window); there is pack index which allow for random
access as if objects were in loose format (resolving deltas behind the
scenes).
I also don't know how Mercurial deals with binary files; in Git pack
format uses binary delta from LibXDiff by Davide Libenzi (File
Differential Library), heavy modified.
>> The answer usually is: did you have this repository packed? I admit
>> that it might be considered one of disadvantages of git, this having
>> to do garbage collection from time to time... just like in C ;-)
>
> I cloned from the official repositories.
>
> I hope Linus had his repository packed :)
Well, that also depends on _when_ did you try this. In older versions
of Git pack file got from network (git:// and ssh:// protocols) was
exploded into loose objects; now is kept if it is large enough, only
expanding it to make it thick, self contained pack file.
Unless you used http:// protocol, which I think kept packs as they were,
and as dumb protocol (along ftp:// and rsync://) depends on remote
repository being well packed.
>> Well, understanding "git checkout ." doesn't require understanding
>> inner workings of git. Your friend was incorrect here. I'll agree
>> though that it is a bit of quirk in UI[1] (but I use usually
>> "git reset --hard" to reset to last committed state).
>
> Damn - one more way how I could have archieved what I wanted...
> one more way I didn't find.
Well, there is a difference between "git checkout ." and
"git reset --hard", but it does not matter here.
By the way, the design of Git allowed to add lately new feature:
"git checkout --merge <file>..." to recreate conflicted merge in
specified paths. For example if you completely borked merge resolution,
and want to start from scratch.
>> Just Google for "Worse is Better". But what I actually mean that Git
>> feature set and UI has evolved from very bare-bones plumbing, adding
>> features and UI _as needed_, instead of being designed according to
>> what designer thought it was needed.
>
> And that's how it feels to me.
>
> A great testing ground, but it developed too many stumbling blocks
> which keep me from trying things.
Well, as shown in "Worse is better", evolved design wins (Lisp machines
versus Unix) :-)
> When I now use git, I only do the most basic operations: clone, pull, push,
> add, commit, checkout. When anything else arises, I check if it is worth the
> risk of having to read up for hours - and since that wasn't the case for the
> last few months, I then just ignore the problem or ask someone else if he can
> fix it.
Understanding Git "mental model" certainly helps.
[...]
> All in all it's a UI issue - while the git UI bit me quite often, the
> Mercurial UI just works.
But _that_ might be because you are used to Mercurial UI, isn't it?
--
Jakub Narebski
Poland
^ permalink raw reply
* New gitk feature - show where a line came from
From: Paul Mackerras @ 2008-10-27 11:47 UTC (permalink / raw)
To: git
I have just pushed out some commits for gitk which add a feature that
I have wanted for a long time - a way to point at a line in gitk and
say "where did that come from" and have gitk show you the answer. You
can now right-click on a line in the diff/file display pane (bottom
left) and select "Show origin of this line". Gitk will run a one-line
git blame on that line, and once the answer comes back, it will select
the commit that added that line, highlight the line with a light-blue
background, and scroll so that the line is visible. This works both
when displaying diffs and when displaying files.
There are still some minor rough edges, but I'd be interested in
hearing whether it's useful to people, or if people have problems
using it.
This builds on the work done by Alexander Gavrilov, who added the
context menu for the diff/file display pane and a menu item to start
an external git gui blame on a file.
Paul.
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: David Soria Parra @ 2008-10-27 11:42 UTC (permalink / raw)
To: Emanuele Aina; +Cc: mercurial, git
In-Reply-To: <1225100597.31813.11.camel@abelardo.lan>
Emanuele Aina schrieb:
> Jakub Narebski precisò:
>
>>> What do you mean by "cleaner design"?
>> Clean _underlying_ design. Git has very nice underlying model of graph
>> (DAG) of commits (revisions), and branches and tags as pointers to this
>> graph.
>
> Just for reference, the abstract history model of Mercurial and GIT is
> the same, a DAG of changesets identified by their cryptographic hash as
> designed for Monotone, which can be considered the parent of both.
>
> GIT and Mercurial then differs in how this abstract model is written to
> disk, with different tradeoffs in terms of performances and how easily a
> specific feature can be implemented, but there is no reason something
> can be done in GIT but not in Mercurial or viceversa.
Yes, it's the same: a DAG with hashes. But there are limitations due to
the implementation (and not the design). Just as a bad and completely
useless example (don't start to argue, I know it's nothing someone would
like to have): you cannot force mercurial to merge two revisions and
create a merge commit if one is the others ancestor,which is possible in
git with git --no-ff. In addition they differ in some other ways:
Mercurial doesn't have an index to stage commits, which is something
that git has and allows very powerful features (such as git add -i, etc).
^ permalink raw reply
* Re: git working tree status
From: Mike Clarke @ 2008-10-27 11:37 UTC (permalink / raw)
To: git
In-Reply-To: <73f525b90810270412o234bc88by16c67df9df067649@mail.gmail.com>
On Sun, Oct 26, 2008 at 11:23 PM, Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Sun, Oct 26, 2008 at 09:54:03PM +0000, Mike Clarke <clarkema@gmail.com> wrote:
>> b) all changes checked in, but there are some stashes; or
>
> git update-index -q --refresh
> test -z "$(git diff-index --name-only HEAD --)" && echo "everything committed"
>
>> c) 'dirty' in some way -- new files, uncommitted changes, etc.
>
> git update-index -q --refresh
> test -z "$(git diff-index --name-only HEAD --)" && echo "dirty"
>
> see GIT-VERSION-GEN in git.git
>
>> 1) Is there already some way of doing this that I've overlooked?
>> 2) Would the preferred approach be an option (git status --is-clean)
>> or a sub-command (git is-clean)? A sub-command would probably result
>> in cleaner internal code, but would also clutter the interface.
>
> I guess you overlooked the fact that plumbing is supposed to be used
> from scripts and porcelain by the users. git status is porcelain, so
> in general just don't use it from scripts.
>
>> 3) Is a patch for such a feature likely to be accepted?
>
> I don't think so, see above.
Thanks for the pointers! To add a bit of context to the original post, we deal
with a lot of small project repositories at work, and we swap between them
quite a lot. As a result, management of the repositories can be somewhat
burdensome; it's easy to leave a tree in the middle of something, and
then forget.
To get around this, I'm writing a Perl script, called git-map, which
a) can be used to apply a given git command (say, 'fetch') to a whole group of
repositories
b) gives you an overview of the state of all your repos. For example:
546 clarkema@swiss:~/git> git-map summary
C /home/clarkema/git/apollo
C /home/clarkema/git/cerebro
C /home/clarkema/git/dionysus
S /home/clarkema/git/dotfiles
C /home/clarkema/git/packaging/eAccelerator.git
C /home/clarkema/git/programmes/cleo-vc-doc-version-2_0
D /home/clarkema/git/programmes/cumbria-libraries/cumbria-libraries-version-1_0.git
C /home/clarkema/git/services/cleo-service-loadbalancers.git
C /home/clarkema/git/services/cleo-service-proxypac.git
C /home/clarkema/git/services/cleo-service-vc.git
C /home/clarkema/git/services/cleo-service-webgw.git
C /home/clarkema/git/software/configutils.git
C /home/clarkema/git/software/listbuilder.git
C /home/clarkema/git/software/luns-sdp
C /home/clarkema/git/software/proxy-pac.git
C /home/clarkema/git/software/sgdsync.git
D /home/clarkema/git/software/vc-billing
C /home/clarkema/git/toybox/git-contrib-import
This shows me that most of me repos are clean. 'dotfiles' has a stash
on it, and two
others have uncommitted changes. The code I'm currently using, based
on the comments
above, is:
sub cmd_summary
{
foreach my $tree ( sort @trees ) {
local $CWD = $tree;
system( "$GIT update-index -q --refresh" );
# The redirection is somewhat dirty; but is designed to eat the error
# message that occurs if there is no HEAD yet.
system( "$GIT diff-index --quiet HEAD 2> /dev/null" );
if ( $CHILD_ERROR == -1 ) {
print STDERR "Failed to execute $GIT: $OS_ERROR\n";
}
elsif ( $CHILD_ERROR & 127 ) {
printf STDERR "Child died with signal %d\n", ( $CHILD_ERROR & 127 );
}
else {
my $exit_code = $CHILD_ERROR >> 8;
print " ";
if ( $exit_code == 0 ) {
if ( have_stash() ) {
print colored ['yellow'], "S";
}
else {
print colored ['green'], "C";
}
}
elsif ( $exit_code == 1 ) {
print colored ['red'], "D";
}
else {
print colored ['red'], "?";
}
print " $tree\n";
}
}
}
sub have_stash
{
my $ref_stash = 'refs/stash';
system( "$GIT rev-parse --verify $ref_stash > /dev/null 2>&1" );
if ( $CHILD_ERROR == -1 ) {
print STDERR "Failed to execute $GIT: $OS_ERROR\n";
}
elsif ( $CHILD_ERROR & 127 ) {
printf STDERR "Child died with signal %d\n", ( $CHILD_ERROR & 127 );
}
return ( $CHILD_ERROR >> 8 ) == 0;
}
Any comments or suggestions to improve the above would be gratefully received!
Thanks,
--
Mike Clarke
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Jakub Narebski @ 2008-10-27 10:57 UTC (permalink / raw)
To: Benoit Boissinot; +Cc: Arne Babenhauserheide, SLONIK.AZ, mercurial, git
In-Reply-To: <40f323d00810270229w7dfecabcm86e5e611fb4250ef@mail.gmail.com>
Dnia poniedziałek 27. października 2008 10:29, Benoit Boissinot napisał:
> On Mon, Oct 27, 2008 at 2:52 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>> On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
>>> Am Sonntag 26 Oktober 2008 19:55:09 schrieb Jakub Narebski:
>>>>
>>>> I agree, and I think it is at least partially because of Git having
>>>> cleaner design, even if you have to understand more terms at first.
>>>
>>> What do you mean by "cleaner design"?
>>
>> Clean _underlying_ design. Git has very nice underlying model of graph
>> (DAG) of commits (revisions), and branches and tags as pointers to this
>> graph.
>
> Git and Mercurial are very close from that point of view.
>
> Mercurial explicitely disallow octopus merges (and we don't think there's
> a good reason to allow them, although I agree with Linus, they look very nice
> in gitk ;) ).
From what I see Mercurial disallows octopus merges (merges with more
than two parents) because of its rigid-record database repository
design, while Git is more like object database. Fixed width records
of VMS vs delimited records of Unix... There is simply place on
zero, one or two parents (two parent fields, which can be null) in
Mercurial changerev format.
By the way flexibility of Git design allowed to add 'encoding' header
to commit message (if commits message is encoded not in utf-8) after
the fact, without affecting older repository data, and playing well
with old git installations which do not understand this header.
> And we don't have "branches as pointer" in core, but the bookmark
> extension does that.
I disagree. Mercurial implementation of tags is strange, and from
what I remember and from discussion on #revctrl implementation
of local named branches is also strange (CVS-like). They are IMHO
not well designed.
Also the 'hidden' branches after fetching from remote repository
(hg pull) but before merging (hg update) are IMHO worse design
than explicit remote-tracking branches in Git, especially in presence
of multiple [named] branches in repositories.
> Apart from that I think the underlying format are interchangeable,
> someone could use the git format with the hg ui, or use revlogs
> (the basic format of mercurial) like packs.
I don't think so. The 'content addressed filesystem' idea of Git
is quite pervasive along Git implementation and Git thoughtflows.
>
> The only special thing about revlogs is the linkrev stuff, it's a
> pointer to the first revision that introduced an object, so we can
> easily find what to send in our network protocol (we don't have to
> read the manifest, ie the "tree" of objects"). linkrev can be useful
> to speedup "hg log" too.
At first I thought: what a nice idea... but then I realized that in
distributed environment there is no way to define "first revision that
introduced an object". Take for example the following history
(independent introduction):
.---.---.---.---x---.---.---.
\
--x---.---.
where both 'x' have the same version of an object. The top branch
appeared first in current repository, but the bottom branch had 'x'
with earlier timestamp (earlier authordate).
Git just relies on the fact that traversing revision is a part of it
that is heavily optimized and really fast. Git very much by design
doesn't store any backlinks in repository object database.
>> I have read description of Mercurial's repository format, and it is not
>> very clear in my opinion. File changesets, bound using manifest, bound
>> using changerev / changelog.
>>
>
> just do a s/// with the git terminology:
> filelog -> blob
> manifest -> tree
> changelog -> commit object
True. But as I see it they are bound in reverse order in Mercurial:
deltas are stored in filelog, filelogs are bound together in manifest,
manifest are bound using changelog, while in Git commit object
references tree (and parents), trees references blobs, and blob store
content of a file. But that might be just my impression.
.......................................................................
By the way, going back to the matter of choosing version control system
for DragonflyBSD; some time ago I have written post
* "Mercurial's only true "plugin" extension: inotify...
and can it be done in Git?"
http://thread.gmane.org/gmane.comp.version-control.git/76661
(current answer: it is possible using 'assume unchanged' bit)
about how nearly every Mercurial extension has equivalent functionality
in Git.
But what about the reverse, about the following features and
issues in Mercurial:
* Merging in presence of criss-cross merges[1], and in presence of
file renames, i.e what merge-recursive does in Git.
* git-rerere, reusing recorded resolution of conflicted merges.
Resolving the same merge happens often if you use topic branches
and trial merging.
* git-grep that allows you to "and" the match criteria together,
and also pick a file (not a line) that matches all the criteria;
and of course allow searching given revision and not only working
directory.
* pickaxe search (git log -S) which contrary to blame/annotate
allow to find commit which _deleted_ given fragment.
* easy management of multiple repositories you fetch from with
remote-tracking branches and git-remote command.
* blame that follows block-of-line movement (it was invented by Linus
as a vision long time ago, but it took very long time to materialize).
* a way to review merge resolution, something that is done in git
by using combined diff format
* git-stash, allowing to stash away changes to go back to them later;
it allows to stash away even partially resolved merge conflict
(merge resolution in progress).
* git-filter-branch (based on cg-admin-rewrite-hist), which allow
to rewrite history for example to remove file which should never
be added to version control (for example because of copyright
or license).
References:
===========
[1] http://revctrl.org/CrissCrossMerge
BTW I wonder why reverting spam is made so hard on revctrl.org wiki
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Leslie P. Polzer @ 2008-10-27 10:12 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Arne Babenhauserheide, slonik.az, mercurial, git
In-Reply-To: <200810271041.54511.jnareb@gmail.com>
> I'm not sure if I should have mentioned transactions in databases here.
> Oh, well... Note however that there are advanced way of doing
> transactions in relational databases which lead to dangling things
> to be purged when transaction is interrupted.
For the record: transactions are applicable to all kinds of databases,
not only relational ones.
Leslie
^ permalink raw reply
* Re: [RFC PATCH v2] fetch-pack: log(n)-transmission find_common()
From: Nanako Shiraishi @ 2008-10-27 10:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Thomas Rast, git
In-Reply-To: <1224790716-20551-1-git-send-email-trast@student.ethz.ch>
Quoting Thomas Rast <trast@student.ethz.ch>:
> Replaces the existing simple history search with a more sophisticated
> algorithm:
>
> 1) Walk history with exponentially increasing stride lengths; i.e.,
> send the 1st commit, then the 2nd after that, then the 4th after
> that, and so on.
>
> 2) Bisect the resulting intervals.
Junio, may I ask what the status of this patch is? I see Nicolas responded and said "I gave this a quick try". Wasn't it a good enough review?
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: [PATCH] Only update the cygwin-related configuration during state auto-setup
From: Nanako Shiraishi @ 2008-10-27 10:20 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alex Riesen, Mark Levedahl, spearce, dpotapov, git
In-Reply-To: <7viqri35dq.fsf@gitster.siamese.dyndns.org>
Quoting Junio C Hamano <gitster@pobox.com>:
> This is the answer to the question I asked in:
>
> http://thread.gmane.org/gmane.comp.version-control.git/97986/focus=98066
>
> Perhaps we should use a separate variable as the original patch did, in:
>
> http://article.gmane.org/gmane.comp.version-control.git/97987
>
> How about doing it like this instead?
Junio, may I ask what the status of this patch is? I see you did not write tests nor commit message --- are you waiting for others to write them?
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Arne Babenhauserheide @ 2008-10-27 10:14 UTC (permalink / raw)
To: Jakub Narebski; +Cc: mercurial, SLONIK.AZ, git
In-Reply-To: <200810271041.54511.jnareb@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4660 bytes --]
Am Montag 27 Oktober 2008 10:41:53 schrieb Jakub Narebski:
> > If you tell a disk "give me files a, b, c, d, e, f (of the whole abc)",
> > it is faster then if you tell it "give me files a k p q s t", because the
> > filesystem can easier optimize that call.
>
> I would expect _good_ filesystem to be able to optimize this call as
> well. As I said it looks like Mercurial and Git are optimized for
> different cases: Git relies on filesystem for caching, and optimizes
> for warm cache performance.
The problem is by which knowledge the filesystem should optimize this call
when it is storing the files in the first place.
> > relying on crontab which might not be available in all systems (I only
> > use GNU/Linux, but what about friends of mine who have to use Windows?)
>
> But that doesn't matter in the context of this discussion, which is
> DragonflyBSD; worse or better support for MS Windows doesn't matter
> here, does it?
It only matters, if some developers are forced to work on WIndows machines at
times.
> > But Mercurial normally works on standard filesystems, so this isn't the
> > case for normal operations.
>
> Mercurial implements transactions as a way to keeping operations atomic.
> So I don't know what you mean by "normally works on standard filesystem"
> here.
I just meant "databases are a bit off topic" :)
> > You could say, though, that git implements a very simple transaction
> > model: Keep all old data until it gets purged explicitely.
>
> Git just uses different way to keep operations atomic, different way
> of implementing transactions.
That's what I wanted to express.
> And probably requires transactions and locks for that. Git simply uses
> atomic write solution for atomic update of references.
Doesn't atomic write also need locks, though on a lower level (to ensure
atomicity)?
> Behind the scenes, at a lower level, Git does necessary delta resolving.
> Delta chains in packs have limited length (as they have in Mercurial).
So both do snapshots - they seem more and more similar to me :)
> The answer usually is: did you have this repository packed? I admit
> that it might be considered one of disadvantages of git, this having
> to do garbage collection from time to time... just like in C ;-)
I cloned from the official repositories.
I hope Linus had his repository packed :)
> Well, understanding "git checkout ." doesn't require understanding
> inner workings of git. Your friend was incorrect here. I'll agree
> though that it is a bit of quirk in UI[1] (but I use usually
> "git reset --hard" to reset to last committed state).
Damn - one more way how I could have archieved what I wanted... one more way I
didn't find.
> Just Google for "Worse is Better". But what I actually mean that Git
> feature set and UI has evolved from very bare-bones plumbing, adding
> features and UI _as needed_, instead of being designed according to
> what designer thought it was needed.
And that's how it feels to me.
A great testing ground, but it developed too many stumbling blocks which keep
me from trying things.
When I now use git, I only do the most basic operations: clone, pull, push,
add, commit, checkout. When anything else arises, I check if it is worth the
risk of having to read up for hours - and since that wasn't the case for the
last few months, I then just ignore the problem or ask someone else if he can
fix it.
As a contrast, when I encounter a problem with Mercurial, I simply check the
commands for a moment and then try to solve it, and normally I have what I
wanted within seconds to minutes.
Git instead bit me once too often.
I know that this isn't something which hits everyone and that it is
subjective, but since it hit me, I'm wary of git, because in my view it isn't
something for the majority of people - and you almost always have someone from
that "majority" in your project.
I don't want people getting afraid of solving their own problems, so I avoid
systems which bite so often, that they create fear (for example of losing much
time on something which should be a side issue).
All in all it's a UI issue - while the git UI bit me quite often, the
Mercurial UI just works.
Best wishes,
Arne
-- My stuff: http://draketo.de - stories, songs, poems, programs and stuff :)
-- Infinite Hands: http://infinite-hands.draketo.de - singing a part of the
history of free software.
-- Ein Würfel System: http://1w6.org - einfach saubere (Rollenspiel-) Regeln.
-- PGP/GnuPG: http://draketo.de/inhalt/ich/pubkey.txt
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] Teach/Fix pull/fetch -q/-v options
From: Nanako Shiraishi @ 2008-10-27 10:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Tuncer Ayaz, git
In-Reply-To: <1224606624-5082-1-git-send-email-tuncer.ayaz@gmail.com>
Quoting Tuncer Ayaz <tuncer.ayaz@gmail.com>:
> After fixing clone -q I noticed that pull -q does not do what
> it's supposed to do and implemented --quiet/--verbose by
> adding it to builtin-merge and fixing two places in builtin-fetch.
Junio, may I ask what the status of this patch is? Maybe the patch was lost in the noise? The commit log message is written very differently from existing commits in the history of git, and I am thinking that maybe that is why you did not like the whole patch? Or is it lack of any test script?
I like what the quiet option to git-pull does, even though I do not care too much about the verbose option myself.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Jakub Narebski @ 2008-10-27 9:41 UTC (permalink / raw)
To: Arne Babenhauserheide; +Cc: mercurial, SLONIK.AZ, git
In-Reply-To: <200810270850.09696.arne_bab@web.de>
On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
> Am Montag 27 Oktober 2008 02:52:22 schrieb Jakub Narebski:
>> On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
>>> Am Sonntag 26 Oktober 2008 19:55:09 schrieb Jakub Narebski:
>>>>
>>>> I agree, and I think it is at least partially because of Git having
>>>> cleaner design, even if you have to understand more terms at first.
>>>
>>> What do you mean by "cleaner design"?
>>> From what I see (and in my definition of "design"), Mercurial is designed
>>> as VCS with very clear and clean design, which even keeps things like
>>> streaming disk access in mind.
>>
>> I have read description of Mercurial's repository format, and it is not
>> very clear in my opinion. File changesets, bound using manifest, bound
>> using changerev / changelog.
>
> This grows very simple if you keep common filesystem layout in mind.
>
> inodes and datanodes (the files in the store), organized in directories which
> keep many files (manifests) bound in changesets which keep additional data.
Well, for you it might be simple, for others it is binding things
together with duct tape and spit. (I am exaggerating here).
What Mercurial repository design did not get correctly, in my opinion
is its handling of tags and [named] branches.
>> I don't quite understand comment about streaming disk access...
>
> If you tell a disk "give me files a, b, c, d, e, f (of the whole abc)", it is
> faster then if you tell it "give me files a k p q s t", because the filesystem
> can easier optimize that call.
I would expect _good_ filesystem to be able to optimize this call as
well. As I said it looks like Mercurial and Git are optimized for
different cases: Git relies on filesystem for caching, and optimizes
for warm cache performance.
>
> That's why for example Mercurial avoids hashing filenames.
First, git does not hash filenames. The hash is contents, not of name.
You can say it stores objects (in loose format) in hash-based filenames.
Second, in packed repository you don't have to ask filesystem to "give
me files a, k, p, q, s, t (of the whole abc)"; you ask filesystem to
mmap a _single_ pack file (well, almost, there is also pack index to
mmap).
Yes, that means that you should periodically repack for better
performance... but currently git tries to use packed format as much
as possible, keeping packs from network if they are not too small,
repacking if creating large number of objects, etc.
>> Well, they have to a lot less than they used to, and there is
>> "git gc --auto" that can be put in crontab safely.
>
> relying on crontab which might not be available in all systems (I only use
> GNU/Linux, but what about friends of mine who have to use Windows?)
So they would have to either periodically repack by hand, or use some
crontab equivalent on MS Windows.
But that doesn't matter in the context of this discussion, which is
DragonflyBSD; worse or better support for MS Windows doesn't matter
here, does it?
>
>> Explicit garbage collection was a design _decision_, not a sign of not
>> clear design. We can argue if it was good or bad decision, but one
>> should consider the following issues:
>>
>> * Rolling back last commit to correct it, or equivalently amending
>> last commit (for example because we forgot some last minute change,
>> or forgot to signoff a commit), or backing out of changes to the
>> last commit in Mercurial relies on transactions (and locking) and
>> correct O_TRUNC, while in Git it leaves dangling objects to be
>> garbage collected later.
>
> As far as I know the only problem with O_TRUNC was that it sadly had bugs in
> Linux.
>
>> * Mercurial relies on transaction support. Git relies on atomic write
>> support and on the fact that objects are immutable; those that are
>> not needed are garbage collected later. Beside IIRC some of ways of
>> implementing transaction in databases leads to garbage collecting.
>
> But Mercurial normally works on standard filesystems, so this isn't the case
> for normal operations.
Mercurial implements transactions as a way to keeping operations atomic.
So I don't know what you mean by "normally works on standard filesystem"
here.
>
> You could say, though, that git implements a very simple transaction model:
> Keep all old data until it gets purged explicitely.
Git just uses different way to keep operations atomic, different way
of implementing transactions.
I'm not sure if I should have mentioned transactions in databases here.
Oh, well... Note however that there are advanced way of doing
transactions in relational databases which lead to dangling things
to be purged when transaction is interrupted. But this is not to the
point...
>
>> * Explicit packing and having two repository "formats": loose and
>> packed is a bit of historical reason: at the beginning there was
>> only loose format. Pack format was IIRC invented for network
>> transport, and was used for on disk storage (the same format!) for
>> better I/O patterns[1]. Having packs as 'rewrite to pack' instead
>> of 'append to pack' allows to prefer recency order, which result in
>> faster access as objects from newer commits are earlier in delta
>> chain and reduction in size in usual case of size growing with time
>> as recency order allows to use delete deltas. Also _choosing_ base
>> object allows further reduce size, especially in presence of
>> nonlinear history.
>
> So having multiple packs is equivalent to the automatic snapshot system in
> Mercurial which doesn't need user interaction.
Snapshot system doesn't change the fact that Mercurial (from what I
understand) implements forward deltas, from older version to never
version, and not from newer version to older.
Also from what I remember Mercurial didn't implement deltification
right from the start; it had problems with nonlinear history (it used
delta from last version appended, not from the parent version).
>> * From what I understand Mercurial by default uses packed format for
>> branches and tags; Git uses "loose" format for recent branches
>> (meaning one file per branch), while packing older references.
>> Using loose affects performance (and size) only for insane number of
>> references, and only for some operations like listing all references,
>> while using packed format is IMHO a bit error prone when updating.
>
> As far as I know, Mercurial got that "using packed format" right from the
> beginning.
And probably requires transactions and locks for that. Git simply uses
atomic write solution for atomic update of references.
>
>> * Git has reflogs which are pruned (expired) during garbage collecting
>> to not grow them without bounds; AFAIK Mercurial doesn't have
>> equivalent of this feature.
>>
>> (Reflogs store _local_ history of branch tip, noting commits,
>> fetches, merges, rewinding branch, switching branches, etc._
>
> As far as I know Mercurial only tracks the state of the working directory, so
> it doesn't track your whole local history.
>
> But others can better tell you more about that in greater detail.
Reflogs are very useful, and are natural extension of simple rollback
last transaction Mercurial has (which Git had equivalent from the very
beginning in the form of ORIG_HEAD). They allow for example for you
go back to the state before incorrect rewinding a branch, or before
applying series of patches from email, etc.
>> [1] You wrote about "streaming disk access". Git relies (for reading)
>> on good mmap implementation.
>>
>>> In git is has to check all changesets which affect the file.
>>
>> I don't understand you here... if I understand correctly above,
>> then you are wrong about Git.
>
> Might be that I remember incorrectly about what git does.
>
> Are its commits "the whole changed file" or "the diff of the changes"?
>
> If the latter, it needs to walk back all commits to the snapshot revision to
> get the file data.
Git is snapshot based SCM, although 'behind the scenes' it uses deltas
in the pack format. So to get file data at given revision (i.e. to do
something like "git show <revision>:<filename>") it needs to access
<revision>, access its tree, and access contents of a file (blob).
Behind the scenes, at a lower level, Git does necessary delta resolving.
Delta chains in packs have limited length (as they have in Mercurial).
> One story I experienced with that:
>
> My amd64 GNU/Linux box suffers from performance problems when it gets high
> levels of disk activity (something about the filesystem layer doesn't play
> well with amd64 - reported by others, too).
>
> When I pulled a the Linux kernel repository with git half a year ago, my disk
> started klicking and the whole computer slowed down to a crawl.
>
> When I pulled the same repository data from a Mercurial repository, the
> computer kept running smooth, the disk stayed silent and happily wrote the
> data.
>
> Mercurial felt smooth, while git felt damn clumsy (though not slow).
The answer usually is: did you have this repository packed? I admit
that it might be considered one of disadvantages of git, this having
to do garbage collection from time to time... just like in C ;-)
>>> 1) Hg is easy to understand
>>
>> Because it is simple... and less feature rich, c.f. multiple local
>> branches in single repository.
>
> That works quite well. People just don't use it very often, because the
> workflow of having multiple repositories is easier with hg.
Workflow of having multiple repositories, or one branch per repository,
is IMHO as simple in Git as in Mercurial, and as in Bazaar-NG.
>>> 2) You don't have to understand it to use it
>>
>> You don't have to understand details of Git design (pack format, index,
>> stages, refs,...) to use it either.
>
> I remember that to have been incorrect about half a year ago, when I stumbled
> over many problems in git whenever I tried to do something a bit nonstandard.
>
> It took me hours (and in the end asking a friend) to find out about
>
> "git checkout ."
>
> just to get back my deleted files.
>
> The answer I got when I asked why it's done that way was "this is because of
> the inner workings of git. You should know them if you use it".
Well, understanding "git checkout ." doesn't require understanding
inner workings of git. Your friend was incorrect here. I'll agree
though that it is a bit of quirk in UI[1] (but I use usually
"git reset --hard" to reset to last committed state).
[1] Having git-checkout behave very differently with and without
pathname parameter, and overloading of git-checkout.
>>> And both are indications of a good design, the first of the core, the
>>> second of the UI.
>>
>> Well, Git is built around concept of DAG of commits and branches as
>> references to it. Without it you can use Git, but it is hard. But
>> if you understand it, you can understand easily most advanced Git
>> features.
>>
>> I agree that Mercurial UI is better; as usually in "Worse is Better"
>> case... :-)
>
> What do you mean with that?
Just Google for "Worse is Better". But what I actually mean that Git
feature set and UI has evolved from very bare-bones plumbing, adding
features and UI _as needed_, instead of being designed according to
what designer thought it was needed.
For example in http://gitster.livejournal.com/9970.html Junio C Hamano
(git maintainer) writes:
By the time the basic structure as we currently know has stabilized,
we had help from literally dozens of contributors to add many things
on top of the very original version:
[...]
* We did not envision that multiple branches in a single repository
would turn out to be such a useful way to work, and did not have
support for switching branches.
[...]
It still is amazing that all of these were done without having to go
back to the drawing board. It shows how sound the initial conceptual
design was.
P.S. See "Innovations in git", http://gitster.livejournal.com/16077.html
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Benoit Boissinot @ 2008-10-27 9:29 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Arne Babenhauserheide, SLONIK.AZ, mercurial, git
In-Reply-To: <200810270252.23392.jnareb@gmail.com>
On Mon, Oct 27, 2008 at 2:52 AM, Jakub Narebski <jnareb@gmail.com> wrote:
> On Mon, 27 Oct 2008, Arne Babenhauserheide wrote:
>> Am Sonntag 26 Oktober 2008 19:55:09 schrieb Jakub Narebski:
>> >
>> > I agree, and I think it is at least partially because of Git having
>> > cleaner design, even if you have to understand more terms at first.
>>
>> What do you mean by "cleaner design"?
>
> Clean _underlying_ design. Git has very nice underlying model of graph
> (DAG) of commits (revisions), and branches and tags as pointers to this
> graph.
Git and Mercurial are very close from that point of view.
Mercurial explicitely disallow octopus merges (and we don't think there's
a good reason to allow them, although I agree with Linus, they look very nice
in gitk ;) ).
And we don't have "branches as pointer" in core, but the bookmark extension does
that.
Appart from that I think the underlying format are interchangeable, someone
could use the git format with the hg ui, or use revlogs (the basic
format of mercurial)
like packs.
The only special thing about revlogs is the linkrev stuff, it's a
pointer to the first revision
that introduced an object, so we can easily find what to send in our
network protocol
(we don't have to read the manifest, ie the "tree" of objects").
linkrev can be useful
to speedup "hg log" too.
> I have read description of Mercurial's repository format, and it is not
> very clear in my opinion. File changesets, bound using manifest, bound
> using changerev / changelog.
>
just do a s/// with the git terminology:
filelog -> blob
manifest -> tree
changelog -> commit object
regards,
Benoit
^ permalink raw reply
* Re: [PATCH 0/3] symref rename/delete fixes
From: Miklos Vajna @ 2008-10-27 8:50 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Brandon Casey, git
In-Reply-To: <7vhc6yioyq.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]
On Sun, Oct 26, 2008 at 10:31:09PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
> > Of course you can say that this should be handled by git-remote itself,
> > without using rename_ref() but that not seem to be a good solution to
> > me. (Workaround in the wrong layer, instead of a solution in a good
> > one.)
>
> I do not think it is a workaround at all.
>
> I would even say that the renaming of symref that "git remote rename"
> needs to do is fundamentally different from what rename_ref() is about,
> and trying to cram it into rename_ref() is a grave mistake.
>
> If you "git remote rename origin upstream" when origin/HEAD points at
> refs/remotes/origin/master, you need to make the renamed one point at
> refs/remotes/upstream/master, as you will be renaming origin/master to
> upstream/master.
>
> Normal "rename_ref()" would just rename the ref without touching its
> contents, and if you used it to implement "git remote rename", your
> upstream/HEAD would point at the old name "origin/master" that will
> disappear when rename is finished, wouldn't it? I do not think it is
> useful.
Ah, I missed that. You convienced me, I'll post updated patches later
today. :)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox