161 points · by ingve · 10y ago · 119 comments
P.S. if your granularity is in the level if files and not individual hunks of the overall patch then you can just "cvs/git commit files..." easily but still, it'll go in untested and you may have forgotten a change that was required in order to make the commited patch valid and coherent.
For that reason i agree strongly. Any attempt to improve git that does not move the staging area more to being the default way of operating is misguided at the code.
This is a lot more than you get with just a single interactive commit operation.
You could use a commit for this purpose, and continually amend or revert this commit, but in terms of UI, it's helpful to have a set of operations specifically for moving things in and out of the staging area that's different than what you do for manipulating commits on general.
Or you can use an easy-to-use but powerful UI like TortoiseHG, where it's trivial to check files or hunks for commit, stash (shelve), amend, revert, rebase, ...
TortoiseHG with hggit is the best git client.
And that's before even mentioning the best parts like phases and obsolescence markers.
Why would you want to add things piece by piece and not commit them? If they are done enough to be added they are done enough to be committed and if they are not you keep working on them together with all other unfinished files. Once you actually are ready to commit you can choose which files that are in fact ready.
I haven't read the paper, but the last paragraph in the article makes me a little sad. Then again, there were hardly any progress that wasn't met with significant resistance initially. (EDIT: typos)
- changes on hdd
- changes in staging area
- changes in commit
- changes in commit that came before a recent commit
- changes in pushed commit
I'm not entirely sure about the following, and i think it merits more thought, but here's my current state of mind about it:Technically you could do the same as the staging area by forcing the user to create a new, empty, but named commit when they decide they're done with the last one, and have all the current staging-affecting commands affect the last commit instead.
However, for one, i think it may be easier to mess up and lose data unexpectedly when workign that way, and for the other, putting down a name for a commit when you're not even sure what it's gonna be may be an awkward way of working. Lastly, you'd also need to implement "empty" commits. I'm not sure how useful/easy that would be with git.
gl commit -o file1 file2 file3 file4
[1] http://gitless.com echo file1 > staging # e.g. git add file1
echo dir2/file2 >> staging # e.g. git add dir2/file2
echo dir3/file1 >> staging
echo dir3/file5 >> staging
echo dir4/dir9/dir394/file384 >> staging
And committing the file: eval "$(echo gl commit -o `cat staging`)" # e.g. git commitAlso, if you end up committing only parts of files, then how do you know that what you commit works?
But looking at it, this seems like it would strongly couple the decision to include a part of a file with the commit process rather than something that I can be thinking about as I write the change. I think I'd likely find that irritating.
"The problem with commit is that it constitutes a violation of the coherence criterion: the same concept (commit) has more than one, unrelated, purpose: make a set of changes persistent (P1) and group logically related changes (P2).
"These two purposes are not only unrelated, but in tension with each other. On the one hand, you would like to save your changes as often as possible, so that if something bad happens you lose as little data as possible (thus encouraging early committing). On the other hand, a logically related group of changes usually involves multiple individual changes, which means that you might be working for quite some time before you have enough changes to group (thus encouraging late committing).
Now a fix for that would be useful. Git only provides you with the ability to create a graph, and you get to choose what you use it for. You have to choose though because there is only one graph. Gitless doesn't seem to fix this problem, you still have to choose what goes into your final commits. Though I don't know what you could do about it without changing git to support something like grouping commits into blocks that are modified as a unit.
Git branching is lightweight so I don't see how it can't be used to support P1 and P2.
I have no idea how easy this is, but I've seen plenty about how horribly impolite it is when you rearrange any history that other people have seen.
And yes, don't change history others have seen, but do it as much as you need locally.
EDIT: typo/clarity
which is ok for maintenance bug fixes, but precludes a lot of interesting workflows involving speculative work, late binding the order of commits, early integration branches, etc.
my workaround for this usually just involves doing what i want up front, and then abandoning git for the merge process (since my history is polluted by false conflicts), constructing diffs and applying them as single commits against master.
which works, its just a bit silly
`git checkout branch` with unstaged changes could interactively prompt you to stash, commit, discard, or keep the changes.
tar xzvf gl-v0.8.3-darwin-x86_64.tar.gz
sudo cp gl-v0.8.3-darwin-x86_64/gl /usr/local/bin/
Now you can play with the commands on any git repository: $ cd ~/projects/farmhouse
$ gl diff
# Woah cool! It uses whitespace to separate blocks!
$ gl branch
# Wow, this not only shows you the branches, but explains
# all the other branching commands, like how to switch
# branches! Now I know that I can just:
$ gl switch master
# done!
And because it's just an alternative wrapper for git, you can switch back and forth, at any time, on any repo.Their "veneer" of git is here: http://gitless.com/
Really? Do people think that?
Most of the problem they had came from stashing: "I want to pull but git doesn't want to !"
Or changes following you when switching branches: "I worked in developed, now I'm back to master and I have all this files modified!" Which could lead to a "reset --hard" for getting rid of those changes, which was generally regretted after that!
Also I had a few detached head states due to simple double-click on a commit name in the UI that resulted in a checkout, when they just wanted to see the commit log.
Finally a lot of confusion arised from using SourceTree that shows you a window with ten options every time you try to pull. (SourceTree wasn't my choice)
So I think gitless does provide an improvement by getting rid of the stash, but I don't really see the point of removing the staging area.
Hub is a prominent GitHub remote porcelain tool.
I also want to point out shell prompt tools to display the current git status, which would have helped in many of those misfits.
Since magit was mentioned, I'll add 'fugitive', the Git wrapper for Vim described to be 'so awesome, it should be illegal.'
It's always dubious for those with new offerings to dismiss criticism as 'resistance' and 'defensiveness'. This is extremely disingenious and intentionally takes things from the technical to the political.
They have taken up a marginal use case which matters to them which is fair but then try to dress it up as a git weakness with an elaborate paper which plays up their use case and scatters around strawmen like 'Git is difficult to use' unquestioned. Isn't it possible that the 'shortcomings' are not an issue to other users who may not identify with the use case highlighted and may not perceive it as an 'improvement'.
I think git stands alone in stark defiance to a growing culture of complexity. Given the scope Git could have been an extremely complex and bulky piece of software.
Its a testament to the experience of the authors that it is accesible to most and used by millions.
I have no doubt in lesser hands Git would be hugely more intricate and a complete pain to use.
It can be tailored to be more user friendly sure. But the original philosophy of git was to build distributed version control system that is efficient, straightforward, and dependable.
All of those goals are achieved with its design and improving on this foundation is certainly possible. These were all hard problems to solve at the time, given the state of the art was CVS, subversion and perforce.
The state of the art was not CVS, Subversion, and Perforce when git had its first release in 2005. The state of the art was BitKeeper (which you might remember had a certain connection to Linus and git), Arch, Monotone, and Darcs, and Mercurial itself was first released almost simultaneously with git. And one can debate the extent to which git was an improvement on any of those on key features like cryptographic signing or UI/UX.
Nonsense. Version control software has existed and been in widespread use since at least the 1980's.
https://en.wikipedia.org/wiki/Revision_Control_System
Walter Tichy released RCS in 1982. CVS is derived from RCS, Subversion from CVS.
Subversion is not derived from CVS; it was a project inspired by problems in CVS, to replace it.
Subversion's History
In early 2000, CollabNet, Inc. (http://www.collab.net) began seeking developers to write a replacement for CVS. CollabNet offered[3] a collaboration software suite called CollabNet Enterprise Edition (CEE), of which one component was version control. Although CEE used CVS as its initial version control system, CVS's limitations were obvious from the beginning, and CollabNet knew it would eventually have to find something better. Unfortunately, CVS had become the de facto standard in the open source world largely because there wasn't anything better, at least not under a free license. So CollabNet determined to write a new version control system from scratch, retaining the basic ideas of CVS, but without the bugs and misfeatures.
Note "retaining the basic ideas of CVS, but without the bugs and misfeatures."
derive
base a concept on a logical extension or modification of (another concept).
https://en.wikipedia.org/wiki/Source_Code_Control_System
Version control is not a new concept and was in widespread use in the 1980's.
:-)
Or why is Git popular, then? Could Github be built on, say, SVN? Many times in IT, popularity is also driven by support of a large corporation, but it was non-existent in this case.
Regardless of the reason for its success, git has a huge installed base and plenty of online help to find one's way out of a corner. Having git skills is also a big plus for employability. I have migrated teams onto git rather than Mercurial solely for these reasons. UX was a secondary consideration.
Also it fundamentally can't handle binary files well. This causes great pain.
https://stevebennett.me/2012/02/24/10-things-i-hate-about-gi...
Taken to the extreme your statement is essentially: "Git works for me and me only therefore it is flawless."