Gitless: experimental version control system
people.csail.mit.edu
people.csail.mit.edu
GIT is marvelous if you understand the data-structures, people are too fixated on the commands and think everyone one of them is like magic, but all those commands just function on a handful of data structures. (though some of the commands are not always intuitively named)
Recommended reading: http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
git remote add/rename/remove
git add/mv/rm
git tag <name>/?/-d
git branch <name>/-m/-dOn the other hand, I suppose the git-plugin[1] for mercurial is good enough, that there's really no reason to use git for those that feel strongly about the UI?
Some of the concepts behind DVCS, such as the DAG, merging, resolving conflicts, even the staging area, are much easier to understand when you can actually visualise them. I've found that people who try to jump in at the deep end with the command line sometimes don't understand Git as well as they think they do.
These days I tend to use the command line a lot more, and I would strongly recommend people to do so once they've mastered the core concepts, but I still like to have a GUI to hand so I can see at a glance where things are at with my branches, staging area, etc.
In trying to be simple they often left me feeling powerless
Have you tried SourceTree? That's the one I tend to recommend these days. Alternatively, if you're prepared to splash out a bit, SmartGit is worth considering too.
- staging portions of many files scattered across a directory tree
- quickly glancing over diffs for a given commit
- understanding the commit graph and the relationship between local and remote branches
Each developer's experience may vary, but in general I feel like a good GUI tool can help a novice user develop and reinforce the mental model necessary to understand what git is doing. For example, what am I doing when I rebase my commit onto master vs merging it?Personally I'm in love with Magit which is a thin Emacs wrapper around git.
This should be an interactive tutorial with visualization. It is currently broken for me (Chrome-Linux). There is screenshot on Github:
I'm not claiming a GUI hampers learning Git but just to offer some experience of it not being necessary.
With that said, this is very cool - https://pcottle.github.io/learnGitBranching/
Or well, it was when it worked. This seems similar, in spirit, but not as good as learnGitBranch was... - https://onlywei.github.io/explain-git-with-d3/
While I have a feeling many would change Distributed Version Control System if there was immediately human translatable command knowledge between formats.
Begs a question of if many software libraries with their typed dictionaries could counter a built-in thesaurus for alternative tool chains, and end a war between literacy.
(What technical limits are aside from fighting for how to pattern match each element and differentiate what is integral to relate.. and committing that a base human localization.)
1. Git thinks around a commit, Gitless thinks around a file. Comparing two tools on a different basis might result in a flawed comparison. The reason that git uses for considering commits over single files is as far as I know, that you as a developer consider consistent states of your project. Before and after a change a project should be able to build, for instance. Often these changes can not happen in a single file and still be consistent. Therefore a project state is considered a unit, not a set of files that are changed on their own.
2. The staging area. Gitless thinks the staging area is a problem so it seems to be removed (might be a wrong interpretation by me). The staging area is quite important though. Sometimes I have made many changes, but I don't want all of them in one commit. In another scenario I did many changes that after squashing plus a few edits here and there might be better represented by a much smaller amount of commits. In both cases I need a space that is not the repository space of completed commits nor the workspace to represent a commit in its creation. The staging area might not be the best way to do it (I don't know a better one, though), but completely removing it without an alternative does not solve the problem.
having to commit changes manually (I haven't had to do this in Dropbox)
terrible history and branch navigation (chrome does a better job and that's not even like an important feature of a browser)
confusing command structure and options
history rewriting and the resulting issues
no merge tool (I feel like kaleidoscope is the minimum here)
submodules
Gitless seems to address #3 there but not the others. Actually making a tool that improves git to where it could be would probably be a huge undertaking, and most people do alright with git so maybe it's not worth it. Or maybe there's some graphical git client like tower that fixes all this stuff.
It would also be nice to have a visualization of the graph that could easily be 'seeked' through like a video.
Putting this on top of the existing git CLI code might not be feasible though.
I think it's very doable without any serious R&D, and you could build it on top of git/maybe github. The real question to me is: is it worth the effort, and would anyone actually pay for it.
People pay for tower and kaleidoscope so I assume it's possible. I think this is totally something GitHub should make but they seem to be focussing on other things.
Of course, getting this to work in real-time with your collaborators is probably the holy grail and has been implemented to some extent over the years in quite a few products.
BUT separate steps for this is good because it allows for better inspection and the ability to recover
Arguably, git already has that with stash; it just needs a simple way of stashing whole files. In bazaar, which doesn't have add-before-commit for existing files, I often do "bzr shelve <file>; bzr commit; bzr unshelve".
* commit changes manually - I find my self picking individual changes out of the current state of my source & committing them individually all the time, so this is just perfect.
* history & branch navigation. - Um. Not sure what the problem is here. I can checkout anything I like, hop around the history at will, tag any version with meaningful names etc. Am I missing something?
* confusing command structure. - Yeah, have to give you this one. It is (slowly) getting more consistent over time at least.
* history rewriting - this means I can hack & commit away then rewrite my changes into a logically consistent series of changesets that make sense individually before pushing to the main repo. I rewrite history all the time before pushing.
* no merge tool - but is happy to use whatever merge tool you plug into it, which works pretty well in my experience. (See the git-mergetool manpage.)
* submodules - Yeah, these are mostly awful.
I think git (or mercurial for that matter) is great for people who see having a clean, well documented change history where every commit makes sense in and of itself as a worthwhile thing to have. If you're the kind of developer who just uses a VCS as a sort of 'source code backup' and your revision history consists mostly of a long series of "Update" comments then all the extra power that git has is just extra complexity that you don't need.
I'm proposing that you can get all the benefits you talk about but in a far more usable manner. I like a clean master branch with atomic sensible commit messages as much as the next man. Git just makes it a real chore to get there.
You seemed confused about the history and branch navigation, so maybe I can explain that one better.
What I want is to visually view the history of a file, and trace, for instance, a function as it moves through my project, into different files, etc. I also want to easily find code that I deleted in the past to use as a reference for implementing a new version of the code, rather than keeping it in some "obsolete" folder in source control. I have seen people who do that. There are ways to do these things now involving searching git logs and viewing diffs or checking out old branches, but the interface is very poor. Even the interface on Time Machine is better than git, and that thing isn't build to source code.
But perhaps you are correct. Maybe most people use git primarily as a backup service for code. If so I guess git should make that a way better process. I will point out that github actually offers a way better interface to git than git does. It just still has a long way it can go.
Wouldn't it be better to provide small classes to people where understanding can be gained, rather than abstract how to use Git with a different client?
gl init
And getting a local copy of a remote repo in gitless is: gl init <url>
Whereas in git, it's: git init
and: git clone
Similarly, the operations to switch to (and create) a new branch, switch to an existing branch, and list branches, in git, is: git checkout -b newbranch
git checkout oldbranch
git branch
In gitless, its: gl branch newbranch
gl branch oldbranch
gl branch
Similarly, git has a somewhat complex situation where files can be staged, changed, tracked, and/or ignored; confusingly files can be odd mixtures of all four, and it can be quite hard to understand how to change the state of a file in some cases.Gitless simplifies this a bit by removing the "stage", so files are either tracked, untracked, or ignored, with no ability to mix states. And instead of selectively staging changed files and then committing them in two separate steps (as you do in git), you stage and commit in one go.
Gitless is built on git; someone familiar with git can easily tranlate the gitless commands into the underlying git commands. It's not doing anything magic, but for day-to-day use the commands are probably a little more consistent and sensible.
Personally, my biggest pain point with git comes from managing complex branching situations; trying to figure when/how to merge, rebase, and cherry pick can be frustrating. Sadly, gitless doesn't (yet) help with this area.
(Short form: Gitless tries to make git's syntax simpler and more consistent.)
(And you can still drop back to git if you do need that functionality. As the docs note, gitless and git are entirely compatible.)
The one thing that concerns me is the inclusion of rebase. If a wrapper is supposed to change difficult underlying concepts in git, why keep the most difficult concept: rebase. I like rebase, but for many common workflows you really don't want to use it.
My understanding of your concern of rebase is that if they are gonna change that (or get rid of that), it will be a change of the workflow instead of just a simplification of it.
I used to rely on merge other than rebase when my local tree is diverted. That usually ended up with two commits (one for my local changes, one for the merge). But later I learned to use rebase. It would only result in one commit, which I feel is kinda nice coz you have a cleaner and more correct(time-wise) commit history. I don't know if this is the fundamental purpose of rebase. Advice welcome.
Rebase works extremely well for what is was designed for: You have a lot of people working completely independently and you want to submit your changes to a central maintainer. You rebase your branch so that the changes appear to be applied directly onto their branch. It makes it much, much easier to review. If the change is accepted then it is merged and everybody uses the merged version. If not, the branch is destroyed (of course you still have your changes in your repository). As long as nobody makes any changes to (or branches off of) a branch that will be rebased, then there will be no problem.
Because the vast majority of people use git as kind of a "better SVN", with a centralized repository and published branches (using Github or the like), most people should never, ever use rebase. Especially if you are trying to design a simple workflow for neophytes, then you should almost certainly not make rebase easy to reach.
Like I said, I like rebase, but it is not something that fits well in a collaborative office environment. It works much better in a hugely distributed open source project, or a personal project (if you are being very careful).