Earlier quoted context omitted.
> But one should not need to know graph theory to source control files. You have two pills. Or you know few basic DAG concepts, or you need to know a lot of "semantic" VCS commands.
Usually, VCS commands makes some sense (i.e. commit commits), which isn't always the case with Git. THere are only two version control systems where I ever needed to use commands, rather than being able to do what I need in GUI -- SVN (because it is crap and would corrupt repository all the time, and then you needed to fix it up by hand) and Git, because... well, because Git.
Gitless: A simple version control system built on top of Git
131–140 of 143 posts
Re: Gitless: A simple version control system built on top of Git
#132Earlier quoted context omitted.
I have a different workflow in TortoiseHg than ufo. In your terminology, I only consider revisions that have been pushed as being baked, while unpushed revisions are the clay. We already have tools to manipulate revisions, while the index, stash/shelve and patches are all just reimplementations of revisions with less convenient UIs. I just go ahead and commit whenever I like (without having to stage!), and sort it ou…
> Mercurial has a few properties that make this easier than in git. For example, there is no concept of detached head / garbage collection; when you save a commit, it is simply saved forever unless you choose to forcably remove it. (I have never found myself wishing for Git's refs and heads; they are just straight up unnecessary.) But I could imagine a git wrapper that had these properties too (e.g. when I checkout a…
When you switch branch in Mercurial, in principle it simply looks through all commits to determine the latest one with that branch name. In practice I'm sure there is a cache of this, which is the closest there is to git refs, but that is totally transparent. All commits must have a branch name, and the first commit’s branch name is usually "default" (equivalent to git's "master"). That close branch feature you mentioned is a special type of commit that stops that branch from being included in the list of branches, but the branch still exists because all previous commits to it still do.
This has a few consequences compared to Git's branches, which may be good or bad depending on the situation and your personal opinion. One is that a commit cannot be a member of more than one branch. Another is that branches are far less mutable than they are in Git; to change the branch that a commit is in you must actually destroy and re-create that commit (e.g. with rebase).
Another consequence is that it is fine for a branch to have multiple heads; just go back to a slightly older revision and commit again. Or, more commonly, pull after making your own commits and find someone else has committed to the same branch. (If you prefer: find that someone else has made some commits with the same "branch name" metadata.) Usually this situation is only transient because you would merge or rebase. Indeed, you cannot create multiple heads for a branch on a remote repo unless you force push, so you'd normally merge/rebase before pushing.
Another bit of commit metadata is state: public, draft or secret. Commits are draft when you create them, essentially meaning "not pushed". Public commits are ones that have been pushed to or pulled from a remote repo. In git, to see what things look like on the remote, you’d use the remote ref; in Mercurial, you’d look at the public commits. Admittedly you lose the ability to understand which remote repo a commit was seen on, whereas git supports multiple remotes. (During a push, Mercurial will still check whether “public” commits are on a remote repo and push them if necessary.) You can mark a commit as “secret” and then it will not be pushed unless you change its state back. This is what I use when I commit something for my own reference later on, which I was talking about in my previous comment. Often when I rebase, I leave the original commits behind and mark them as secret in case something goes wrong.
I can see you think branches are "something special" in Mercurial. Maybe in Git you could use refs to implement something totally different to branches, whereas in Mercurial you're stuck with that exact implementation. But refs seem like an unnecessary implementation detail to me. I never want to implement something similar but not quite the same as branches; I just want branches to work! And by not having any refs whatsoever the system seems quite a bit simpler.
Re: Gitless: A simple version control system built on top of Git
#133Earlier quoted context omitted.
Naming is difficult. Good names suggest the right metaphore to understand something. But for git, there is nothing similar in physical world. "push" "pull" and "merge" seem ok, but even "branch" is an original concept different of its usual meaning. Maybe git should have used non english words to avoid confusion.
Branch seems to fit the dictionary definition: "something that extends from or enters into a main body or source". And in fact, it didn't originate with git, it's at least as old as CVS.
"A branch in Git is simply a lightweight movable pointer to one of these commits."
https://git-scm.com/book/en/v1/Git-Branching-What-a-Branch-I...
Re: Gitless: A simple version control system built on top of Git
#134Earlier quoted context omitted.
I would hate to be restricted to a GUI tool to achieve what git add can do from the command line. Using stashes would be just reimplementing the index using less convenient UI. I really don't understand what's so difficult about the index... It's just the stuff you will be inserting into the repository when you next commit. Having it separated enables a very convenient workflow that would've required manually using p…
> I would hate to be restricted to a GUI tool to achieve what git add can do from the command line. I don't quite understand the use of the command line for git or hg. In my typical workflow before I commit I want to quickly review all the changes I just made. With the GUI you have a list of files and when a file is selected a diff of that file, without opening a new window. That means you can browse all the diffs in…
I use that everyday. Whatever you imagined we command line people use, it is just not accurate, IMO.
Re: Gitless: A simple version control system built on top of Git
#135Earlier quoted context omitted.
Usually, VCS commands makes some sense (i.e. commit commits), which isn't always the case with Git. THere are only two version control systems where I ever needed to use commands, rather than being able to do what I need in GUI -- SVN (because it is crap and would corrupt repository all the time, and then you needed to fix it up by hand) and Git, because... well, because Git.
I worked with cvs, perforce, clear case, svn and mercurial before git. And each system force me to learn new concepts and a new set of commands. There is no one universal set. There is no surprise your vcs skills are not transfered to git. And no, some inferior wrapper like subj doesn't help you. It's always better to learn tool.
Re: Gitless: A simple version control system built on top of Git
#136Earlier quoted context omitted.
I worked with cvs, perforce, clear case, svn and mercurial before git. And each system force me to learn new concepts and a new set of commands. There is no one universal set. There is no surprise your vcs skills are not transfered to git. And no, some inferior wrapper like subj doesn't help you. It's always better to learn tool.
But checkin had always did the same thing, be it in VSS or PVCS. Sure, there'd be varying capabilities, differences in tooling, but concepts were the same. Git wants to be different for the sake of being different (even if we assume for a moment that one should know anything about DAGs in order to use version control, which is pretty laughable by itself).
I bet you have no problem in remembering what git pull, git checkout, git add, git commit and git push do, isn't it? For everyday work it's enough. You have problem in mastering git, all these nifty logs, diffs, indexes, refs, heads, remotes and other stuff. Other VCS have complex concepts too besides checkins.
Re: Gitless: A simple version control system built on top of Git
#137Earlier quoted context omitted.
But checkin had always did the same thing, be it in VSS or PVCS. Sure, there'd be varying capabilities, differences in tooling, but concepts were the same. Git wants to be different for the sake of being different (even if we assume for a moment that one should know anything about DAGs in order to use version control, which is pretty laughable by itself).
> But checkin had always did the same thing I bet you have no problem in remembering what git pull, git checkout, git add, git commit and git push do, isn't it? For everyday work it's enough. You have problem in mastering git, all these nifty logs, diffs, indexes, refs, heads, remotes and other stuff. Other VCS have complex concepts too besides checkins.
Whatever technical advantages of Git are (and technically it is good), I think it fails as a tool to let me do my job easier.
Re: Gitless: A simple version control system built on top of Git
#138Earlier quoted context omitted.
I have a fairly advanced knowledge of git (that is, at the level of porcelain and plumbing commands; I haven't touched the C codebase itself) and I intend to give gitless a try when I get back to work on Monday. My reason is that, while I'm a fan of git the technology, I think the default git CLI is an unmitigated fucking nightmare and I begrudge every neuron of space that I have to waste remembering how it works. Un…
Can you please give an example of the things you mean? Edit: wording.
- Command line switches are inconsistent. For example, to list remotes you use -v but to list branches you use -l
- Speaking of command line switches, how about that bizarre need to separate paths in certain commands with "--" so that the parser doesn't get confused? I can never remember when that's necessary.
- There's weird overlap between the porcelain commands that make them harder to learn than they should be. For example, git checkout can do the work of git branch. git pull usually does the work of git fetch. Some common operations get their own commands, while others require you to use switches on other commands. It really shows that git evolved organically from a bunch of shell scripts used by one particular dev team until it katamari damacy'd into a big agglomeration of random parts.
- Poor defaults, such as git push --force not having the behavior of --force-with-lease, and also git push pushing all branches at once by default.
- A bunch of commands are ridiculously overloaded or encumbered by historical limitations that don't make sense anymore. See https://redfin.engineering/two-commits-that-wrecked-the-user...
- Many of git's mechanisms are overly complex and lead to a depressing number of bewildered users. E.g. witness the confusion and conflicting advice at https://stackoverflow.com/questions/6089294/why-do-i-need-to... Another example is git reset, which is invariably a nightmare to explain to an intern or new developer who hasn't used git yet. Trying to learn what git reset does from reading the man page is like trying to learn calculus by examining the digits of pi.
- Speaking of man pages, the man pages are comically bad. I find the git man page generator endlessly amusing: https://git-man-page-generator.lokaltog.net/
Re: Gitless: A simple version control system built on top of Git
#139Earlier quoted context omitted.
Can you please give an example of the things you mean? Edit: wording.
Sure, here are a few: - Command line switches are inconsistent. For example, to list remotes you use -v but to list branches you use -l - Speaking of command line switches, how about that bizarre need to separate paths in certain commands with "--" so that the parser doesn't get confused? I can never remember when that's necessary. - There's weird overlap between the porcelain commands that make them harder to learn…
Firstly, I agree that Git has a learning curve. However, trying to learn anything based on man pages alone is not a good idea, in my opinion man pages are for reference and not a substitute for more extensive documentation. Of course, sometimes man pages are the only document one has, but this is not so in the case of Git. I myself am not a Git expert, but after reading about what problems people have with Git, it feels like people should perhaps not go for the most exotic commands by default, and they should use a topic branch based workflow. And they should read the Pro Git book and I mean this in a good way :)
As for the switches, one can just as well use "git branch -v" to list branches, I usually pipe to grep if looking for a branch. For the "git remote", it actually does show you the remotes without any switches, but the URL of the remote is not the remote... To see the URLs you'll need the verbose switch. Maybe this is right, maybe not, I do think it makes sense.
The two dashes is actually not a Git peculiarity. It comes from getopt and POSIX.2 to signal the end of options. Compare with e.g. to rm a file that's called "-rf", you'll have to do "rm -- -rf" in the shell.
As for the intern, just tell them "Git reset moves backwards in commit history". Of course there are details (and you can get back to the future with e.g. git reflog), but it should be accurate enough description to an intern who is new to Git, since that's what "git reset" is mostly used for anyway. IMO "git reset -p" and such are somewhat advanced usage.
The problem with the Stack Overflow link is that Git is not tracking that upstream branch, just because the local and remote branches happen to have the same name after a push does not mean they are the same and should be tracked. I'd argue that if one works with topic branches, that kind of situation is kind of remedied automagically through the workflow... Anyway, Tzen's answer there is the correct one (when including the typofixes in the comments).
Also, thanks for the link to the Git man page generator, it's great!
Re: Gitless: A simple version control system built on top of Git
#140A simple text editor built on top of Emacs.