Earlier quoted context omitted.
> I wince every time I have to revert a file, as "git checkout" is friendly but "git checkout " is destructive without warning. From my point of view, that's like saying that 'rm -rf' is destructive 'without warning.' It does what it was meant to do, you can't expect everything to warn you all the time in an effort to save you from yourself. It would get really annoying, really fast if it asked you to confirm every t…
'svn checkout ' isn't a valid svn operation; checkout applies to directory urls. Actually, beyond svn revert, I struggle to think of an easy way for you to lose your local modifications. If you really just wanted the latest version of , I guess you might use svn cat, but you'd have to redirect it to overwrite the other file yourself. For svn update, it won't overwrite local modifications. svn revert seems to be bette…
Still hatin' on git: now with added Actual Reasons
51–60 of 169 posts
Re: Still hatin' on git: now with added Actual Reasons
#52I sort of take issue with this statement: “git is bad for me because it makes assumptions about how I work that don’t match how I actually work” I think that it's the other way around. git was built with a specific type of workflow in mind. If you take git and try to insert it into your current workflow with a minimal understand of git (or its intended workflow), then isn't it really you that are making assumptions a…
When I need three-way merging, which isn't often - usually patch can resync simple things like line offsets - it's handled by a file comparison tool. I have a simple script which handles this.
I work remotely (across the Atlantic) on a large svn repository, so I tend to not to update every day, nor commit every day. Instead, I version local changes with diffs.
Re: Still hatin' on git: now with added Actual Reasons
#53I sort of take issue with this statement: “git is bad for me because it makes assumptions about how I work that don’t match how I actually work” I think that it's the other way around. git was built with a specific type of workflow in mind. If you take git and try to insert it into your current workflow with a minimal understand of git (or its intended workflow), then isn't it really you that are making assumptions a…
"svn update" will randomly delete your work with no way to ever get it back. I don't think new git users migrating from svn actually understand that they can rollback any changes git makes. If a pull goes bad and you don't want to deal with it, just reset to your last head. All is forgotten until you feel like fixing it. And no data is ever lost. (svn loses data by merging everything it can with your uncommitted chan…
svn update with local changes gives me this dialog:
Conflict discovered in 'test.pas'.
Select: (p) postpone, (df) diff-full, (e) edit,
(mc) mine-conflict, (tc) theirs-conflict,
(s) show all options:
However, I would normally just abort at this point, and make sure my local changes are packed up into a diff like they should be.Re: Still hatin' on git: now with added Actual Reasons
#54Earlier quoted context omitted.
'svn checkout ' isn't a valid svn operation; checkout applies to directory urls. Actually, beyond svn revert, I struggle to think of an easy way for you to lose your local modifications. If you really just wanted the latest version of , I guess you might use svn cat, but you'd have to redirect it to overwrite the other file yourself. For svn update, it won't overwrite local modifications. svn revert seems to be bette…
Sorry, it's been a while. But yea. 'git checkout ' is basically doing what 'svn revert ' is doing. So, I fail to see how one is necessarily 'more dangerous' than the other.
Re: Still hatin' on git: now with added Actual Reasons
#55I have read a fair amount of documentation on git. I still don't even know what most git commands do. When people recommend a rebase, I pretty much just pretend that my repository isn't going to die. I wince every time I have to revert a file, as "git checkout" is friendly but "git checkout " is destructive without warning. I once destroyed a number of local files (I don't remember how) that were thankfully still ope…
> I wince every time I have to revert a file, as "git checkout" is friendly but "git checkout " is destructive without warning. From my point of view, that's like saying that 'rm -rf' is destructive 'without warning.' It does what it was meant to do, you can't expect everything to warn you all the time in an effort to save you from yourself. It would get really annoying, really fast if it asked you to confirm every t…
Re: Still hatin' on git: now with added Actual Reasons
#56Earlier quoted context omitted.
Looks to me like he had two problems. The first was that git gave very poor error messages and needed a confusing series of command-line options. In mercurial, this is much better; the pull creates a new head, and tells you what to do if you want to merge them. Commit is one-step, instead of via the staging area. It just gives more feedback, more usefully, and requires less knowledge about the underlying representati…
There's two problems with this approach: 1. If you have other uncomitted changes, you're simply hosed. You can't continue with the merge process with local changes at all. 2. It pollutes your change list with unrelated, unconflicted changes belonging to your teammate (the whole changeset).
That's what 'git stash' is for. It stores away all changes to the local tree and index (but leaves ignore and untracked files alone). Then you can perform operations like changing branches, doing merges, etc. Then you run 'git stash pop' or 'git stash apply' to pull back your changes. (You'll need the '--index' option if you want you index back in the same state though. It won't 'trash' your changes. They will only be in the working tree, not in the index.)
> 2. It pollutes your change list with unrelated, unconflicted changes belonging to your teammate (the whole changeset).
Yes. The automatic algorithms have failed to determine how to cleanly merge the changes, so you have to rebuild the final state that you want the tree to be in. When you commit that state, it commits the diff of what is needed to resolve the conflict.
Remote:
A-B-C
Local: A-B-D
Final: A-B--D--E
\_C_/
You are basically building the state that you want the source tree to look like in commit 'E'. Then the diff of what needs to be done to resolve the merge of states 'D' and 'C' is recorded in the merge commit 'E'.It's not 'polluting your change list' with those changes. It's setting your index into what the final state will look like and pointing out to you what the files that it couldn't figure out. You just need to make them look like they are supposed to (i.e. resolve the conflicts), put them into the index (i.e. 'git add') and push out the merge commit (i.e. 'git commit').
Re: Still hatin' on git: now with added Actual Reasons
#57I sort of take issue with this statement: “git is bad for me because it makes assumptions about how I work that don’t match how I actually work” I think that it's the other way around. git was built with a specific type of workflow in mind. If you take git and try to insert it into your current workflow with a minimal understand of git (or its intended workflow), then isn't it really you that are making assumptions a…
I'll tell you what happens when I use svn and there's been an upstream change: I never update my local tree with local modifications. Instead, I extract all my local changes into a diff, then I update my local tree, and then I merge my diff back into the updated tree and commit. When I need three-way merging, which isn't often - usually patch can resync simple things like line offsets - it's handled by a file compari…
{edit}
Just to add that:
> I'll tell you what happens when I use svn and there's been an upstream change: I never update my local tree with local modifications. Instead, I extract all my local changes into a diff, then I update my local tree, and then I merge my diff back into the updated tree and commit.
git has this built-in with 'git stash' which cleans up the index and working directory (leaving ignored or untracked files alone) and stashes the changes in a 'stacked' list. You can then use operations like 'git stash pop' or 'git stash list' to operate on that list.
Re: Still hatin' on git: now with added Actual Reasons
#58Earlier quoted context omitted.
No, “! [rejected] master -> master (non-fast forward)” is not intuitive. The example you give is one of the pleasantly surprising examples of a good error message from git. But, by and large, git's error messages are pretty awful.
What else should a one-line summary of syncing master -> master say? "Hello dear user. The remote server refuses to accept your branch, because it would delete information. As a result, your request has been rejected. Please rebase and try again. If you need help, hang up, and then dial your operator." Personally, I am fine with [rejected]. I figured it out, after all...
abort: push creates new remote heads on branch 'default'!
(you should pull and merge or use push -f to force)
Yes, it's two lines. I think we all have large enough monitors now that an extra line of output to be a bit friendlier is a good thing.Re: Still hatin' on git: now with added Actual Reasons
#59If you'll indulge me, I'd like to propose a thought experiment.
* * Designing a patch database * *
Consider you're responsible for administering a busy open source project. You get dozens of patches a day from developers and you find it increasingly difficult to keep track of them. How might you go about managing this influx of patch files?
The first thing you might consider is how do you know what each patch is supposed to do? How do you know who to contact about the patch? Or when the patch was sent to you?
The solution to this is not too tricky; you just add some metadata to the patch detailing the author, the date, a description of the patch and so forth.
The next problem you face is that some patches rely on other patches. For instance, Bob might publicly post a patch for a great new scheduler, but then Carol might post a patch correcting some bugs in Bob's code. Carol's patch cannot be applied without first applying Bob's patch.
So you allow each patch to have parents. The parent of Carol's patch would be Bob's patch.
You've solved two major problems, but now you face one final one. If you want to talk to other people about these patches, you need a common naming scheme. It's going to be problematic if you label a patch as ABC on your system, but a colleague labels a patch as XYZ. So you either need a central naming database, or some algorithm that can guarantee everyone gives the same label to the same patch.
Fortunately, we have such algorithms; they're called one-way hashes. You take the contents of the patch, its metadata and parents, serialize all of that and SHA1 the result.
Three perfectly logical solutions, and ones you may even have come up with yourself under similar circumstances.
* * Merging patches * *
Under this system, how would a merge be performed? Let's say you have two patches, A and B, and you want to combine them somehow. One way is to just apply each in turn to your source, fix any differences that can't be automatically resolved (conflicts), and then produce a new patch C from the combined diff.
That works, but now you have to store A, B and C in your patch database, and you don't retain any history. But wait! Your patches can have parents, so what if you created a 'merge' patch, M, with parents A and B?
A B
\ /
M
This is externally equivalent to what you did to produce C: patches A and B are applied to the source code, and then you apply M to resolve the differences. M will contain both the differences that can be resolved automatically, and any conflicts we have to resolve manually.Having solved your problem, you write the code to your patch database and present the resulting program to your colleague.
* * A user tries to merge * *
"How do I merge?" he asks.
"I've written a tool to help you do that," you say, "Just specify the two patches you want to combine, and the tool will merge them together."
"Um, it says I have a merge conflict."
"Well, fix the problem, then tell the system to add your file to the 'merge patch' it's making."
Your colleague dutifully hacks away, and solves the conflict. "So I've fixed the file," he says, "But when I tell it to 'commit file' it fails."
"Remember, this is a patch database," you reply, "We're not dealing with files, we're dealing with patches. You have to add your file changes to your patch, and then commit the patch. You can't commit an individual file."
"What? That's not very intuitive," he grumbles, "Hey! I've added the file to the patch, but it tells me the merge isn't complete!"
"You need to add all of the files that have differences that were automatically resolved as well."
"Why?!"
"Because," you explain patiently, "You might not like the way those files have been changed. It needs your approval that the way it's resolved the differences is correct."
"Why to I have to re-commit everything my buddy has made?" he complains, "Seriously, I want to just commit one file. What the hell is up with your system?"
Re: Still hatin' on git: now with added Actual Reasons
#60Earlier quoted context omitted.
What else should a one-line summary of syncing master -> master say? "Hello dear user. The remote server refuses to accept your branch, because it would delete information. As a result, your request has been rejected. Please rebase and try again. If you need help, hang up, and then dial your operator." Personally, I am fine with [rejected]. I figured it out, after all...
Mercurial says this in the same situation: abort: push creates new remote heads on branch 'default'! (you should pull and merge or use push -f to force) Yes, it's two lines. I think we all have large enough monitors now that an extra line of output to be a bit friendlier is a good thing.
No. You just look up the error in the manual, and never think about it again.