POV-Ray : Newsgroups : povray.off-topic : Git tutorial Server Time
22 Nov 2026 21:45:05 EST (-0500)
  Git tutorial (Message 27 to 76 of 76)  
<<< Previous 26 Messages Goto Initial 50 Messages
From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 13:54:06
Message: <4db06f3e$1@news.povray.org>
On 4/21/2011 2:35, Invisible wrote:
> The Darcs workflow. I download the source code, make a small edit to it, ask
> Darcs to record that, and send the changes to the developers. They add it to
> the central repo, which checks whether the bit I just edited has changed
> since I got my copy. If not [which is quite likely], the change is added to
> the central repo. Done.

OK. All the confusions you think you're seeing in git are due to Darcs just 
not being able to do what git does.

When Darcs gets a merge conflict, it just doesn't apply *either* patch.

"Darcs escapes this problem by ignoring those parts of the patches that 
conflict."

Obviously, if Darcs isn't going to try to fix the patches for you, it's a 
lot easier to record a bunch of conflicting patches. The equivalent in git 
is to pull in changes from other repositories and then not trying to update 
your working directory to include the changes. Trivial one-liner that always 
works.

"If the conflict is with one of your not-yet-published patches, you may 
choose to amend that patch rather than creating a resolve patch."

And that's exactly what the "git merge" command does. It takes your patches, 
and someone else's patches, and merges them together. It's a separate step 
because, unlike Darcs, git supports having more than one "pristine" in the 
same repository. If you only have one branch in git, it's as trivial as only 
having one repository in Darcs.

"This is how a project with many contributors, but every contribution is 
reviewed and manually applied by the project leader, can be run." This is 
the bit about sending email you were talking about. git can work that way, 
and the terrible "merge" problems you're talking about are handled the same 
way: the guy getting the patches fixes the merge.

What Darcs apparently can't do is support any way of doing distributed 
development with an authoritative repository *without* someone dedicated to 
fixing the merge conflicts. That's where the whole rant you're talking about 
came from. If you have someone who is going to look at your changes (i.e., 
if I am CTO and I want to build a new release or something) then the whole 
"fast-forward merge with a rebase" dance is unnecessary and indeed 
counterproductive, as it loses the history of the change (in the same sense 
that unrecording a bunch of changes and re-recording one big change in Darcs 
loses the history).

I'll grant you that Darcs is definitely simpler, but I think it's less 
capable also, and that's the primary place the simplicity comes from. The 
Darcs replace command is interesting, but I'm not sure how well that would 
work in practice, especially in languages with complex scoping.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 21 Apr 2011 16:07:14
Message: <4db08e72@news.povray.org>
>> If you just write "darcs diff", you can see the changes between any two
>> versions of your repo.
>
> What if I want to use kdiff3 or gvimdiff or some other diff
> visualization tool?

Then yeah, you'd have to construct two versions of the repo, just like 
you would with any other version control system.

>> Yeah, it's unclear how you can hope to version control a binary file,
>> other
>> than just keeping a linear sequence of versions (which is what Darcs
>> apparently does). Personally I've never needed to try, but I guess
>> somebody
>> I might.
>
> Word documents. Images. Audio. Video game resources. People want version
> control for all of that.

Trying to use version control for Word documents would be a fairly 
insane thing to do. (Unless you can actually parse the binary file and 
ignore all the metadata...) But sure, I can see how if I was doing 
something other than writing text, I'd probably want to version control 
that too.

> Imagine if you were a Linux developer and people stored installation CD
> ISO images in the repository. Do you really want to check out every copy
> of every install CD just so you can fix bugs in one file system?

Man, version controlling a multi-GB ISO image sounds like a barrel of 
laughs. o_O

>>>> and doesn't even figure out which files changed.
>>>
>>> Yes it does.
>>
>> Then why do you have to manually tell it which files to commit?
>
> Because maybe you don't want to commit all your changes in one step.

So you have to manually remember what you changed? That seems rather... 
primitive. I much prefer the way Darcs does it (i.e., prompt you for 
which changes you want to include in this particular commit).

>> not sure what you mean by "Darcs needs you to do that all in one step".
>
> I mean that gathering up the changes and committing them sounds like a
> single step in Darcs.

A single interactive step, yes.

>> Damn that sounds complicated.
>
> It's very simple with the gui. You start up the gui, it shows you a
> top-left pane of files that have changed that you haven't decided to
> commit yet. Bottom right pane are files that'll be in the commit. Right
> side is the listing of the diffs for whatever file you've highlighted.
>
> If you want to put half the changes from configuration.ini in your
> commit, you click on that, go over to the list of diffs, click on each
> one you want in the commit, then click the commit button.
>
> Pretty trivial.

So Git has a GUI tool that lets you do what Darcs does natively?

>> With a centralised system, usually it's a check-in / check-out model, so
>> only one person can edit a file at once.
>
> Some systems work like that, yes, but they work
> really, really poorly when you have 200 people working on the same
> files

Presumably this is why everybody wants distributed version control now.

>> With something like Darcs, there are now 200 change-sets, each of
>> which is
>> only in some repos. Copy the change-sets around and everything is in sync
>> again. No need for complex "merge" operations or tangled file histories.
>
> Of course you need to merge them, and of course you'll have tangled file
> histories. If all 200 people change the same part of the file, you'll
> have 200 merge conflicts. If everyone is passing around partial change
> sets and making more changes that are dependent on those changes, you'll
> have a tangled file history.

Except that usually 200 people will be editing 200 different parts of 
the repository.

> Basically, you say "go look at the changes I made since I branched off
> the upstream repository, then apply those same changes to the new head
> of the upstream repository, and submit *that* as the new commit."

The Darcs model is "the bugfix for #5326 is *this* alteration". You can 
then apply that to whatever you want. (Unless the modified bit is 
altered, of course.) The Git model seems to be to do lots of extra work 
and then record it as a new item of data, which you don't actually need, 
but that's just hot Git works.

>> No, I meant it would be nice if the Darcs repo format allowed you to
>> update a repo just by copying some files.
>
> Well, git *does* store stuff in files, so technically you could copy the
> files. But by "copy files" I mean "use git to copy the new files." As
> in, "you don't have to run any diffs or patches or anything".

Oh, I see.

>> So doing things the hard way is brilliant?
>
> Building an entire type theory to discuss isomorphic idempotent change
> sets is the easy way?

After you've built it, yes. The theory is hard, but it makes using the 
tool easy.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 21 Apr 2011 16:27:59
Message: <4db0934f$1@news.povray.org>
> Wow. Advice: Don't talk to anyone about how git works, since even if you
> think you've figured it out, you haven't.
>
>> Obviously this model cannot possibly work, so there must be something I'm
>> misunderstanding about how Git works.
>
> Ah, thank you.

Like I said, the way Git appears to work is utterly hopeless, so I must 
have got something wrong somewhere.

> So when you send your change to the maintainers, you're sending them new
> files. There are no merge conflicts, because there is no merge.

Right. Every time you edit a file, it's actually a new file.

> So sending your changes to someone else doesn't cause merge conflicts,
> and there's no need to back them out.

OK.

> When I want to put your changes into *my* version of the files, I have
> to merge it, just like Darcs.

1. Having a copy of someone else's changes is useless unless I can 
incorporate them into the latest version of the files. This is the 
equivilent of three people taking copies of a file, editing it, and 
emailing me back three modified files. I don't want three files, I want 
*one* which has all the edits in it.

2. If I do "darcs pull", all new history is copied to my repo, and the 
working copy is updated to reflect these changes. [Assuming there are no 
conflicts of course.] That's it. That's all you have to do.

With Git, you have to do some crazy thing with comparing my working copy 
to the most recent common ancestor of my branch and the branch I'm 
pulling, creating diffs for that, comparing the most recent common 
ancestor to the snapshot I just pulled, creating a diff for that, 
combining the two diffs, and then applying that to the most recent 
common ancestor. You then have to *create a new commit object* 
representing this new combined state.

Every time you try to combine two states of the repo, it creates a new 
commit object representing the merge. Darcs, by contrast, lets me 
trivially apply any combination of changes I want. I can even create 
files with combinations of changes that have never existed before if I like.

I guess the thing that really flips my lid is that not only does Git 
require you to construct a useless merge commit every time you want to 
do something as trivial as put two changes together, but if you want to 
put new stuff into a repo, you have to somehow get the merge up to date 
first. That sounds increadibly fragile.

It also irritates me that Git insists that even unrelated changes must 
have a linear time ordering. Still, it's not like I actually have to 
*use* Git, so it doesn't really matter if I don't like it...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 17:46:25
Message: <4db0a5b1$1@news.povray.org>
On 4/21/2011 13:07, Orchid XP v8 wrote:
> Then yeah, you'd have to construct two versions of the repo, just like you
> would with any other version control system.

Except git. Because git doesn't store diffs, it stores files. :-)  So it's 
trivial for git to run whatever you want against two different versions of 
the files.

> Man, version controlling a multi-GB ISO image sounds like a barrel of
> laughs. o_O

That's one of the reasons why people like centralized servers.

>>>>> and doesn't even figure out which files changed.
>>>>
>>>> Yes it does.
>>>
>>> Then why do you have to manually tell it which files to commit?
>>
>> Because maybe you don't want to commit all your changes in one step.
>
> So you have to manually remember what you changed?

No, of course not. Are you even reading what I'm writing?  Why would the 
fact that you tell git what changes you want to commit with one command then 
actually commit those with a second command mean that git can't tell what 
you changed?

> I much prefer the way Darcs does it (i.e., prompt you for which
> changes you want to include in this particular commit).

I prefer the GUI, actually. Much easier to pick out various commits to commit.

>>> not sure what you mean by "Darcs needs you to do that all in one step".
>>
>> I mean that gathering up the changes and committing them sounds like a
>> single step in Darcs.
>
> A single interactive step, yes.

Which means you can't (for example) stop in the middle when you realize you 
forgot to make one of the 30 changes you want to commit to fix something in 
particular. You have to start over.

> So Git has a GUI tool that lets you do what Darcs does natively?

It's native to git too. You get to use the command line or a gui. You're 
really not actually reading what I'm writing, are you?

> Except that usually 200 people will be editing 200 different parts of the
> repository.

And if that's the case in git, then you have no trouble merging things when 
and as you want them.

>> Basically, you say "go look at the changes I made since I branched off
>> the upstream repository, then apply those same changes to the new head
>> of the upstream repository, and submit *that* as the new commit."
>
> The Darcs model is "the bugfix for #5326 is *this* alteration". You can then
> apply that to whatever you want. (Unless the modified bit is altered, of
> course.) The Git model seems to be

The git model seems to be something you're still fully unfamiliar with.

 > to do lots of extra work and then record
> it as a new item of data, which you don't actually need, but that's just hot
> Git works.

What extra work? If you just want to commit everything you've changed, you 
say "git commit -all" or some such, and away you go. If you want to take my 
changes and update your repository, you say "git pull darren", and when 
you're ready to incorporate my changes into your development, you say "git 
merge darren".  It's two steps because you don't want to tie "get Darren's 
changes" to "make sure Darren's changes are all compatible with mine."

>>> So doing things the hard way is brilliant?
>>
>> Building an entire type theory to discuss isomorphic idempotent change
>> sets is the easy way?
>
> After you've built it, yes. The theory is hard, but it makes using the tool
> easy.

Honestly, I'm not sure I see any advantage of Darcs over git, other than 
possibly repository size. I imagine once you get enough change sets in a 
repository (think 10 years of Linux development), it could get really slow 
to check out a particular file.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 17:56:26
Message: <4db0a80a$1@news.povray.org>
On 4/21/2011 13:28, Orchid XP v8 wrote:
> Right. Every time you edit a file, it's actually a new file.

In the repository, yes. Obviously, git knows that there's a file in your 
repository with the same path and name as a file in my repository but 
different contents.

>> When I want to put your changes into *my* version of the files, I have
>> to merge it, just like Darcs.
>
> 1. Having a copy of someone else's changes is useless unless I can
> incorporate them into the latest version of the files.

Which latest versions? Oh, right, Darcs only has one latest version, and if 
you don't want to apply changes from someone, you can't fetch them either.

> This is the
> equivilent of three people taking copies of a file, editing it, and emailing
> me back three modified files. I don't want three files, I want *one* which
> has all the edits in it.

That's the merge step. Three people send you three copies. When you're 
ready, you say "apply those changes to my copy."  I'm not sure where your 
confusion is. In Darcs, that's one step it seems - I can't get changes from 
you *without* applying them to the work I'm doing. In git, it's two steps, 
because maybe you're in the middle of something and you don't want to merge 
in my changes until the stuff you're working on actually works and passes 
tests and stuff.

> 2. If I do "darcs pull", all new history is copied to my repo, and the
> working copy is updated to reflect these changes. [Assuming there are no
> conflicts of course.] That's it. That's all you have to do.

So if you have something like Linux, where there's a new release every few 
months, you need a complete repository for every release. And if I fix a bug 
in an old release and you want to incorporate that bug fix into newer 
releases, what do you do?

> With Git, you have to do some crazy thing with comparing my working copy to
> the most recent common ancestor of my branch and the branch I'm pulling,
> creating diffs for that, comparing the most recent common ancestor to the
> snapshot I just pulled, creating a diff for that, combining the two diffs,
> and then applying that to the most recent common ancestor.

git does all that. Complaining about that is like me complaining "To check 
out a working copy from Darcs, I have to do some crazy thing about 
topological sorts on patches, then applying them to empty files in the right 
order, it's nuts!"

 > You then have to
> *create a new commit object* representing this new combined state.

Yes.

> Every time you try to combine two states of the repo, it creates a new
> commit object representing the merge. Darcs, by contrast, lets me trivially
> apply any combination of changes I want. I can even create files with
> combinations of changes that have never existed before if I like.

You can do that in git too. You have to create a commit if you want to store 
it in the repository, tho.

> I guess the thing that really flips my lid is that not only does Git require
> you to construct a useless merge commit every time you want to do something
> as trivial as put two changes together,

Commits are trivially inexpensive in git. They represent the state of some 
particular repository at some particular time. It's how you store stuff.

Say you have 25 changes in your Darcs repository, and you want a version 
that applies every change except #23. What do you put in the repository to 
represent that?

> but if you want to put new stuff
> into a repo, you have to somehow get the merge up to date first.

No. You really aren't listening to what I'm saying, so I'm not sure why I'm 
bothering.

You only have to do that step *IF* nobody is going to look for merge 
conflicts. I.e., *you* have to do that step *only* in the case that *you* 
want to change *my* repository without *me* being there. Which is something 
Darcs can't do at all.

> It also irritates me that Git insists that even unrelated changes must have
> a linear time ordering.

No they don't. Indeed, if unrelated changes had to have a linear time 
ordering, you wouldn't get merge conflicts at all, would you? Then you 
wouldn't be complaining about git having merge commits.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 18:03:15
Message: <4db0a9a3$1@news.povray.org>
On 4/21/2011 14:46, Darren New wrote:
>> So Git has a GUI tool that lets you do what Darcs does natively?
>
> It's native to git too.

Well, actually, the thing is, git has a bunch of layers. There's the layer 
to just put a file into the staging index, a command to create a commit from 
the staging index, a command to point a particular name at a particular 
commit object, etc.

Everything beyond that, including deciding what hunks get included in those 
files and so on, is at the next layer up.  In exactly the same way that 
Darcs runs on top of the file system.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 19:31:26
Message: <4db0be4e@news.povray.org>
On 4/21/2011 13:28, Orchid XP v8 wrote:
> 2. If I do "darcs pull", all new history is copied to my repo, and the
> working copy is updated to reflect these changes. [Assuming there are no
> conflicts of course.] That's it. That's all you have to do.

OK, so say I have a Darcs repository and I'm working on my program. I have 
some changes in my working directory, when I come across a bug. I ask you 
about it, and you say "that's already fixed." Can I pull just that one 
change into my repository?

What if I'm working on version 1 of the program, and you made a fix in 
version 2?  How do I handle that?

Indeed, how do I get out a version of the working directory excluding just 
one particular patch back in time, in order to see (for example) if that 
patch was the cause of a bug?  I didn't see that in the Darcs manual. All I 
saw was deleting changes from the repository.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 19:39:27
Message: <4db0c02f$1@news.povray.org>
On 4/21/2011 13:07, Orchid XP v8 wrote:
>> Well, git *does* store stuff in files, so technically you could copy the
>> files. But by "copy files" I mean "use git to copy the new files." As
>> in, "you don't have to run any diffs or patches or anything".
>
> Oh, I see.

Actually, you can store a repository on an http server and give everyone 
read access to the repository, and everyone can update from there. So, yeah, 
it basically *can* be done by copying the right files from one place to another.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 21 Apr 2011 19:46:12
Message: <4db0c1c4$1@news.povray.org>
On 4/21/2011 13:28, Orchid XP v8 wrote:
> 1. Having a copy of someone else's changes is useless unless I can
> incorporate them into the latest version of the files.

Also, does Darcs record when you applied various patches?

So if, for example, I'm working, and everything's good, and I take some 
patches from you, then work some more, then take some patches from Sam, then 
work some more, then run my test and it fails, can I figure out that it was 
Sam's patches, even if he created those patches before I even cloned the 
repository in the first place?

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 22 Apr 2011 18:29:14
Message: <4db2013a$1@news.povray.org>
On 4/21/2011 13:28, Orchid XP v8 wrote:
> Every time you try to combine two states of the repo, it creates a new
> commit object representing the merge.

Just to be clear, adding your changes to my repository is just adding a 
commit. A commit is like a Darcs patch. One update of the repository is one 
commit.

There's a "merge commit" which is nothing but a commit saying "this is what 
it looks like after you merge two commits."

That said, the Linux repository going back 234 tagged versions (back to 
2.6.11, which isn't all that far back) has 244,000 commits, of which only 
15,000 are merges. So people tend to make 10 or more changes on each branch 
before they merge it into the repository.

I'm not sure I'd want to check out something from Darcs that has a quarter 
million patches in it and wait for Darcs to apply them all one by one. How 
well does it handle that?

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 06:25:18
Message: <4db2a90e$1@news.povray.org>
On 22/04/2011 12:39 AM, Darren New wrote:
> On 4/21/2011 13:07, Orchid XP v8 wrote:
>>> Well, git *does* store stuff in files, so technically you could copy the
>>> files. But by "copy files" I mean "use git to copy the new files." As
>>> in, "you don't have to run any diffs or patches or anything".
>>
>> Oh, I see.
>
> Actually, you can store a repository on an http server and give everyone
> read access to the repository, and everyone can update from there. So,
> yeah, it basically *can* be done by copying the right files from one
> place to another.

I've done this with Darcs. Unfortunately, to update the repo, you 
basically delete it off the server and copy the current version over 
there - which is tedious. (By default, the server would also have a 
working copy - which is pointless. Fortunately, if you delete that bit, 
it still works.)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 06:47:06
Message: <4db2ae2a$1@news.povray.org>
>> I much prefer the way Darcs does it (i.e., prompt you for which
>> changes you want to include in this particular commit).
>
> I prefer the GUI, actually. Much easier to pick out various commits to
> commit.

I will admit, a GUI is probably a superior interface for doing this. 
(And I'm not aware of anyone having built a GUI for Darcs.)

>>>> not sure what you mean by "Darcs needs you to do that all in one step".
>>>
>>> I mean that gathering up the changes and committing them sounds like a
>>> single step in Darcs.
>>
>> A single interactive step, yes.
>
> Which means you can't (for example) stop in the middle when you realize
> you forgot to make one of the 30 changes you want to commit to fix
> something in particular. You have to start over.

True enough. It would be nice if you could make Darcs remember which 
changes you selected last time around. (Then again, some of those 
changes might no longer exist next time you run Darcs...)

>> Except that usually 200 people will be editing 200 different parts of the
>> repository.
>
> And if that's the case in git, then you have no trouble merging things
> when and as you want them.

You still have to manually make Git combine all 200 changes into one 
version, and then commit that. It just seems like an undless cycle of 
merges trying to keep everything straight, generating an ever more 
tangled history behind it.

>> to do lots of extra work and then record
>> it as a new item of data, which you don't actually need, but that's
>> just hot
>> Git works.
>
> What extra work? If you just want to commit everything you've changed,
> you say "git commit -all" or some such, and away you go. If you want to
> take my changes and update your repository, you say "git pull darren",
> and when you're ready to incorporate my changes into your development,
> you say "git merge darren". It's two steps because you don't want to tie
> "get Darren's changes" to "make sure Darren's changes are all compatible
> with mine."

It's more the conceptual annoyance of having to record every merge 
operation as a new version of the entire repo, even if you only changed 
one line. That seems really clumsy to me.

> Honestly, I'm not sure I see any advantage of Darcs over git.

Likewise, but inverted.

Still, until GHC moves from Darcs to Git, I won't have to actually care, 
so I guess it doesn't really matter.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 07:06:30
Message: <4db2b2b6$1@news.povray.org>
On 22/04/2011 12:31 AM, Darren New wrote:

> OK, so say I have a Darcs repository and I'm working on my program. I
> have some changes in my working directory, when I come across a bug. I
> ask you about it, and you say "that's already fixed." Can I pull just
> that one change into my repository?

Obviously yes.

> What if I'm working on version 1 of the program, and you made a fix in
> version 2? How do I handle that?

Depends which way I set it up. If each version of the program is just a 
tag, then see the above. If each version is a seperate repo, you just 
need to pull from the v2 repo. (How much conflict you'll have to deal 
with is another matter - but that's the fun of backporting, eh?)

> Indeed, how do I get out a version of the working directory excluding
> just one particular patch back in time, in order to see (for example) if
> that patch was the cause of a bug?

You say to Darcs "please revert patch #34823". If that doesn't fix your 
problem, you say to Darcs "please revert all unrecorded changes" (since 
the inverse change you just asked for hasn't been recorded yet). If that 
*does* fix your problem... well, you can just hit record, or you can 
investigate further to see if you can keep the good parts of the 
original patch without causeing problems, or whatever.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 07:08:24
Message: <4db2b328$1@news.povray.org>
On 22/04/2011 12:46 AM, Darren New wrote:
> On 4/21/2011 13:28, Orchid XP v8 wrote:
>> 1. Having a copy of someone else's changes is useless unless I can
>> incorporate them into the latest version of the files.
>
> Also, does Darcs record when you applied various patches?

Not to my knowledge, no. It records who created a patch and when, but 
not when it was applied to any particular repo.

> So if, for example, I'm working, and everything's good, and I take some
> patches from you, then work some more, then take some patches from Sam,
> then work some more, then run my test and it fails, can I figure out
> that it was Sam's patches, even if he created those patches before I
> even cloned the repository in the first place?

In that case you're presumably going to revert patches until the problem 
goes away. Maybe one patch broke something, maybe its an interaction of 
several patches. You turn patches on and off until you figure out what's up.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 07:13:57
Message: <4db2b475$1@news.povray.org>
On 22/04/2011 11:29 PM, Darren New wrote:
> On 4/21/2011 13:28, Orchid XP v8 wrote:
>> Every time you try to combine two states of the repo, it creates a new
>> commit object representing the merge.
>
> Just to be clear, adding your changes to my repository is just adding a
> commit. A commit is like a Darcs patch. One update of the repository is
> one commit.
>
> There's a "merge commit" which is nothing but a commit saying "this is
> what it looks like after you merge two commits."

Seems more like because it's so difficult to merge two files, after 
you've done it you have to save it to prevent you having to redo all 
that complex hard work. And in the process, all change application is 
forced to become strictly linear.

Apparently this doesn't stop people working on the Linux kernel. But it 
seems really clumsy to me.

> I'm not sure I'd want to check out something from Darcs that has a
> quarter million patches in it and wait for Darcs to apply them all one
> by one. How well does it handle that?

You're aware that Darcs keeps a cached copy of the latest state of all 
the files, so it doesn't have to recompute them, right?

Last time I tried downloading the repos for GHC, it was dominated by 
network latency. Processor usage was almost non-existent. It just takes 
a long time to shift gigabytes of data over a slow ADSL link. Just as it 
would if I had downloaded a Zip file of the source code with no history 
data at all.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 07:15:09
Message: <4db2b4bd$1@news.povray.org>
>> 1. Having a copy of someone else's changes is useless unless I can
>> incorporate them into the latest version of the files.
>
> Which latest versions? Oh, right, Darcs only has one latest version, and
> if you don't want to apply changes from someone, you can't fetch them
> either.

Hint: Look up "darcs fetch". It fetches changes without applying them.

> That's the merge step. Three people send you three copies. When you're
> ready, you say "apply those changes to my copy." I'm not sure where your
> confusion is.

It's the fact that you have to commit the merged version of the file as 
a new version. Every time you merge in a new change, you have to commit 
a new version. It just seems clunky and unecessary.

> In Darcs, that's one step it seems - I can't get changes
> from you *without* applying them to the work I'm doing.

Not true. You can get changes without applying them. It's just that 
usually, you want to fetch changes to, you know, *use* them.

> In git, it's two
> steps, because maybe you're in the middle of something and you don't
> want to merge in my changes until the stuff you're working on actually
> works and passes tests and stuff.

Then why fetch the changes at all? Why not wait until you're actually 
ready to apply them?

> So if you have something like Linux, where there's a new release every
> few months, you need a complete repository for every release.

Um... why?

> And if I
> fix a bug in an old release and you want to incorporate that bug fix
> into newer releases, what do you do?

Oh, I see. You mean if you actually have multiple versions of something 
being developed concurrently? Yeah, in that case you'd have to move the 
changeset from one branch to another and hope it works.

>> You then have to
>> *create a new commit object* representing this new combined state.
>
> Yes.

So if two people have the same repo, and they merge in change X and then 
later merge in change Y, and then the other guy merges in change Y first 
and later change X, they now apparently have conflicting histories. (And 
all because Git wants to pretend that everything happens in linear 
order.) How do you get out of that?

>> I guess the thing that really flips my lid is that not only does Git
>> require
>> you to construct a useless merge commit every time you want to do
>> something
>> as trivial as put two changes together,
>
> Commits are trivially inexpensive in git. They represent the state of
> some particular repository at some particular time. It's how you store
> stuff.

As I say, it just annoys me that you have to assign an arbitrary 
ordering to changes.

> Say you have 25 changes in your Darcs repository, and you want a version
> that applies every change except #23. What do you put in the repository
> to represent that?

You ask Darcs to revert change #23.

>> It also irritates me that Git insists that even unrelated changes must
>> have a linear time ordering.
>
> No they don't. Indeed, if unrelated changes had to have a linear time
> ordering, you wouldn't get merge conflicts at all, would you?

This doesn't make any sense to me at all...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 07:21:55
Message: <4db2b653$1@news.povray.org>
On 21/04/2011 06:54 PM, Darren New wrote:

> OK. All the confusions you think you're seeing in git are due to Darcs
> just not being able to do what git does.
>
> When Darcs gets a merge conflict, it just doesn't apply *either* patch.
>
> "Darcs escapes this problem by ignoring those parts of the patches that
> conflict."

Interesting. And here I was thinking it marks the conflicting parts of 
the files for you so you can go fix it...

> "If the conflict is with one of your not-yet-published patches, you may
> choose to amend that patch rather than creating a resolve patch."
>
> And that's exactly what the "git merge" command does.

I thought "git merge" just combines changes, not resolves conflicts.

> "This is how a project with many contributors, but every contribution is
> reviewed and manually applied by the project leader, can be run." This
> is the bit about sending email you were talking about. git can work that
> way, and the terrible "merge" problems you're talking about are handled
> the same way: the guy getting the patches fixes the merge.
>
> What Darcs apparently can't do is support any way of doing distributed
> development with an authoritative repository *without* someone dedicated
> to fixing the merge conflicts. That's where the whole rant you're
> talking about came from.

I wasn't even talking about conflicts. I'm talking about the fact that 
if the central repo changes, even in a way which does *not* conflict 
with your changes, you still have to update your local repo, remerge all 
the changes, and try again.

> I'll grant you that Darcs is definitely simpler, but I think it's less
> capable also, and that's the primary place the simplicity comes from.

I disagree, but I don't think this argument is going anywhere productive 
right now.

> The Darcs replace command is interesting, but I'm not sure how well that
> would work in practice, especially in languages with complex scoping.

Yeah, it's only really useful for global names (e.g., functions or 
types). If you've got a dozen functions with a variable named "x1" and 
you want to make it "x_in" in one of them... yeah, good luck. Really, 
you're going to have to sort it out by hand.

What should *really* happen is that Darcs looks at your edits and 
*detects* that it's a find-and-replace affecting only certain lines, and 
record that. But anyway...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 12:58:22
Message: <4db3052e$1@news.povray.org>
On 4/23/2011 3:47, Orchid XP v8 wrote:
> I will admit, a GUI is probably a superior interface for doing this. (And
> I'm not aware of anyone having built a GUI for Darcs.)

There's a couple of standard git guis that come with git. One for really 
sophisticated exploration of the history and one for manipulation of the 
repository and working directory.

>> Which means you can't (for example) stop in the middle when you realize

> True enough. It would be nice if you could make Darcs remember which changes
> you selected last time around. (Then again, some of those changes might no
> longer exist next time you run Darcs...)

Git also does some various funky things. Like if you're doing merges and you 
get a conflict, it leaves extra information in the "index" part to keep 
track of which merge conflicts you've fixed and which you haven't. The 
"bisect" routine (which Darcs has as well) uses that area to track stuff. Etc.

Of course, in git they'll still exist, because it gets copied into the 
repository when you say "remember this change", not when you say "commit".

> You still have to manually make Git combine all 200 changes into one
> version, and then commit that.

But if they don't conflict, then that's one step.  (Well, one step for each 
of the 200 changes, just like in Darcs.)

> It just seems like an undless cycle of merges
> trying to keep everything straight, generating an ever more tangled history
> behind it.

No, it doesn't really work like that. Like I said, of the Linux repo, 
there's 240,000 commits, of which 15,000 are actually merges. Git has a lot 
of ways of editing the history to make it look simpler, which is where all 
the perceived complexity of git lies.

> It's more the conceptual annoyance of having to record every merge operation
> as a new version of the entire repo, even if you only changed one line. That
> seems really clumsy to me.

Just so you know: There's merges, and there's commits. A commit is the same 
as what Darcs calls a changeset. A merge is when you have two different 
branches that you're putting into one repository.

In git, a commit is a trivial thing. You say "git commit" just like in Darcs 
you say "darcs record."  I do dozens of git commits a day just farting 
around with my own programs.

In git, a merge is when you take two branches and apply the changes from one 
branch to the other branch. In Darcs, this would involve two separate 
repositories, one being updated from the other. It's about the same 
complexity as that.

>> Honestly, I'm not sure I see any advantage of Darcs over git.
>
> Likewise, but inverted.

Well, here's the advantages of git, so far:

Git can keep multiple branches in one repository, which makes it easier to 
move changes around, look at history, try out new combinations of changes, etc.

Git keeps track of where changes came from and when, so if I pull in a 
2-month-old changeset and it breaks something, I can figure out when I 
pulled it in vs when you wrote the change. (I didn't see that in Darcs, but 
I didn't look very close.)

git keeps a history that can tell me what changes rely on other changes 
semantically, not just syntactically. (I.e., the thing Darcs tries to do 
with the retoken command, except that really only works for one specific 
type of semantic change and still only works syntactically.)

git doesn't have to spend tens of hours applying 240,000 change sets to the 
repository in order to give me the latest version of the files.

git has all kinds of sweet tools to manipulate the repository in ways Darcs 
can't very easily. (Basically, you'd have to tell Darcs to make a bunch of 
snapshots, then fiddle with the snapshots the same way git would fiddle with 
the repository itself.)

> Still, until GHC moves from Darcs to Git, I won't have to actually care, so
> I guess it doesn't really matter.

Not unless you wind up working on a project that uses git.

I think 90% of your confusion with git is you're trying to think about it 
like you think about Darcs, in terms of a series of changes, which is why I 
posted the original link in the first place.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:00:06
Message: <4db30596@news.povray.org>
On 4/23/2011 3:25, Orchid XP v8 wrote:
> On 22/04/2011 12:39 AM, Darren New wrote:
>> On 4/21/2011 13:07, Orchid XP v8 wrote:
>>>> Well, git *does* store stuff in files, so technically you could copy the
>>>> files. But by "copy files" I mean "use git to copy the new files." As
>>>> in, "you don't have to run any diffs or patches or anything".
>>>
>>> Oh, I see.
>>
>> Actually, you can store a repository on an http server and give everyone
>> read access to the repository, and everyone can update from there. So,
>> yeah, it basically *can* be done by copying the right files from one
>> place to another.
>
> I've done this with Darcs. Unfortunately, to update the repo, you basically
> delete it off the server and copy the current version over there - which is
> tedious. (By default, the server would also have a working copy - which is
> pointless. Fortunately, if you delete that bit, it still works.)

Yeah. You can't update git via http, but you can update a repository stored 
on the server and then there's a command called "update-http-hook" or 
something that refreshes the index that clients use to quickly find files on 
the http server. (I.e., the clients need to be able to get a directory 
listing of all the heads of branches, which is something an http server 
never really standardized.)

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:38:49
Message: <4db30ea9$1@news.povray.org>
>> You still have to manually make Git combine all 200 changes into one
>> version, and then commit that.
>
> But if they don't conflict, then that's one step. (Well, one step for
> each of the 200 changes, just like in Darcs.)

Except that you have to record the order you did it in, even though it 
doesn't actually matter.

>> It just seems like an undless cycle of merges
>> trying to keep everything straight, generating an ever more tangled
>> history behind it.
>
> No, it doesn't really work like that. Like I said, of the Linux repo,
> there's 240,000 commits, of which 15,000 are actually merges. Git has a
> lot of ways of editing the history to make it look simpler, which is
> where all the perceived complexity of git lies.

I might suggest that if you *need* the ability to edit history to make 
it look simpler, you're doing it wrong.

> Just so you know: There's merges, and there's commits. A commit is the
> same as what Darcs calls a changeset. A merge is when you have two
> different branches that you're putting into one repository.
>
> In git, a commit is a trivial thing. You say "git commit" just like in
> Darcs you say "darcs record." I do dozens of git commits a day just
> farting around with my own programs.
>
> In git, a merge is when you take two branches and apply the changes from
> one branch to the other branch. In Darcs, this would involve two
> separate repositories, one being updated from the other. It's about the
> same complexity as that.

Except that with Darcs, you don't need to record the fact that a branch 
ever even existed. You just record what was done with the actual file 
contents.

> Well, here's the advantages of git, so far:
>
> Git can keep multiple branches in one repository

I don't know how that works, but if you mean you can have multiple 
working copies, then yes, I guess that could be quite useful.

> Git keeps track of where changes came from and when, so if I pull in a
> 2-month-old changeset and it breaks something, I can figure out when I
> pulled it in vs when you wrote the change.

I'm not sure I see why you would need that information, but OK, Darcs 
can't tell you about that.

> git keeps a history that can tell me what changes rely on other changes
> semantically, not just syntactically.

How?

> git doesn't have to spend tens of hours applying 240,000 change sets to
> the repository in order to give me the latest version of the files.

Neither does Darcs.

> git has all kinds of sweet tools to manipulate the repository in ways
> Darcs can't very easily.

Ways such as what?

>> Still, until GHC moves from Darcs to Git, I won't have to actually
>> care, so I guess it doesn't really matter.
>
> Not unless you wind up working on a project that uses git.

That isn't going to happen.

1. I will never wind up "working" on anything that's version-controlled. 
I am apparently doomed to spend the rest of my /working/ life rebooting 
people's PCs because Word crashed, rather than doing interesting coding 
tasks.

2. If we're talking about hobby projects, obviously I'm going to pick 
one that uses my preferred tools.

> I think 90% of your confusion with git is you're trying to think about
> it like you think about Darcs, in terms of a series of changes, which is
> why I posted the original link in the first place.

It's not that I don't understand the difference between Git and Darcs. 
It's that I can't begin to comprehend how what Git does can work. It 
just seems such an obviously stupid way to approach the problem.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:40:58
Message: <4db30f2a$1@news.povray.org>
On 4/23/2011 4:08, Orchid XP v8 wrote:
> Not to my knowledge, no. It records who created a patch and when, but not
> when it was applied to any particular repo.

That seems a problem to me, yes. :-)

>> So if, for example, I'm working, and everything's good, and I take some
>> patches from you, then work some more, then take some patches from Sam,
>> then work some more, then run my test and it fails, can I figure out
>> that it was Sam's patches, even if he created those patches before I
>> even cloned the repository in the first place?
>
> In that case you're presumably going to revert patches until the problem
> goes away. Maybe one patch broke something, maybe its an interaction of
> several patches. You turn patches on and off until you figure out what's up.

Sure. But I can't tell after the fact when I sucked Sam's patch in, so if 
Sam wrote the patch 2 months ago and I only started seeing the problem a 
week ago, it's not obvious that it might actually be Sam's patch.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:46:22
Message: <4db3106e@news.povray.org>
On 4/23/2011 4:15, Orchid XP v8 wrote:
> Hint: Look up "darcs fetch". It fetches changes without applying them.

OK. It sounded to me like Darcs had one working copy and one repository, and 
applying all the patches from the repository would give you a "pristine" 
version, and the working version was differenced from the pristine version 
to get the next patch.

So it sounds like you can't actually fetch changes without having them 
actually be relevant to the working directory. If you make the WD match the 
repository, then fetch changes without applying them, then ask for diffs, 
isn't Darcs going to tell you the WD doesn't match the repository? If your 
change added the line ABC, isn't darcs diff going to tell you you removed 
ABC from the WD?

So what do you mean "apply"?  What happens if your WD matches the 
repository, then you do a fetch, then you say "record", what does Darcs do?

> It's the fact that you have to commit the merged version of the file as a
> new version. Every time you merge in a new change, you have to commit a new
> version. It just seems clunky and unecessary.

It's mildly clunky, but it tells you which changes are applied to which 
snapshots. git does this because it records files, not changes, yes. It's 
probably the part of git that people like least.

What happens if I have a number of tags in the repository (v1 and v2 and the 
current v3 under development), and I want to apply a bugfix to the v1 
version that doesn't apply to the later versions? How do I do that?

>> In Darcs, that's one step it seems - I can't get changes
>> from you *without* applying them to the work I'm doing.
>
> Not true. You can get changes without applying them. It's just that usually,
> you want to fetch changes to, you know, *use* them.

But if you have multiple branches, like V1, V2, and V3beta1, and someone 
sends you a new feature for V3beta1, you don't want to apply that to V1 or 
V2.  If you get a bugfix for V1 and make V1.01 you might or might not want 
to apply that to V3.

> Then why fetch the changes at all? Why not wait until you're actually ready
> to apply them?

Welcome to DVCS!

Plus, what do you mean "apply"? git stores multiple branches in one 
repository. I could as easily ask you "why wouldn't you apply every change 
you get to every copy of the Darcs repository for your program?"  The answer 
is "because maybe I don't want to change that repository."

I might want to push changes up to a shared repository so everyone in the 
team can work on them, but I don't want it going into production or even to 
people not on the team.

I might want the development branch to apply the changes but not the branch 
that's half way thru QA testing.

>> So if you have something like Linux, where there's a new release every
>> few months, you need a complete repository for every release.
>
> Um... why?

Because you don't want all the changes applied to old versions of Linux? 
Maybe Darcs tags would do the trick there?

>> And if I
>> fix a bug in an old release and you want to incorporate that bug fix
>> into newer releases, what do you do?
>
> Oh, I see. You mean if you actually have multiple versions of something
> being developed concurrently? Yeah, in that case you'd have to move the
> changeset from one branch to another and hope it works.

And *that* is exactly what a git merge is. You don't do a merge every time 
you record a change. You only do a merge when you're actually, you know, 
merging two sets of changes into one branch of the repository.

A git branch is like a darcs repository.
A git commit is like a darcs record.
A git merge is like a darcs fetch-and-apply.

>>> You then have to
>>> *create a new commit object* representing this new combined state.
>>
>> Yes.
>
> So if two people have the same repo, and they merge in change X and then
> later merge in change Y, and then the other guy merges in change Y first and
> later change X, they now apparently have conflicting histories.

Well, you don't really "merge in" a change. You merge a change from one 
branch to another. You're not merging changes, you're merging branches.

You're not going to have conflicting histories. Indeed, you *can't* have 
conflicting histories because history is immutable. You might have different 
histories in each repository, but that's like having two Darcs repositories 
cloned from the same source but with a different set of changes in each.

So if we start at the same version, and you make three changes, and I make 
three changes, and assuming there's no conflicts, when I merge your changes 
into mine, I'll get the same files as if you merged my changes into yours, 
so we'll both wind up with the same files, except yours will say yours 
committed it and mine will say mine committed it.

Normally the only reason you'd both merge in the other person's changes is 
if you're both going to keep developing on your own. Otherwise, what you 
ought to do is I merge in your changes, and then give you the result to 
continue from.

Obviously it's not a problem if you don't later combine the repositories 
into one history. If you do, then you'll have two branches, and your pointer 
will point to yours, and mine will point to mine, and they'll each be 
pointing to a separate commit with the same files in each one (assuming 
they're identical contents and that you didn't resolve merge conflicts 
differently than I did).

 > (And all
> because Git wants to pretend that everything happens in linear order.)

No, git very specifically does *not* pretend things happen in a linear 
order.  There's all kinds of tools to examine the DAG of dependencies 
between versions.

> How do you get out of that?

If it comes time to turn your work and my work into the same branch, you 
just merge the two branches in both repositories and work from there on, 
which won't cause any merge conflicts because they're all the same files. 
It's a DAG.

It would be similar in Darcs as if I set a tag in my repo and you set one in 
your repo, then we merged them, and now you ask "how do you make a tag that 
incorporates all the changes?"  Well, if I took your changeset and you took 
my change set, we'd have two tags. Make a third tag that points to the 
combined set.

> As I say, it just annoys me that you have to assign an arbitrary ordering to
> changes.

It's not really arbitrary. Darcs just ignores the fact that they aren't.

If I add function AAA to file BBB and record that change, then add a call to 
function AAA into file CCC, then record that change, would that really be 
independent unordered changes in Darcs?  That seems awfully fragile.

>> Say you have 25 changes in your Darcs repository, and you want a version
>> that applies every change except #23. What do you put in the repository
>> to represent that?
>
> You ask Darcs to revert change #23.

And how do you do that? "darcs revert" doesn't do that. "darcs unrecord" 
throws the change away entirely. Obliterate deletes the patch entirely as well.

So it sounds like the actual answer is "you have to clone the entire 
repository, then you have to obliterate the patch, and then you have to 
rebuild the working directory from the new repository, and *then* you're 
done, yes?

>>> It also irritates me that Git insists that even unrelated changes must
>>> have a linear time ordering.
>>
>> No they don't. Indeed, if unrelated changes had to have a linear time
>> ordering, you wouldn't get merge conflicts at all, would you?
>
> This doesn't make any sense to me at all...

Patches within any one branch have a linear time ordering. But git handles 
multiple branches in the same repository. So changes between branches aren't 
linearly ordered.

If changes were all linearly ordered, you'd never have to resolve merges, 
because you could never have two independent patches trying to be applied to 
the same place in the file, because one would definitely come before the 
other, right?

Even on the same branch, while the changes are recorded linearly, if there 
aren't conflicts between them, it's trivial to rearrange the order however 
you want. Just like in Darcs you can't rearrange a patch that deletes a line 
to be applied earlier than the patch that creates the line, so there's a 
partial ordering in Darcs also. Same in git - it's a DAG with a partial 
ordering. It's not linear.

For example, attached is a picture of the last few dozen commits to the 
Linux kernel.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message


Attachments:
Download 'image1.png' (172 KB)

Preview of image 'image1.png'
image1.png


 

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:48:11
Message: <4db310db$1@news.povray.org>
On 4/23/2011 4:14, Orchid XP v8 wrote:
> Seems more like because it's so difficult to merge two files,

It's no more difficult in git than in darcs. It's exactly the same process. 
You apply one set of diffs, then the other. If there are no conflicts, 
you're done. If there are conflicts, you fix them, and you're done.

If there's a branch called "newstuff" and I'm working on "master", and I 
want to merge in the changes from newstuff, I say

git merge newstuff
git commit

If file ABC has a conflict in it, I say

git merge newstuff
vi ABC
git add ABC
git commit

> after you've
> done it you have to save it to prevent you having to redo all that complex
> hard work.

Yes.  Except it's exactly as hard and complex as in Darcs.

> And in the process, all change application is forced to become
> strictly linear.

git doesn't record changes, so no, change application isn't forced to become 
linear.

> Apparently this doesn't stop people working on the Linux kernel. But it
> seems really clumsy to me.

It seems clumsy because you keep thinking git is recording changes. You keep 
thinking of "changes" instead of "versions".

>> I'm not sure I'd want to check out something from Darcs that has a
>> quarter million patches in it and wait for Darcs to apply them all one
>> by one. How well does it handle that?
>
> You're aware that Darcs keeps a cached copy of the latest state of all the
> files, so it doesn't have to recompute them, right?

Sure.

> Last time I tried downloading the repos for GHC, it was dominated by network
> latency. Processor usage was almost non-existent. It just takes a long time
> to shift gigabytes of data over a slow ADSL link. Just as it would if I had
> downloaded a Zip file of the source code with no history data at all.

Yep. But you only got the latest version. If you wanted to get every tag, 
you wind up copying all those files again anyway.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:48:31
Message: <4db310ef$1@news.povray.org>
>> In that case you're presumably going to revert patches until the problem
>> goes away. Maybe one patch broke something, maybe its an interaction of
>> several patches. You turn patches on and off until you figure out
>> what's up.
>
> Sure. But I can't tell after the fact when I sucked Sam's patch in, so
> if Sam wrote the patch 2 months ago and I only started seeing the
> problem a week ago, it's not obvious that it might actually be Sam's patch.

Or, to summarise, "if I let my repo get 6 months out of date with the 
upstream and then pull everything in at once and try to figure out why 
it broke, it'll be quite difficult". My general reaction being "don't do 
that", but OK, I guess it's a valid complaint...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 13:54:29
Message: <4db31255$1@news.povray.org>
On 4/23/2011 4:21, Orchid XP v8 wrote:
>> "If the conflict is with one of your not-yet-published patches, you may
>> choose to amend that patch rather than creating a resolve patch."
>>
>> And that's exactly what the "git merge" command does.
>
> I thought "git merge" just combines changes, not resolves conflicts.

It doesn't. Altho there's the "git rerere" command, which resolves merge 
conflicts the same way you did last time, if you want. :-)

What do you mean by "resolves conflicts"? That's a manual process in git and 
in darcs.

> I wasn't even talking about conflicts. I'm talking about the fact that if
> the central repo changes, even in a way which does *not* conflict with your
> changes, you still have to update your local repo, remerge all the changes,
> and try again.

*If* you're *pushing* to a repository that is unattended, yes. How do you do 
it in Darcs?  What happens if people push conflicts into the central 
repository? Is that where the "we ignore conflicts without telling you" part 
comes in?

>> I'll grant you that Darcs is definitely simpler, but I think it's less
>> capable also, and that's the primary place the simplicity comes from.
>
> I disagree, but I don't think this argument is going anywhere productive
> right now.

It's less capable in that you only have one branch in a Darcs repository, 
and you have no staging area where you can commit in sections. To the extent 
that you avoid doing that in git, they seem pretty much identical to me.

> Yeah, it's only really useful for global names (e.g., functions or types).

Yeah, I try to avoid working in languages with global names. I honestly 
don't really even know any languages like that any more. Even global names 
in C aren't actually global.

> What should *really* happen is that Darcs looks at your edits and *detects*
> that it's a find-and-replace affecting only certain lines, and record that.

Yeah, when your repository system starts understanding that stuff, it has 
some advantages. :-)

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 14:19:05
Message: <4db31819@news.povray.org>
On 4/23/2011 10:38, Orchid XP v8 wrote:
>> But if they don't conflict, then that's one step. (Well, one step for
>> each of the 200 changes, just like in Darcs.)
>
> Except that you have to record the order you did it in, even though it
> doesn't actually matter.

You *can* do all 200 at once, if you want. It's just a mess to specify.

>> No, it doesn't really work like that. Like I said, of the Linux repo,
>> there's 240,000 commits, of which 15,000 are actually merges. Git has a
>> lot of ways of editing the history to make it look simpler, which is
>> where all the perceived complexity of git lies.
>
> I might suggest that if you *need* the ability to edit history to make it
> look simpler, you're doing it wrong.

One is editing history only to back out changes or rearrange commits. Once 
it's in a repository anyone else can see, you can't edit it safely any more. 
Just like Darcs.

> Except that with Darcs, you don't need to record the fact that a branch ever
> even existed. You just record what was done with the actual file contents.

I would classify that as a problem, not a benefit. I'd like to know which 
patches were developed independently, when they were incorporated into the 
current code, etc.

>> Well, here's the advantages of git, so far:
>>
>> Git can keep multiple branches in one repository
>
> I don't know how that works, but if you mean you can have multiple working
> copies, then yes, I guess that could be quite useful.

No. It's exactly like having multiple repositories in one directory. 
Branching in git is cloning the repository in Darcs. Merging in git is a 
pull in Darcs.

>> Git keeps track of where changes came from and when, so if I pull in a
>> 2-month-old changeset and it breaks something, I can figure out when I
>> pulled it in vs when you wrote the change.
>
> I'm not sure I see why you would need that information, but OK, Darcs can't
> tell you about that.

Because if you created a patch six months ago and I only applied it last 
week, it would be good to know that when things start breaking, it *might* 
be because of a change that I only saw a week ago, and I might have to go 
back as far as six months worth of changes to understand the problem.

You really don't see the benefit of knowing the difference between "when I 
wrote the code" and "when I gave you the code"?  It's the same reason you 
put version numbers on executable files you distribute - so you know what 
you're running when.

>> git keeps a history that can tell me what changes rely on other changes
>> semantically, not just syntactically.
>
> How?

Exactly that "linear" order you're complaining about. The DAG of commits 
tells you which changes were written with one version in mind but without 
other changes in mind.

If I change on April 1 the semantics of function XYZ, then I write code  on 
April 3 depending on the new semantics, and you on April 5 write code 
depending on the old semantics, you now have a dependency from your code to 
the April 1 code that isn't recorded anywhere in Darcs.  It's recorded in 
git, tho.

If I have a repository and I merge in a bunch of your changes and apply 
them, then I merge in a bunch of changes from Jim, I could very well get 
tons of conflicts if Jim didn't apply your changes when he started working.
It seems fragile to me to have a working directory and a repository where I 
can incorporate changes into the repository that I cannot get into the 
working directory to work on.

>> git doesn't have to spend tens of hours applying 240,000 change sets to
>> the repository in order to give me the latest version of the files.
>
> Neither does Darcs.

Sure it does. Delete your working directory.

When you clone git, it pulls down the repository, then creates the working 
directory from that. When you clone darcs, it sounds like it pulls down both 
the repository and the working copy (which would seem problematic if the 
working copy had changes to it that weren't recorded, yes?).

>> git has all kinds of sweet tools to manipulate the repository in ways
>> Darcs can't very easily.
>
> Ways such as what?

Like the bisecting command, just as an example. Or the stash command. Or 
commiting things in phases. Or efficiently giving me a copy of the files as 
they existed at a specific point in time. (Indeed, since Darcs doesn't 
actually record what order you pulled changes in, it seems Darcs can't 
really even do that inefficiently.)

>>> Still, until GHC moves from Darcs to Git, I won't have to actually
>>> care, so I guess it doesn't really matter.
>>
>> Not unless you wind up working on a project that uses git.
>
> That isn't going to happen.

BTW, if you ever want to play, there's a script for git that will import the 
changes from and export to a Darcs repository.

http://vmiklos.hu/project/darcs-fast-export/git-darcs

Just from reading the comments, it looks like it stores the Darcs repository 
as one branch of the git repository, treating it like a remote repository.

> 1. I will never wind up "working" on anything that's version-controlled. I
> am apparently doomed to spend the rest of my /working/ life rebooting
> people's PCs because Word crashed, rather than doing interesting coding tasks.

<Yoda> And that is why you fail. </Yoda>

> 2. If we're talking about hobby projects, obviously I'm going to pick one
> that uses my preferred tools.

Sure.

> It's not that I don't understand the difference between Git and Darcs. It's
> that I can't begin to comprehend how what Git does can work. It just seems
> such an obviously stupid way to approach the problem.

It seems like a tremendously elegant system to me, like the relational model 
for version control. You have a big pile of snapshots, one for each 
committed set of changes. All differences are calculated from the snapshots 
as needed.

Darcs too is fairly elegant. If they had a more sophisticated way of 
handling groupings of changes besides "clone the entire repository and then 
make irreversable changes to it" it would be even better.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 14:22:17
Message: <4db318d9$1@news.povray.org>
On 4/23/2011 10:48, Orchid XP v8 wrote:
> My general reaction being "don't do that",

Sounds like a problem for any dvcs. Some development cycles take a while, 
you know? :-)

It seems like a problem exactly because darcs doesn't record what version of 
the code you were using when you made a particular change. If I change 
something "at the same time" as you change something that uses the old 
version, there's nothing recording that you wrote that after I made my 
change but before you actually knew about my change. *That* is the "linear" 
bit you're complaining about in git.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 14:55:44
Message: <4db320b0$1@news.povray.org>
On 23/04/2011 06:46 PM, Darren New wrote:

> If you make the WD match
> the repository, then fetch changes without applying them, then ask for
> diffs, isn't Darcs going to tell you the WD doesn't match the
> repository?

Yes.

> If your change added the line ABC, isn't darcs diff going to
> tell you you removed ABC from the WD?

I'm not precisely sure what you're asking.

> So what do you mean "apply"? What happens if your WD matches the
> repository, then you do a fetch, then you say "record", what does Darcs do?

Records a new patch reverting all the changes that you didn't apply, 
presumably. (Of course, what it's *actually* going to do is prompt you 
for which ones you want to record, but anyway...)

>> It's the fact that you have to commit the merged version of the file as a
>> new version. Every time you merge in a new change, you have to commit
>> a new version. It just seems clunky and unecessary.
>
> It's mildly clunky, but it tells you which changes are applied to which
> snapshots. git does this because it records files, not changes, yes.
> It's probably the part of git that people like least.

It's the part I least like, at any rate.

> What happens if I have a number of tags in the repository (v1 and v2 and
> the current v3 under development), and I want to apply a bugfix to the
> v1 version that doesn't apply to the later versions? How do I do that?

You can't really use tags for that; you'd have to have seperate repos 
for v1, v2 and v3. Oh, you *can* put all the patches in one repo, but 
it's going to get messy very quickly.

> I might want the development branch to apply the changes but not the
> branch that's half way thru QA testing.

The Darcs way to do this is to store copies that are meant to be 
different in different places - which seems fairly logical to me. 
(Admittedly a little inefficient on disk space...)

>> Oh, I see. You mean if you actually have multiple versions of something
>> being developed concurrently? Yeah, in that case you'd have to move the
>> changeset from one branch to another and hope it works.
>
> And *that* is exactly what a git merge is. You don't do a merge every
> time you record a change. You only do a merge when you're actually, you
> know, merging two sets of changes into one branch of the repository.

You don't do a merge every time you record a change. You do a merge 
every time somebody *else* records a change.

> A git branch is like a darcs repository.
> A git commit is like a darcs record.
> A git merge is like a darcs fetch-and-apply.

Except that you don't explicitly keep a record of a darcs fetch-and-apply.

>> So if two people have the same repo, and they merge in change X and then
>> later merge in change Y, and then the other guy merges in change Y
>> first and
>> later change X, they now apparently have conflicting histories.
>
> Well, you don't really "merge in" a change. You merge a change from one
> branch to another. You're not merging changes, you're merging branches.
>
> You're not going to have conflicting histories. Indeed, you *can't* have
> conflicting histories because history is immutable. You might have
> different histories in each repository, but that's like having two Darcs
> repositories cloned from the same source but with a different set of
> changes in each.

So what you're saying is, the histories in two Git repos don't actually 
have to match, only the file contents?

>> (And all
>> because Git wants to pretend that everything happens in linear order.)
>
> No, git very specifically does *not* pretend things happen in a linear
> order. There's all kinds of tools to examine the DAG of dependencies
> between versions.

OK, "linear order within a single branch".

>> As I say, it just annoys me that you have to assign an arbitrary
>> ordering to changes.
>
> It's not really arbitrary. Darcs just ignores the fact that they aren't.
>
> If I add function AAA to file BBB and record that change, then add a
> call to function AAA into file CCC, then record that change, would that
> really be independent unordered changes in Darcs? That seems awfully
> fragile.

Darcs doesn't guarantee that a particular combination of patches will 
produce a working combination of files. Neither does Git, or RCS, or 
CVS. Git /assumes/ that if you apply the changes in the same order that 
the author did, this is more likely to produce a working configuration, 
but there's no /guarantee/ at all.

Changes have descriptions for a reason.

>>> Say you have 25 changes in your Darcs repository, and you want a version
>>> that applies every change except #23. What do you put in the repository
>>> to represent that?
>>
>> You ask Darcs to revert change #23.
>
> And how do you do that? "darcs revert" doesn't do that. "darcs unrecord"
> throws the change away entirely. Obliterate deletes the patch entirely
> as well.

"darcs rollback" does it though.

> Patches within any one branch have a linear time ordering. But git
> handles multiple branches in the same repository. So changes between
> branches aren't linearly ordered.

OK, fair enough. But changes within a branch are linearly ordered.

> For example, attached is a picture of the last few dozen commits to the
> Linux kernel.

What we see here is a long tangled history of sequential changes, rather 
than a set of mostly independent changes which could safely be combined 
in any combination.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 14:56:37
Message: <4db320e5$1@news.povray.org>
On 4/23/2011 10:38, Orchid XP v8 wrote:
>> git has all kinds of sweet tools to manipulate the repository in ways
>> Darcs can't very easily.
>
> Ways such as what?

Here's another example of something I don't understand how to do in Darcs.

Say you and I are both working on the same program. I find a bug in function 
ABC that needs a counter incremented in a loop. At the start of the loop, I 
add the counter increment.  You, at the "same time", find the same bug and 
fix it by adding the counter increment to the end of the loop.

Now, when we merge repositories, we'll be incrementing the counter twice. 
OK, not a problem that a VCS can solve, and you'd get the same ugly in git.

But ... OK, so I see you fixed the bug by adding the counter at the bottom, 
and since I already fixed it, I throw away that change from my repository.

You see you already fixed it, so you throw away my change in *your* repository.

How do we reconcile that later? How often do I have to exclude your change 
from my repository (while still obtaining your other changes), or how do I 
tell you to throw away your change and use mine instead?

In git, I'd manipulate the branch structure, or possibly rebase my changes, 
or I'd revert out that one change from my code during the merge and continue 
on. But since Darcs apparently doesn't record "they both started from the 
same place and made changes in parallel",

I don't see how Darcs can rationally handle the *history* of this change, 
other than having one or the other of us record a change that deletes the 
line that we added, then distributing that change around. I.e., I don't see 
how you can say "add this line, but delete that line it only if you apply 
the patch that fixes the problem elsewhere" in any sort of managable way.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 14:58:48
Message: <4db32168$1@news.povray.org>
>> Apparently this doesn't stop people working on the Linux kernel. But it
>> seems really clumsy to me.
>
> It seems clumsy because you keep thinking git is recording changes. You
> keep thinking of "changes" instead of "versions".

That's because "changes" are the logical thing to think about. Take a 
look at a bunch of commit messages, and they all tell you about what 
just *changed*.

>> Last time I tried downloading the repos for GHC, it was dominated by
>> network latency. Processor usage was almost non-existent.
>
> Yep. But you only got the latest version. If you wanted to get every
> tag, you wind up copying all those files again anyway.

Um... why? The tags are downloaded along with all the rest of the history.

Or perhaps you meant if I wanted GHC-6.6 and GHC-HEAD? In which case, I 
gather that Darcs caches patches which have recently been downloaded, so 
I would only have to download the handful of patches which are actually 
different between the two.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 15:14:46
Message: <4db32526$1@news.povray.org>
On 4/23/2011 11:55, Orchid XP v8 wrote:
>> If your change added the line ABC, isn't darcs diff going to
>> tell you you removed ABC from the WD?
>
> I'm not precisely sure what you're asking.

If I bring my WD up to date, then I fetch changes, then say "record", isn't 
that going to record a diff that backs out all your changes?

>> So what do you mean "apply"? What happens if your WD matches the
>> repository, then you do a fetch, then you say "record", what does Darcs do?
>
> Records a new patch reverting all the changes that you didn't apply,
> presumably.

That sounds really dangerous to me.

>>> It's the fact that you have to commit the merged version of the file as a
>>> new version. Every time you merge in a new change, you have to commit
>>> a new version. It just seems clunky and unecessary.
>>
>> It's mildly clunky, but it tells you which changes are applied to which
>> snapshots. git does this because it records files, not changes, yes.
>> It's probably the part of git that people like least.
>
> It's the part I least like, at any rate.

The tool that shows history has options to leave out commits that are 
nothing but merges without any other changes. :-)

>> What happens if I have a number of tags in the repository (v1 and v2 and
>> the current v3 under development), and I want to apply a bugfix to the
>> v1 version that doesn't apply to the later versions? How do I do that?
>
> You can't really use tags for that; you'd have to have seperate repos for
> v1, v2 and v3. Oh, you *can* put all the patches in one repo, but it's going
> to get messy very quickly.

See, git has no trouble with that. One repo has all of every version of 
Linux since 2.6.16 or so.

>> I might want the development branch to apply the changes but not the
>> branch that's half way thru QA testing.
>
> The Darcs way to do this is to store copies that are meant to be different
> in different places - which seems fairly logical to me. (Admittedly a little
> inefficient on disk space...)

And a bit fragile. The idea of git is that you have a repo with all the 
history in it. You don't have to chop it into multiple repos in order to 
actually exclude some of the history from here and there.

> You don't do a merge every time you record a change. You do a merge every
> time somebody *else* records a change.

No, you do a merge every time you want to *apply* someone else's changes to 
your working directory.

>> A git branch is like a darcs repository.
>> A git commit is like a darcs record.
>> A git merge is like a darcs fetch-and-apply.
>
> Except that you don't explicitly keep a record of a darcs fetch-and-apply.

Exactly. Which seems like a downside to me more than an upside. It means you 
have to have separate repos for different versions of the same program, 
duplicating all that history and making it "fragile" in the operational 
sense (as in, too easy to accidentally update a repo with changes that 
shouldn't be there, with no easy way to remove those changes since the fact 
that you fetched them isn't recorded).

> So what you're saying is, the histories in two Git repos don't actually have
> to match, only the file contents?

The histories merge if two histories bring you to the same set of contents. 
Indeed, since each file is stored with a name based on the hash of its 
contents, it's literally impossible to have the same content in two 
different files.

> OK, "linear order within a single branch".

Yes. And that's a *good* thing, I'd posit, for the reasons I mentioned in 
other threads.

>>> As I say, it just annoys me that you have to assign an arbitrary
>>> ordering to changes.
>>
>> It's not really arbitrary. Darcs just ignores the fact that they aren't.
>>
>> If I add function AAA to file BBB and record that change, then add a
>> call to function AAA into file CCC, then record that change, would that
>> really be independent unordered changes in Darcs? That seems awfully
>> fragile.
>
> Darcs doesn't guarantee that a particular combination of patches will
> produce a working combination of files. Neither does Git, or RCS, or CVS.

Yes. But more than that, Darcs doesn't record what your WD looked like at 
the time you created the changes. *That* is the problem.

In Darcs, I'd have much more trouble tracking this bug down. In git, I'd be 
able to see that you created your patch before you knew about my change to 
function AAA, and maybe that's the source of the problem. In Darcs, I don't 
think I have any way of looking at your patch to CCC and saying "what 
version of file BBB was he reading while he was writing file CCC?"

> Changes have descriptions for a reason.

A manually-entered description isn't going to say what versions of the files 
you *didn't* change you were relying on. That's where the commit history in 
git helps out.

>>>> Say you have 25 changes in your Darcs repository, and you want a version
>>>> that applies every change except #23. What do you put in the repository
>>>> to represent that?
>>>
>>> You ask Darcs to revert change #23.
>>
>> And how do you do that? "darcs revert" doesn't do that. "darcs unrecord"
>> throws the change away entirely. Obliterate deletes the patch entirely
>> as well.
>
> "darcs rollback" does it though.

Oh, OK. But again it makes a permanent change in the repository. I guess 
you'd have to clone the entire repository, then roll back that one patch.

> OK, fair enough. But changes within a branch are linearly ordered.

Yes, and that's a good thing. You can trivially reorder them if they're 
independent, but there's no way of knowing whether they're really 
independent.  Git assumes they aren't, and if they are, you can reorder them 
if you care. Darcs assumes they are unless you tell it so.

>> For example, attached is a picture of the last few dozen commits to the
>> Linux kernel.
>
> What we see here is a long tangled history of sequential changes,

I'm not sure how you get a tangle of sequential changes. What does that even 
mean?

> than a set of mostly independent changes which could safely be combined in
> any combination.

Each of those strings of sequential history is a set of independent changes.

I don't think Darcs is any less tangled, or to the extent it is, I'm not 
sure it would be accurate to rearrange them.

Might I ask, why do you care? You're talking about a VCS being a record of 
the history of changes, and your biggest complaint against git seems to be 
that it's actually recording the history of changes. Darcs seems to throw 
away useful information about the history of the changes in the hope that it 
can automatically deduce enough of the history not to break in the future.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 15:16:50
Message: <4db325a2@news.povray.org>
On 4/23/2011 12:14, Darren New wrote:
>> "darcs rollback" does it though.
>
> Oh, OK. But again it makes a permanent change in the repository.

It also sounds like it would be sketchy if #24 depended on #23 (or even 
changed something else #23 changed) and now your rollback patch has a merge 
conflict? Or your rollback patch has a merge conflict with someone else's 
changes?

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 15:21:09
Message: <4db326a5$1@news.povray.org>
On 4/23/2011 11:58, Orchid XP v8 wrote:
>>> Apparently this doesn't stop people working on the Linux kernel. But it
>>> seems really clumsy to me.
>>
>> It seems clumsy because you keep thinking git is recording changes. You
>> keep thinking of "changes" instead of "versions".
>
> That's because "changes" are the logical thing to think about. Take a look
> at a bunch of commit messages, and they all tell you about what just *changed*.

No. The history is the logical thing to think about. Commits are a logical 
thing to think about. Changes are *one* logical thing to think about, but I 
think it's easier to generate changes from history than to generate history 
from changes, especially when changes aren't in any particular order.

In other words, changes don't represent all the history. You're throwing 
away the history of "clone" and "pull" and "push" and "apply". All you're 
recording is the changes to the files in the WD, not changes in the 
repository itself.

> Or perhaps you meant if I wanted GHC-6.6 and GHC-HEAD?

No, I meant if I wanted to compile each tagged version in the repository. I 
want to compile GHC-1.0, GHC-1.1, GHC-1.2, GHC-2.0, ....

I have to basically apply every patch in sequence in the entire repository, 
in some unknown order.

In git, all those files are already there.  If it's packed, you might wind 
up applying a lot of patches, but the patches are optimal in that case, 
rather than an accident of history.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 15:23:59
Message: <4db3274f$1@news.povray.org>
>>> git keeps a history that can tell me what changes rely on other changes
>>> semantically, not just syntactically.
>>
>> How?
>
> Exactly that "linear" order you're complaining about. The DAG of commits
> tells you which changes were written with one version in mind but
> without other changes in mind.

In other words, Git is *guessing* which changes depend on each other 
semantically from which changes were written at the same point in time 
in the same repo.

I could change thing X, and then change thing Y which has nothing to do 
with thing X, and still Git will assume a relationship exists there. 
Darcs, on the other hand, only concerns itself with *real* dependencies. 
It's true Darcs can't guarantee that a particular combination of patches 
will produce runnable code. It's also true that Git can't guarantee that 
the code in any particular commit object is runnable either.

> If I change on April 1 the semantics of function XYZ, then I write code
> on April 3 depending on the new semantics, and you on April 5 write code
> depending on the old semantics, you now have a dependency from your code
> to the April 1 code that isn't recorded anywhere in Darcs. It's recorded
> in git, tho.

For every true dependency, there will be a bazillion spurious ones. So 
it's a case of "Which is worse? Missing some real dependencies, or 
recording millions of fake ones?" Given that the former is much simpler 
conceptually, I'll go with that thanks.

> If I have a repository and I merge in a bunch of your changes and apply
> them, then I merge in a bunch of changes from Jim, I could very well get
> tons of conflicts if Jim didn't apply your changes when he started working.

Is this not the case for every known distributed version control system?

> It seems fragile to me to have a working directory and a repository
> where I can incorporate changes into the repository that I cannot get
> into the working directory to work on.

Why can't you get them into the working directory?

>>> git doesn't have to spend tens of hours applying 240,000 change sets to
>>> the repository in order to give me the latest version of the files.
>>
>> Neither does Darcs.
>
> Sure it does. Delete your working directory.
>
> When you clone git, it pulls down the repository, then creates the
> working directory from that. When you clone darcs, it sounds like it
> pulls down both the repository and the working copy (which would seem
> problematic if the working copy had changes to it that weren't recorded,
> yes?).

Wrong.

It doesn't pull down the working directory at all. Indeed, in the copy I 
put on my webserver, I *deleted* the working directory.

It pulls down the *pristine* copy, which contains only recorded changes. 
[And is compressed.] If you're silly enough to delete that, then you 
just broke your repo. (I'm not sure whether the repair command can fix 
this... I believe so, but I've never tried it. It probably won't be fast 
though.)

>>> git has all kinds of sweet tools to manipulate the repository in ways
>>> Darcs can't very easily.
>>
>> Ways such as what?
>
> Like the bisecting command, just as an example. Or the stash command.

Without looking those up, I don't know what they do.

> Or commiting things in phases.

You mean like if you go to record something and realise you want to 
tweak it first?

> Or efficiently giving me a copy of the files
> as they existed at a specific point in time. (Indeed, since Darcs
> doesn't actually record what order you pulled changes in, it seems Darcs
> can't really even do that inefficiently.)

You could add a tag before you pull anything in. Then if you have 
problems, you can go back to the tag. (Or just query exactly what 
happened after the tag.) But yes, I suppose the fact that you need to 
remember to do this could be considered a weakness. There's no really 
fundamental reason why Darcs couldn't keep a history of what's happened 
to your repo though. (And keep it local to that repo, not part of the 
shared change history.)

> BTW, if you ever want to play, there's a script for git that will import
> the changes from and export to a Darcs repository.

Given the radically different ways in which the two systems work, I 
imagine the history gets pretty mangled in the conversion - no matter 
which system you believe is the "correct" one.

>> 1. I will never wind up "working" on anything that's
>> version-controlled. I
>> am apparently doomed to spend the rest of my /working/ life rebooting
>> people's PCs because Word crashed, rather than doing interesting
>> coding tasks.
>
> <Yoda> And that is why you fail. </Yoda>

Is this the same Yoda who lived in a universe where you can literally 
make inanimate objects physically move just by *believing* that you can?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 23 Apr 2011 15:38:19
Message: <4db32aab$1@news.povray.org>
>>> So what do you mean "apply"? What happens if your WD matches the
>>> repository, then you do a fetch, then you say "record", what does
>>> Darcs do?
>>
>> Records a new patch reverting all the changes that you didn't apply,
>> presumably.
>
> That sounds really dangerous to me.

Even though it explicitly prompts you whether you want to record each of 
those changes?

>> You can't really use tags for that; you'd have to have seperate repos for
>> v1, v2 and v3. Oh, you *can* put all the patches in one repo, but it's
>> going to get messy very quickly.
>
> See, git has no trouble with that. One repo has all of every version of
> Linux since 2.6.16 or so.

But is that better?

> And a bit fragile. The idea of git is that you have a repo with all the
> history in it. You don't have to chop it into multiple repos in order to
> actually exclude some of the history from here and there.

If Darcs does have a weakness, it's that it mostly assumes that the main 
thing you want to do is perform modifications to the one single "latest 
version" of stuff. It could be made more flexible in this direction, yes.

>> You don't do a merge every time you record a change. You do a merge every
>> time somebody *else* records a change.
>
> No, you do a merge every time you want to *apply* someone else's changes
> to your working directory.

Well, yes, that's what I meant.

>> So what you're saying is, the histories in two Git repos don't
>> actually have to match, only the file contents?
>
> The histories merge if two histories bring you to the same set of
> contents.

I see. I was assuming that if two repos disagree about history, your 
computer would explode or something. So Git is actually smart enough to 
handle that?

>>>> You ask Darcs to revert change #23.
>>>
>>> And how do you do that? "darcs revert" doesn't do that. "darcs unrecord"
>>> throws the change away entirely. Obliterate deletes the patch entirely
>>> as well.
>>
>> "darcs rollback" does it though.
>
> Oh, OK. But again it makes a permanent change in the repository. I guess
> you'd have to clone the entire repository, then roll back that one patch.

I admit, I'm surprised it actually records a patch for it. I would have 
expected it to just alter the WD. But whatever. If you rollback the 
change and then get bored with it, you can then erase the rollback 
patch. [Provided you didn't give it to anyone else.]

I'm guessing this curious glitch is related to the designer's "one true 
latest version" mentallity. The whole *point* of storing history as a 
set of changes should be to make this kind of task easy.

> Might I ask, why do you care? You're talking about a VCS being a record
> of the history of changes, and your biggest complaint against git seems
> to be that it's actually recording the history of changes. Darcs seems
> to throw away useful information about the history of the changes in the
> hope that it can automatically deduce enough of the history not to break
> in the future.

This, fundamentally, seems to be what it all comes down to. You seem to 
think that this information is *useful*, whereas to me it's annoying 
clutter that I'd rather not have to waste time explicitly micro-managing.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 16:54:00
Message: <4db33c68$1@news.povray.org>
On 4/23/2011 12:24, Orchid XP v8 wrote:
> In other words, Git is *guessing* which changes depend on each other
> semantically from which changes were written at the same point in time in
> the same repo.

No. git is merely recording what changes from your repository you had 
already applied to your working directory at the time you made the change. 
It's not guessing that it's semantically meaningful. It's recording it in 
case it is.

> I could change thing X, and then change thing Y which has nothing to do with
> thing X, and still Git will assume a relationship exists there. Darcs, on
> the other hand, only concerns itself with *real* dependencies.

But if you change Y that depends on me *not* having changed X, that's a real 
dependency that darcs does *not* track.

> It's also true that Git can't guarantee that the code in any
> particular commit object is runnable either.

But *I* can guarantee that code in any particular commit object is runnable. 
I can test it. I can't do that with darcs, because fetching new stuff might 
retroactively change whether something works in a way that isn't recorded in 
the repository.

> For every true dependency, there will be a bazillion spurious ones. So it's
> a case of "Which is worse? Missing some real dependencies, or recording
> millions of fake ones?" Given that the former is much simpler conceptually,
> I'll go with that thanks.

I think your "fake dependency" aversion is kind of silly, since nobody 
really records fake dependencies.

>> If I have a repository and I merge in a bunch of your changes and apply
>> them, then I merge in a bunch of changes from Jim, I could very well get
>> tons of conflicts if Jim didn't apply your changes when he started working.
>
> Is this not the case for every known distributed version control system?

Yes. But git lets me resolve the issue, while darcs makes it a very manual 
process for me to figure out *why* Jim's changes conflict.  If I go to merge 
Jim's changes, darcs gives me no help. Git tells me what version Jim's 
changes are *supposed* to merge cleanly into.

>> It seems fragile to me to have a working directory and a repository
>> where I can incorporate changes into the repository that I cannot get
>> into the working directory to work on.
>
> Why can't you get them into the working directory?

Because that messes up my working directory in a way I can't recover from.

> It pulls down the *pristine* copy, which contains only recorded changes.
> [And is compressed.] If you're silly enough to delete that, then you just
> broke your repo. (I'm not sure whether the repair command can fix this... I
> believe so, but I've never tried it. It probably won't be fast though.)

OK, so darcs doesn't record only the changes, but the changes and then the 
result of applying all those changes, *and* you have a working directory. 
That makes a bit more sense I guess.

>> Like the bisecting command, just as an example. Or the stash command.
> Without looking those up, I don't know what they do.

Ways of saving your changes temporarily in a different part of the repository.

>> Or commiting things in phases.
>
> You mean like if you go to record something and realise you want to tweak it
> first?

Yes. Resolving merges a bit at a time, compiling and testing in between, 
rather than having the "record" and "commit" be the same action.

>There's no really fundamental reason why Darcs
> couldn't keep a history of what's happened to your repo though.

I agree. It just doesn't.

 > (And keep it
> local to that repo, not part of the shared change history.)

No, that doesn't work, because you still want that history when you clone 
the repository or it's useless in the bigger picture.  Especially when 
cloning the repository is how you make a temporary branch.

>> BTW, if you ever want to play, there's a script for git that will import
>> the changes from and export to a Darcs repository.
>
> Given the radically different ways in which the two systems work, I imagine
> the history gets pretty mangled in the conversion - no matter which system
> you believe is the "correct" one.

The git import function works by running a script to "get the next version" 
and then checking it in, over and over, until it's all checked in. If you 
can write a script that says "make a file that holds the commit message, and 
a command line to fetch the next version", then you have enough for git.

Of course, darcs doesn't really have a "next version" concept, so that could 
be problematic.

> Is this the same Yoda who lived in a universe where you can literally make
> inanimate objects physically move just by *believing* that you can?

You have a point.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 23 Apr 2011 17:00:34
Message: <4db33df2$1@news.povray.org>
On 4/23/2011 12:38, Orchid XP v8 wrote:
>>>> So what do you mean "apply"? What happens if your WD matches the
>>>> repository, then you do a fetch, then you say "record", what does
>>>> Darcs do?
>>>
>>> Records a new patch reverting all the changes that you didn't apply,
>>> presumably.
>>
>> That sounds really dangerous to me.
>
> Even though it explicitly prompts you whether you want to record each of
> those changes?

Yes.

>>> You can't really use tags for that; you'd have to have seperate repos for
>>> v1, v2 and v3. Oh, you *can* put all the patches in one repo, but it's
>>> going to get messy very quickly.
>>
>> See, git has no trouble with that. One repo has all of every version of
>> Linux since 2.6.16 or so.
>
> But is that better?

I'd say so. YMMV.

> If Darcs does have a weakness, it's that it mostly assumes that the main
> thing you want to do is perform modifications to the one single "latest
> version" of stuff. It could be made more flexible in this direction, yes.

Yeah, that's it. And that everyone is pretty much working on the same 
version of stuff. Works for small scale, not so much for large scale, I think.

>>> You don't do a merge every time you record a change. You do a merge every
>>> time somebody *else* records a change.
>>
>> No, you do a merge every time you want to *apply* someone else's changes
>> to your working directory.
>
> Well, yes, that's what I meant.

Well, that's a different thing. I can record a dozen changes which you apply 
only once.  In the linux kernel it seems to be about 15:1 ratio.

>>> So what you're saying is, the histories in two Git repos don't
>>> actually have to match, only the file contents?
>>
>> The histories merge if two histories bring you to the same set of
>> contents.
>
> I see. I was assuming that if two repos disagree about history, your
> computer would explode or something. So Git is actually smart enough to
> handle that?

There's only one history. Nothing you put into a repo ever changes or 
disappears. So both histories are in the repo, and at the point where I drew 
yours in, it got linked into my history as a loop earlier in the development.

> I'm guessing this curious glitch is related to the designer's "one true
> latest version" mentallity. The whole *point* of storing history as a set of
> changes should be to make this kind of task easy.

Yeah, I think that's the basic problem I have with Darcs. All the things 
that make git complicated compared to darcs have to do with having one 
repository having lots of different versions being developed at different 
speeds.

> This, fundamentally, seems to be what it all comes down to. You seem to
> think that this information is *useful*, whereas to me it's annoying clutter
> that I'd rather not have to waste time explicitly micro-managing.

You really don't have to micromanage it. The git commands are all pretty 
much isomorphic to the darcs commands. It's extremely useful when you merge 
in a change and something breaks, so you can easily go "Oh, I see why, 
because his change says "outputs index counter" and I changed the output 
function *since* he started work on that."

Without that clue, you have to actually look at the "outputs index counter" 
change and read it to see what version of the output routines he's 
expecting, which can be especially confusing if he *wrote* the patch after 
you changed the output function but before he merged and applied your patch.

I'm not all that sure how you can't see how that's helpful. :-)

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 24 Apr 2011 04:35:36
Message: <4db3e0d8$1@news.povray.org>
>> This, fundamentally, seems to be what it all comes down to. You seem to
>> think that this information is *useful*, whereas to me it's annoying
>> clutter
>> that I'd rather not have to waste time explicitly micro-managing.
>
> You really don't have to micromanage it. The git commands are all pretty
> much isomorphic to the darcs commands. It's extremely useful when you
> merge in a change and something breaks, so you can easily go "Oh, I see
> why, because his change says "outputs index counter" and I changed the
> output function *since* he started work on that."
>
> Without that clue, you have to actually look at the "outputs index
> counter" change and read it to see what version of the output routines
> he's expecting, which can be especially confusing if he *wrote* the
> patch after you changed the output function but before he merged and
> applied your patch.
>
> I'm not all that sure how you can't see how that's helpful. :-)

There really has to be a better way of solving this problem than 
serialising the entire change history forever...

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 24 Apr 2011 13:48:37
Message: <4db46275$1@news.povray.org>
On 4/24/2011 1:35, Orchid XP v8 wrote:
> There really has to be a better way of solving this problem than serialising
> the entire change history forever...

Well, as I see it, both git and darcs stores a DAG. Git stores a DAG of 
collections-of-files, and Darcs stores a DAG of collections-of-changes. Git 
stores enough information that you can reproduce the changes from the files 
well after the fact. Darcs does not store enough information that you can 
reproduce files from changes reliably (in that I can't tell what files you 
were looking at when you made a particular change, for example).

So, basically, there are changes that have known dependencies, and changes 
that have unknown dependencies. Git records all history explicitly, 
including dependencies that may or may not actually exist. Darcs assumes if 
you don't tell it about the dependencies that they specifically don't exist. 
Darcs also fails to record anti-dependencies. Git lets you put multiple 
histories in the same repository, while Darcs can't really represent 
multiple histories so you wind up with lots of individual repositories to 
manage with apparently no good tools to compare them (since the DAG between 
different repositories is intentionally discarded when you clone the 
repository, as I understand it).

I think if you're working on a small project, either by yourself or with a 
small team you're in communication with on a frequent basis, either might 
work. Either seems pretty easy to understand.

The only way of improving on serializing the change history is to specify in 
Darcs exactly what you rely upon and what you don't, which would seem to 
require actually doing a full analysis of the program every time you check 
in a change. If function XXX relies on the behavior of function YYY, and you 
change function XXX and I change YYY, there may or may not be a dependency 
between those two changes, depending on whether I "break" your XXX with my 
change to YYY. But then you have to define "break".  I can see, however, how 
a language like Haskell or Eiffel or something with 100% test coverage 
available to every repository holding the project could make that mostly 
feasible.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 28 Apr 2011 04:32:08
Message: <4db92608$1@news.povray.org>
On 20/04/2011 10:44 AM, Invisible wrote:

> I had assumed that all DVCSs were the same, but I now see that at least
> Git and Darcs use fundamentally different models.

This is somewhat related:

http://koweycode.blogspot.com/2011/04/why-darcs-users-care-about-consistency.html

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 28 Apr 2011 12:27:53
Message: <4db99589$1@news.povray.org>
On 4/28/2011 1:32, Orchid XP v8 wrote:
> http://koweycode.blogspot.com/2011/04/why-darcs-users-care-about-consistency.html

Thanks. That's interesting.

"""
The most well-known remaining cause of blowups in theory 2 is the problem of 
"conflict fights" where one side of the conflict resolves the conflict and 
gets on with their life without propagating the resolution back to the other 
side.
"""

This is basically the source of the mess in git, also. In the whole blah 
going on here: http://bramcohen.livejournal.com/74462.html I'm not sure I 
can understand how presenting that work as a set of patches makes sense. 
You'd wind up with a repository that changes A into B twice and B into A 
once without any particular ordering between them, so I'm lost as to how 
Darcs would handle that.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 29 Apr 2011 05:55:10
Message: <4dba8afe$1@news.povray.org>
>> http://koweycode.blogspot.com/2011/04/why-darcs-users-care-about-consistency.html
>
> Thanks. That's interesting.

Interesting, disturbing, whatever you want to call it. ;-)

All describing problems I've never come across. Then again, when your 
development team consists of one person...

> """
> The most well-known remaining cause of blowups in theory 2 is the
> problem of "conflict fights" where one side of the conflict resolves the
> conflict and gets on with their life without propagating the resolution
> back to the other side.
> """

Given the entire purpose of *distributed* revision control... yeah, that 
would be a problem. (Exponential-time merge worries me more though.)

> This is basically the source of the mess in git, also. In the whole blah
> going on here: http://bramcohen.livejournal.com/74462.html I'm not sure
> I can understand how presenting that work as a set of patches makes
> sense. You'd wind up with a repository that changes A into B twice and B
> into A once without any particular ordering between them, so I'm lost as
> to how Darcs would handle that.

You understand that Darcs *does* have an ordering between *related* 
patches, right? It's only *unrelated* patches that have no order 
relationship. I can flip the same line of code back and forth 20 times, 
and record that as 20 patches, and they will have a strictly linear 
ordering.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 29 Apr 2011 12:16:34
Message: <4dbae462$1@news.povray.org>
On 4/29/2011 2:55, Orchid XP v8 wrote:
> You understand that Darcs *does* have an ordering between *related* patches,

Yes, I figured that.

Indeed, that's my main complaint with the whole concept: the idea that 
simply because two patches are in different files doesn't mean they're 
unrelated. If I implement foo() in file abc.c and call foo() in file def.c, 
those are not two unrelated patches.

> right? It's only *unrelated* patches that have no order relationship. I can
> flip the same line of code back and forth 20 times, and record that as 20
> patches, and they will have a strictly linear ordering.


So, you clone a repository and I clone a repository.

You create a file called XX with the line Hello in it.

I create a file called XX with the line Goodbye in it.

We both record our changes.

I then change my XX file to say "Hello\nGoodbye".

You change your XX to say "Goodbye\nHello".

We both record our changes.

I then change my XX file to say "Hello". You change yours to say "Goodbye".

We both record our changes.

We attempt to merge our repositories.

Can you try this on a blank repository on your machine and tell me what happens?

Resolving this in git is very straightforward. You can just pick one that's 
right and say "Henceforth, that's the answer". Or you can just grab all the 
changes and basically never merge them back together again (say, if you have 
two distros in the same repository).

Also, what happens if I rename a file from XXX to YYY and you rename it from 
XXX to ZZZ?  Do I wind up with both YYY and ZZZ in my repository?

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 29 Apr 2011 12:18:55
Message: <4dbae4ef$1@news.povray.org>
On 4/29/2011 2:55, Orchid XP v8 wrote:
> You understand that Darcs *does* have an ordering between *related* patches,
> right? It's only *unrelated* patches that have no order relationship.

BTW, the problem here is that those patches are *not* related. Each branch 
down the side is a separate Darcs repository. So the first guy takes A, 
makes it a B, then patches it back to A. In parallel, in *your* repository, 
you independently take A and make it into B. Now everyone copy all the 
patches from everyone else. Do I wind up with A or B? I'm not sure there's 
an answer there that makes sense from a technical perspective.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 29 Apr 2011 12:55:10
Message: <4dbaed6e$1@news.povray.org>
On 29/04/2011 05:16 PM, Darren New wrote:

> Indeed, that's my main complaint with the whole concept: the idea that
> simply because two patches are in different files doesn't mean they're
> unrelated. If I implement foo() in file abc.c and call foo() in file
> def.c, those are not two unrelated patches.

And my complaint about Git is that just because change X happened after 
change Y does not necessarily mean that change X depends on change Y in 
any way, yet Git assumes that it does.

Fundamentally, I expect working out which changes truly depend on each 
other is probably undecidable. [And that's before we even get into the 
fact that the only way for this to work properly is to implement a 
seperate detection engine for every programming language you ever want 
to version control.]

Apparently both models do work in practise, since there are people using 
them. Personally, I much prefer the way Darcs does it.

> We both record our changes.
>
> We attempt to merge our repositories.
>
> Can you try this on a blank repository on your machine and tell me what
> happens?

I imagine Darcs will say "error, these changes conflict, please fix it". 
And other words, "I can't figure out what to do; you decide".

> Resolving this in git is very straightforward. You can just pick one
> that's right and say "Henceforth, that's the answer". Or you can just
> grab all the changes and basically never merge them back together again
> (say, if you have two distros in the same repository).

That sounds in principle like the same thing that Darcs does.

> Also, what happens if I rename a file from XXX to YYY and you rename it
> from XXX to ZZZ? Do I wind up with both YYY and ZZZ in my repository?

Same again, I would imagine.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Orchid XP v8
Subject: Re: Git tutorial
Date: 29 Apr 2011 12:56:17
Message: <4dbaedb1$1@news.povray.org>
On 29/04/2011 05:18 PM, Darren New wrote:

> BTW, the problem here is that those patches are *not* related. Each
> branch down the side is a separate Darcs repository. So the first guy
> takes A, makes it a B, then patches it back to A. In parallel, in *your*
> repository, you independently take A and make it into B. Now everyone
> copy all the patches from everyone else. Do I wind up with A or B? I'm
> not sure there's an answer there that makes sense from a technical
> perspective.

I haven't tried it personally, but as I understand it, Darcs says "there 
is a conflict here; please decide what you want me to do".

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 29 Apr 2011 13:18:06
Message: <4dbaf2ce$1@news.povray.org>
On 4/29/2011 9:55, Orchid XP v8 wrote:
> yet Git assumes that it does.

Yep. It's a question of whether you're being conservative or not, is all.

> Fundamentally, I expect working out which changes truly depend on each other
> is probably undecidable.

I don't think it's undecidable. I think it merely depends on what your specs 
are.

Indeed, if I take a file that prints nothing and make it print "Hello", and 
you take a file that prints nothing and make it print "Goodbye", then it's 
obviously impossible to figure out in the merge which should come first and 
which should come second, or if either at all is right.

> Apparently both models do work in practise, since there are people using
> them. Personally, I much prefer the way Darcs does it.

I can see the appeal of both. I wasn't really pushing for git as being 
better. My original post was "hey, I found a good way to understand it."

> I imagine Darcs will say "error, these changes conflict, please fix it". And
> other words, "I can't figure out what to do; you decide".

But then how do you resolve it, such that I get the same resolution?

>> Resolving this in git is very straightforward. You can just pick one
>> that's right and say "Henceforth, that's the answer". Or you can just
>> grab all the changes and basically never merge them back together again
>> (say, if you have two distros in the same repository).
>
> That sounds in principle like the same thing that Darcs does.

I don't think Darcs lets me merge your patches back in and easily work on 
one set or the other, right? Each repository really only holds one 
authoritative version of the patches, right?  I.e., there's exactly one 
"pristine" that you compare against?

>> Also, what happens if I rename a file from XXX to YYY and you rename it
>> from XXX to ZZZ? Do I wind up with both YYY and ZZZ in my repository?
>
> Same again, I would imagine.

Yeah, OK.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 29 Apr 2011 15:25:27
Message: <4dbb10a7@news.povray.org>
On 4/29/2011 10:18, Darren New wrote:
> On 4/29/2011 9:55, Orchid XP v8 wrote:
>> yet Git assumes that it does.
>
> Yep. It's a question of whether you're being conservative or not, is all.

Or, to be fair, more appropriately, git doesn't imply that just because 
change A followed change B that change B depends on change A. Reading 
dependencies into the order of commits is reading in something that isn't there.

Git is storing a series of snapshots. Each commit contains a complete record 
of everything that was in your working directory when you committed it 
(sorta, using Darcs terms). Each commit points to the version that was in 
your working directory that you changed in order to get the new version. As 
I said, git doesn't store changes. It says "he started with X, then he had 
with Y," with no real implication that Y somehow depends on X.

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

From: Joel Yliluoma
Subject: Re: Git tutorial
Date: 27 May 2011 04:31:58
Message: <4ddf617e$1@news.povray.org>
On Wed, 20 Apr 2011 16:49:57 +0100 in povray.off-topic, Invisible wrote:
> The problem Git seems to have is that it uses heads to keep track of 
> things. Delete the head and the corresponding commit drops off the face 
> of the Earth.

Actually, there are usually many ways to retrieve a lost head.
.git/logs/ directory is the most prominent tool or that.
The terminal's history buffer is another. Usually the very
commands that drop the current head will print its name.

-- 
Joel Yliluoma - http://iki.fi/bisqwit/


Post a reply to this message

From: Darren New
Subject: Re: Git tutorial
Date: 6 Jun 2011 10:58:25
Message: <4deceb11$1@news.povray.org>
On 5/27/2011 1:31, Joel Yliluoma wrote:
> On Wed, 20 Apr 2011 16:49:57 +0100 in povray.off-topic, Invisible wrote:
>> The problem Git seems to have is that it uses heads to keep track of
>> things. Delete the head and the corresponding commit drops off the face
>> of the Earth.
>
> Actually, there are usually many ways to retrieve a lost head.
> .git/logs/ directory is the most prominent tool or that.

Actually, there are "relog" or "rehead" files or something like that, which 
are basically text files listing each head and the corresponding SHA1 as a 
log file each time you move a head.

Also, doing the equivalent of a chkdsk will give you back any SHA1's that 
don't have anything else pointing to them.

Both intentionally stick around for quite some time (several weeks by default).

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

<<< Previous 26 Messages Goto Initial 50 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.