Git development
 help / color / mirror / Atom feed
* 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

* Re: [PATCH] Fix potentially dangerous uses of mkpath and git_path
From: Alex Riesen @ 2008-10-27  8:30 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git, Junio C Hamano
In-Reply-To: <490568F5.9060206@viscovery.net>

2008/10/27 Johannes Sixt <j.sixt@viscovery.net>:
> Alex Riesen schrieb:
>> Replace them  with mksnpath/git_snpath and a local buffer
>> for the resulting string.
>
> You should describe your definition of "potentially dangerous" to save the
> reader some time.
>

Yeah. Thought it was obvious. Will do.

^ permalink raw reply

* Re: [PATCH v3 7/8] wt-status: load diff ui config
From: Jeff King @ 2008-10-27  8:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, Matthieu Moy, git
In-Reply-To: <7vmygqiozb.fsf@gitster.siamese.dyndns.org>

On Sun, Oct 26, 2008 at 10:30:48PM -0700, Junio C Hamano wrote:

> > But it makes me a little nervous. On one hand, I think it is definitely
> > the right thing for "status -v" to respect user options. But we do
> > several _other_ diffs in addition, and those are more "plumbing" diffs.
> > I think they should probably at least have diff_basic_config (e.g., for
> > rename limits). But we are applying the diff_ui_config options to all
> > diffs. Looking over the available options, I _think_ there are no nasty
> > surprises. But you never know.
> 
> Up to 6/8 are indisputably good changes.  The next one means well, and
> this one is a requisite step for it, but I agree that this feels somewhat
> risky.

I have to wonder that nobody ever complained about the lack of diff
config here before. If I ever used "git status -v", I would certainly
have been turned off by the lack of color. But maybe everybody is using
"git commit -v" and their editor is colorizing it. Or maybe they just
aren't using color (the only other noticeable thing would be rename
options).

-Peff

^ permalink raw reply

* Re: [msysGit] Re: Weird filename encoding issue
From: Peter Krefting @ 2008-10-27  8:08 UTC (permalink / raw)
  To: Robin Rosenberg
  Cc: msysgit, Johannes Sixt, Alexander Gladysh, Git Mailing List
In-Reply-To: <200810180458.53853.robin.rosenberg@gmail.com>

Robin Rosenberg:

> Git (or msys) under windows is somewhat stupid here as it involves
> the eight-bit locale despite running in a unicode OS. To get UTF-8 on
> XP you can set the codepage to UTF-8 (called 65001 in windows).

That presents itself with a lot of other issues, however, as the
char-based file APIs were only designed to handle up to double-byte
characters. To implement proper Unicode file name support on Windows,
one need to use the "wide" APIs (using wchar_t).

Using those APIs, it does not matter what locale the system is set to.
Everything is then UTF-16, which is trivially converted to and from
UTF-8 (and there are even native APIs to do it if one can't be bothered
to write code for it).

I have been meaning to check out a copy of the Msysgit source tree and
see how difficult it would be to replace the file API layer with proper
Unicode support, but time keeps fleeing from me, so I never seem to get
around to :-/

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply

* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Arne Babenhauserheide @ 2008-10-27  7:50 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: mercurial, SLONIK.AZ, git
In-Reply-To: <200810270252.23392.jnareb@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7896 bytes --]

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"?
>
> Clean _underlying_ design. Git has very nice underlying model of graph
> (DAG) of commits (revisions), and branches and tags as pointers to this
> graph.
>
> > 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. 

> Mercurial relies on transactions and O_TRUNC support, while Git relies
> on atomic write and on updating data then updating reference to data.

For most operations Mercurial just relies on appending support. 

> 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. 

That's why for example Mercurial avoids hashing filenames. 

> 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?)

> 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 woth 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. 

You culd say, though, that git implements a very simple transaction model: 
Keep all old data until it gets purged explicitely. 

>  * 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. 

>  * 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. 

>  * 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. 

> [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. 

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). 

> > 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. 

> > 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". 

> > 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? 

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: [VOTE] git versus mercurial (for DragonflyBSD)
From: dhruva @ 2008-10-27  7:16 UTC (permalink / raw)
  To: SLONIK.AZ; +Cc: Arne Babenhauserheide, mercurial, git, Jakub Narebski
In-Reply-To: <ee2a733e0810262115h705356dfmbc2237f8e88f3985@mail.gmail.com>

Hello,

On Mon, Oct 27, 2008 at 9:45 AM, Leo Razoumov <slonik.az@gmail.com> wrote:
> (2) Hg forest extension is still not in the tree with outdated and
> incorrect documentation in the wiki. For me it was biggest reason to
> migrate from Hg to git.

There are a few extensions that ought to be part of main hg, I have
proposed rdiff and am still waiting to hear. Since hg depends a lot on
extensions to extend it (good design), commnly used or useful
extensions must be made part of mainstream at a steady pace.
Otherwise, new users who are not aware of existence of various
extensions will start comparing main hg with git. Since git has most
of the features in the core part, hence the comparisons will be not
apple to apple.

-dhruva

-- 
Contents reflect my personal views only!

^ permalink raw reply

* Re: [VOTE] git versus mercurial (for DragonflyBSD)
From: Arne Babenhauserheide @ 2008-10-27  7:16 UTC (permalink / raw)
  To: SLONIK.AZ; +Cc: mercurial, Jakub Narebski, git
In-Reply-To: <ee2a733e0810262115h705356dfmbc2237f8e88f3985@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]

Am Montag 27 Oktober 2008 05:15:11 schrieb Leo Razoumov:
> >  I created a head-to-head code_swarm of Mercurial and Git and it clearly
> > shows that Mercurial development didn't slow down.
>
> I am not familiar with code swarms, sorry. My impressions are
> subjective are thoroughly un-scientific:-)

That's always the case with code_swarms. 

They only show the commit activity: How often how many files where changed. 

They aren't a fair comparision but a damn unfair battle relying strongly on 
development style, programming language (influences the style) and such. 

What you can see very clearly in them is how activity patterns _change_. 

And the Mercurial activity doesn't slow down. 

Instead in the beginning you can see them pacing each other, git always the 
bigger activity. 
There was a moment in may this year when git activity had receded to the point 
where it was equal to Mercurials activity, but it recovered from that. 

An artifact in Mercurial is that it took an almost two week break in July this 
year, but apart from that development always rolled on, and in august the 
commits where coming fast again. 

The smaller activity can for example be a result of a development style where 
changes are thouroughly discussed before they get implemented. 

> (1) Judging by the activity of mailing lists git community is several
> times larger and more active in terms of actual submitted patches.

This is something which didn't change. Git had higher activity from the start, 
yet Mercurials actual code paced it well and was faster at some things. 

Git still has higher activity, but that can simply stem from Mercurial being 
almost completely done in Python which need less code to do the same work. 

> (2) Hg forest extension is still not in the tree with outdated and
> incorrect documentation in the wiki. For me it was biggest reason to
> migrate from Hg to git.

Why didn't you instead update the documentation in the wiki? 

I don't use the forest extension, so I can't judge whether it is fit for 
inclusion in the tree. 

But I wrote the group extension and learned that way that writing Mercurial 
extensions is far easier than I thought. And different from the shell, Python 
code is platform independent. 

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] Fix potentially dangerous uses of mkpath and git_path
From: Johannes Sixt @ 2008-10-27  7:08 UTC (permalink / raw)
  To: Alex Riesen; +Cc: git, Junio C Hamano
In-Reply-To: <20081026220852.GC18594@blimp.localdomain>

Alex Riesen schrieb:
> Replace them  with mksnpath/git_snpath and a local buffer
> for the resulting string.

You should describe your definition of "potentially dangerous" to save the
reader some time.

-- Hannes

^ permalink raw reply

* Re: [PATCH] Add mksnpath and git_snpath which allow to specify the output buffer
From: Alex Riesen @ 2008-10-27  6:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Linus Torvalds
In-Reply-To: <7v8wsak4mr.fsf@gitster.siamese.dyndns.org>

Junio C Hamano, Mon, Oct 27, 2008 06:07:24 +0100:
> Where is git_snpath() used?

Nowhere yet, but it should replace git_path in every call where the
result is not used immediately. Which, as the story with cygwin
porting shows, can be sometimes not quite trivial (who could suspect
lstat(2) will have application local side effects?).

Maybe I should resend the patches without it, following by patches
introducing git_snpath and replacing calls to git_path.

Maybe Linus should be sued for introducing the function in the first
place.

^ permalink raw reply

* Re: [PATCH] Add support for uintmax_t type on FreeBSD 4.9
From: Junio C Hamano @ 2008-10-27  6:17 UTC (permalink / raw)
  To: David Syzdek; +Cc: git
In-Reply-To: <9a0027270810262246i56cf5515l5fa0875f91d90a7a@mail.gmail.com>

"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).

^ permalink raw reply

* Re: [PATCH] Add support for uintmax_t type on FreeBSD 4.9
From: David Syzdek @ 2008-10-27  5:46 UTC (permalink / raw)
  To: git
In-Reply-To: <9a0027270810262239r311074m51d382bdd95fd0dc@mail.gmail.com>

On Sun, Oct 26, 2008 at 9:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> "David M. Syzdek" <david.syzdek@acsalaska.net> writes:
>
> > This adds NO_UINTMAX_T for ancient systems. If NO_UINTMAX_T is defined, then
> > uintmax_t is defined as uint32_t. This adds a test to configure.ac for
> > uintmax_t and adds a check to the Makefile for FreeBSD 4.9-SECURITY.
> > ...
> > diff --git a/Makefile b/Makefile
> > index 0d40f0e..bf6a6dc 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -931,6 +931,9 @@ endif
> >  ifdef NO_IPV6
> >       BASIC_CFLAGS += -DNO_IPV6
> >  endif
> > +ifdef NO_UINTMAX_T
> > +     BASIC_CFLAGS += -Duintmax_t=uint32_t
> > +endif
>
> 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?


--
An earthquake wiped out Etchisketchistan today.
  -- Onion TV

^ permalink raw reply

* Re: [PATCH 0/3] symref rename/delete fixes
From: Junio C Hamano @ 2008-10-27  5:31 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Jeff King, Brandon Casey, git
In-Reply-To: <cover.1224987944.git.vmiklos@frugalware.org>

Miklos Vajna <vmiklos@frugalware.org> writes:

> A symref-aware rename_ref() is needed by git remove rename, since it
> typically does origin/HEAD -> upstream/HEAD symref renames there.
>
> 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.

There may be cases where you would really want to rename the symbolic ref
without changing its value (e.g. which other ref it points at), but as you
mentioned, even "git branch -m" is not such a usecase.

I think it is better to simply forbid renaming of a symref _until_ we know
what we want it to mean.  It is a lot easier to start strict and then add
features, than start loosely and implement an unclean semantics, and then
having to fix that semantics after people start to rely on the initial
(potentially crazy) semantics.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox