News for hackers. Stuff that matters.
Re:Ask HN: What's the worst piece of software you use everyday? by jamil7 on Saturday July 11, 2020 @04:38PM (#23805711)
Don’t agree with you about git at all, I find it’s one of the few tools I work with that behaves expectedly and gets out of my way, if you want that workflow of stash, pull and reapply a stash why not make an alias for it?
Re:Ask HN: What's the worst piece of software you use everyday? by modeless on Saturday July 11, 2020 @04:58PM (#23805897)

    git config pull.rebase true
    git config rebase.autoStash true
I think these should have been the defaults but they weren't implemented until later and it's hard to change defaults.
Re:Ask HN: What's the worst piece of software you use everyday? by hiyer on Saturday July 11, 2020 @07:15PM (#23807043)
Setting rebase to true by default is not a good idea if you push your code to your dev branch regularly (rather than just committing).
Re:Ask HN: What's the worst piece of software you use everyday? by teraflop on Saturday July 11, 2020 @07:50PM (#23807261)
I think that's a bit of an exaggeration; "pull.rebase=true" should be fine as long as you don't have local merge commits that need to be rebased on top of someone else's changes. With ordinary commits, it shouldn't really matter how frequently you (or others) push.
Re:Ask HN: What's the worst piece of software you use everyday? by Izkata on Sunday July 12, 2020 @03:06PM (#23813842)
"git rebase" has --preserve-merges (apparently renamed to --rebase-merges a few years ago) to recreate those local merge commits, maybe it can be set somehow for this as well?
Re:Ask HN: What's the worst piece of software you use everyday? by jgmarcel on Friday July 17, 2020 @12:11PM (#23872062)
Exactly. That’s the default I use. You can set it via:

    git config --global pull.rebase merges
Re:Ask HN: What's the worst piece of software you use everyday? by lordgrenville on Saturday July 11, 2020 @06:13PM (#23806591)
Great to know about these. I still think the current default is better: for a new user, it might be scary for your uncommitted changes to "vanish" into a stash.
Re:Ask HN: What's the worst piece of software you use everyday? by modeless on Saturday July 11, 2020 @06:16PM (#23806611)
The stash is popped before the command finishes, so your changes don't appear to vanish. Unless there's a conflict while rebasing a prior commit. Actually I'm not sure if aborting the rebase at that point would pop the autostash, but it should.
Re:Ask HN: What's the worst piece of software you use everyday? by lordgrenville on Saturday July 11, 2020 @06:32PM (#23806716)
Got it. In that case I agree.
Re:Ask HN: What's the worst piece of software you use everyday? by zyberzero on Saturday July 11, 2020 @05:51PM (#23806395)
TIL. Thank you for this!
Re:Ask HN: What's the worst piece of software you use everyday? by recursive on Saturday July 11, 2020 @05:15PM (#23806069)
The functionality of git is great. Mostly. (I think the whold concept of stage/index/cache is completely unnecessary though) I find the UI to be inconsistent and confusing. Why would I ever want to make a branch without checking it out? It's literally never happened, yet it's the default.
Re:Ask HN: What's the worst piece of software you use everyday? by bacon_waffle on Saturday July 11, 2020 @05:50PM (#23806388)
> Why would I ever want to make a branch without checking it out? It's literally never happened, yet it's the default.

  git checkout -b new-branch
I fairly often make a branch as a sort of named undo point, and only check it out if need to undo to that point. Tags could work for that purpose too, but the branch approach seems safer in my usual work situation.
Re:Ask HN: What's the worst piece of software you use everyday? by dreamcompiler on Saturday July 11, 2020 @10:23PM (#23808192)
> I fairly often make a branch as a sort of named undo point

Could you say more about this? I use

  git checkout -b new-branch
all the time, but that checks it out. What does "using an un-checked-out branch as an undo point" mean? Don't you have to check it out to commit changes to it? I suppose I could read the docs but the git docs are awful.
Re:Ask HN: What's the worst piece of software you use everyday? by hellofunk on Saturday July 11, 2020 @11:09PM (#23808470)
It creates the branch immediately for your last commit on your current branch. Therefore you have just named an undo point you could use later.
Re:Ask HN: What's the worst piece of software you use everyday? by bacon_waffle on Saturday July 11, 2020 @11:52PM (#23808654)
Occasionally I find it handy to tentatively do a rebase or similar, where I'm confident that the rebase itself will succeed but not so confident that the result will be something that I want to keep. In that case, making a branch at the current commit (using "git branch new-undo-point") will leave an easy way to return to the current state as if the rebase never happened.

Recently, in explaining this to a colleague who's relatively new to git, I think the "aha" moment came in realising that if you rewrite the history leading to commit X, you're really making new commit Y in addition to the old commit X - you're not changing X in to Y. Leaving a branch pointing at X is enough that git will keep it around after the history rewriting, in case you decide to do something with it later.

Re:Ask HN: What's the worst piece of software you use everyday? by dreamcompiler on Sunday July 12, 2020 @01:52AM (#23809191)
Ah. I get it. You're talking about using a new branch name as a tag for an existing commit. Thanks.
Re:Ask HN: What's the worst piece of software you use everyday? by mtm7 on Saturday July 11, 2020 @06:19PM (#23806631)
Wow, I’d never thought of using it like this. Thanks for sharing, I just added something new to my workflow!
Re:Ask HN: What's the worst piece of software you use everyday? by kubanczyk on Saturday July 11, 2020 @07:11PM (#23807006)
It's actually an answer to a standard interview question. I've met it more than once.

Funny thing, nowadays it's going to be deprecated in favor of:

    git switch -c newbranch
Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Saturday July 11, 2020 @08:14PM (#23807410)
Which is similarly terrible; it should be a flag on the `branch` command, not `switch`.

I actually popped on the git development irc channel a few months ago to make this suggestion. The two people I talked to (at least one of whom seemed to be a core developer, although I did not verify this) did not see how, if you're going to conflate the actions of creating a branch and checking it out, it makes more sense to do this as a flag on the primary action, branch creation.

They were nice enough to have an in-depth conversion with a complete newcomer, though, so it was not a negative experience overall. Maybe someone else could convince them :)

Re:Ask HN: What's the worst piece of software you use everyday? by bacon_waffle on Sunday July 12, 2020 @12:07AM (#23808722)
Maybe this depends on your mental model of what a git checkout is? To me, "git checkout X" means: update the working directory to reflect X and update HEAD to point at X. (edit: and HEAD means "the branch to update when a new commit is made"). I use "git checkout" a lot more often than "git branch" and "git checkout -b" combined. So, to me, the fact that X is a to-be-created branch is secondary to the primary "checkout" operation.

That said, I do vaguely recall this seeming weird at first.

Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Monday July 13, 2020 @11:08AM (#23821530)
I'm going to discuss mental models in a separate comment because they're actually more interesting and this comment is getting too long.

---Succinct argument---

What happens if you remove the flag? Put differently, how much does the flag change the semantics?

`git branch newbranch` will gracefully fall back to creating a new branch at HEAD.

`git checkout newbranch` will fail (error: pathspec 'newbranch' did not match any file(s) known to git), because the regular version of the command involves operating on something that already exists.

---Less succinct further argument---

checkout's `-B` variant. Here's how the man page explains it:

> If -B is given, <new_branch> is created if it doesn’t exist; otherwise, it is reset. This is the transactional equivalent of > > $ git branch -f <branch> [<start point>] > $ git checkout <branch>

If it were a flag on branch, you wouldn't need a separate flag, just `git branch -fs newbranch` (-s for --switch).

Actually, looking through the man page for `checkout` now, I see 4 other options I didn't know about (-t|--track, --no-track, --guess, --no-guess), apparently for the sole purpose of being used with -b.

---

I don't think I thought of this argument when I originally chatted in #git-devel, maybe I'll give it another try.

Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Monday July 13, 2020 @12:38PM (#23822687)
> HEAD means "the branch to update when a new commit is made

Thank you for the edit; this is where our mental models diverge. Yours is the technically correct version, but when I'm working, I introduce a small abstraction on top. I've never written this particular part out explicitly, so please bear with me and feel free to suggest better names or phrasing.

I'll call it, "the checked-out branch" (or other <tree-ish>, but let's leave out detached HEAD for simplicity). It's like your model, but also includes the state of the repo at that commit. This is a really subtle difference, but the key is that checkout is one atomic operation.

I think the easiest way to explain is by analogy[0] to editing a regular text file. You've got the file on disk, and the version in your editor's buffer (working tree), and every time you save, you're making a commit (with `--amend`, on most filesystems). When you decide to edit a different file, and open it, technically there's two independent operations -- switch which file handle you're writing to, and replace the contents of the buffer with the contents of the new file -- but I seldom think of it this way (and I can't think of an editor that separates them).

This is also why I don't like overloading with `git checkout <commit> -- <files>...`, which does not update the HEAD. It shatters the "open file" analogy; it's like changing the contents of your buffer without changing which file you're writing to. In my mind, that's a totally separate function (typically accomplished by opening the other file separately and then copying its contents into the buffer, an inefficient operation that I'm grateful git provides a better alternative to).

Aside, I also prefer to think of each branch (not commit!) as having its own persistent working tree and staging area; I'd prefer not to have to push and pop a stash each time I check out a new branch if I already had some work in progress. `git worktree` comes close, but lacks the ability to navigate between worktrees but stay in the same directory relative to the root, like `checkout` does. Also you have to initialize other worktrees with a different root, which pollutes the file system or forces you to use an extra level of nesting.

It's been on my list of projects for a while to write a git porcelain that works the way I'd like, but it's pretty low priority (despite my complaints, git works pretty well for me), so I doubt I'll get to it for a few years.

[0] Come to think of it, maybe "analogy" is not the best word. It's more like, I prefer to view git as an extension of my filesystem, so I want a consistent mental model across the whole thing.

Re:Ask HN: What's the worst piece of software you use everyday? by bacon_waffle on Wednesday July 15, 2020 @10:44PM (#23855181)
Thanks for the post! I should mention that I'm not a git expert by any stretch, just a git user who's recently been herding some folks at work from perforce to git (so have brushed up on git explanations/internals).

It seems like the conflict is that there actually are some separate things going on "under the hood", and you're not satisfied with the way that git has combined them? To be explicit, some distinct steps we're discussing are:

1) Update the working tree to match the tree-ish

2) Create a new branch

3) Update HEAD to point at the branch (or other tree-ish)

As is currently implemented, "git checkout somebranch" does 1 and 3, "git checkout somebranch -- <files>" does just 1, "git branch somebranch" does just 2, and "git checkout -b newbranch" does 2 and 3. AFAIK, there's not a "git branch" argument that causes it to update HEAD, but the standard version of "git checkout" does exactly that. From the perspective of a new git user, maybe "git branch" is the obvious command to look at for making and using a new branch, but I think "git checkout" is the obvious command for using a branch.

So, perhaps "checkout" could have a better name; maybe "use" or "work" instead?

I must admit that I don't understand what you mean by "state of the repo at that commit" - is that related to the idea of each branch having a persistent working tree and staging area? When I run in to a situation where the second would be relevant, I tend to do "git commit -am WIP" then on return to that branch, "git reset HEAD~1". It very rarely happens that I'm in the middle of composing a commit (staging things) but need to switch to a different branch in the same project, so it doesn't really matter that the staging area and working directory all got munged together.

Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Saturday July 25, 2020 @01:55PM (#23951135)
I've been quite busy; hopefully you'll see this. Like above, I agree that you're technically correct.

First, I would like to re-order those steps (and I am curious whether you intended the order to be meaningful). Then, I'll try to explain how they, while technically correct (again) to the best of my knowledge, don't match my mental model (particularly "update working tree", which is not part of "checkout" in smichel17-land). Yes — this is related to the "persistent working tree" (or maybe "working tree as a concept that doesn't exist in my mental model" would be better phrasing — but I'm getting ahead of myself).

---

Note that without flags, you'd have to "git branch" first, then "git checkout". Also, it's easier for me to think about if each command only performs consecutive steps, in order. Fortunately, we can achieve that:

1) Create a new branch

2) Update HEAD to point at the branch (or other tree-ish)

3) Update the working tree to match the tree-ish

"git branch somebranch" does just 1, "git checkout -b newbranch" does 1 and 2, "git checkout somebranch" does 2 and 3, "git checkout somebranch -- <files>" does just 3. I think this helps clarify my issues with both -b and --. They both change which step "checkout" starts on (and "-b" changes the ending, too!).

By analogy: if these commands are like functions, adding a step afterward is like a flag that modifies the output, while adding a step before is a flag that modifies the expected input. Sure, you could organize your code around the outputs it produces, and sometimes we do that (eg, serialization/parsing you have things like JSON.stringify, String.fromInt, different constructors for classes, etc). But typically it makes more sense to group based on what you want to do with a given object/class/data-type — it's nice to be able to answer, "I have an X, what are all the things I can do with it?"

Maybe that's stretching the analogy a little. But it ties in with my original comment mentioning the "primary action", which I guess I could rephrase as "first action in the chain".

---

What's the primary action of "checkout"? Well, "updating" the HEAD. So here's where we get back to abstractions / mental models — I would say, moving the HEAD. But first, let's take a short detour.

What's a commit? Technically, it's a diff and some metadata (author, parent commit(s), ...) with a deterministic name. But in terms of actual use, it's a snapshot of the repository at a certain point in time. (Or, if you'll permit a little snark, a version, as in "version control".) Zoom out to the whole repository, and you can visualize it as a tree of commits, ordered along the axis of time. Visualization:

    git log --graph --format="%C(yellow)%h%Cgreen%d"
That includes branches, so what about them? Technically, they're tags. But in my mental model, they're boxes which contain mutable state that I might want to commit. They're the buffer in my text editor, where I make changes before saving to disk. As a crude visualization of making a commit, I choose a subset of those changes and put them in the bottom of the box (stage them), then chop the box in half. The bottom becomes the new commit, and the branch remains on top, still holding any unstaged changes.

Finally, back to the HEAD (our detour is over). Technically, it's just another tag. But to me, it's a camera, through which I look at a given box (or snapshot). It's the location where I am. It's $PWD.

To bring it all together:

- Branches sit on top of a commit and stay there.

- When I check out a different branch, they remain on top of the same commit, still holding the unsaved changes in their box. This is what I meant by "persistent working tree".

- Checking out a branch, conceptually, is just moving my view (HEAD) to a different branch. It doesn't involve changing files. It's the equivalent of "cd".

So this is why it barely makes sense for me to talk about "the" working tree. I have a bunch of boxes/folders/"working trees", called branches. That I have to copy them to "the working tree" in order to edit them is an implementation detail. Step 3 above (your 1, "update the working tree") doesn't exist in my mental model. You just move the HEAD. One atomic operation.

"-b" and "--" both break my mental model because they add side effects to an operation that's otherwise just "look around." "-b" isn't quite as bad, because I could imagine a flag on "cd" that makes it run "mkdir -p" first ("Go here, even if it doesn't exist yet."), but it still makes more sense as a flag on "branch" ("Create a new box, and look at it").

> So, perhaps "checkout" could have a better name; maybe "use" or "work" instead?

I think the new "switch" fits pretty well. And, "git branch [-s|--switch]" aren't taken yet :)

Aside, "git reset" is about moving which commit a branch sits on top of, and its various hardness flags are about what to do with the contents of both the box and the commits it was sitting on top of. There used to not be a command for "copy some stuff into my box from a different box or commit", so I had to use checkout, but now there's "git restore".

Re:Ask HN: What's the worst piece of software you use everyday? by bacon_waffle on Sunday July 26, 2020 @09:39PM (#23961571)
Thanks! No, there wasn't any reason behind that ordering, as far as I remember.

> What's the primary action of "checkout"? Well, "updating" the HEAD.

This might be where we diverge - I'd say that the primary action of "git checkout" is to update the working tree, secondary action is to update HEAD.

> What's a commit? Technically, it's a diff and some metadata (author, parent commit(s), ...) with a deterministic name. But in terms of actual use, it's a snapshot of the repository at a certain point in time.

This isn't actually the case; git commits contain a "tree", which is not a diff. The tree is a table of file paths, attributes, and hashes that each identify a "blob" - the (compressed) contents of a file. The commit represents a state of the committed files (and links); to me "snapshot of the repository" would include things like the state of the branches in the repo, HEAD, and commits that are present but outside the history of the commit in question.

---

Thanks for the explanation, I think I understand what you mean and like the idea. Maybe this is what you alluded to a few posts up, but it seems like a new subcommand could roll up the working directory and staging area in to a temporary commit or two, do the normal "git checkout otherbranch", then unroll any temporary commit(s) that were present in otherbranch.

At a previous employer, I used mercurial including a feature (perhaps provided by an extension, I can't find it at the moment) that allowed a commit to be marked as local-only, so it wouldn't be pushed. Something like this could probably be done with git hooks to prevent the temporary working/staging commits being shared unintentionally.

Re:Ask HN: What's the worst piece of software you use everyday? by aprdm on Saturday July 11, 2020 @07:59PM (#23807319)
There's an interview question about some behaviour of git that people don't rely on very often? Wow. Asking anything about VCS seems a bit off in general if the person has any experience under their belt developing software...
Re:Ask HN: What's the worst piece of software you use everyday? by james-skemp on Saturday July 11, 2020 @08:55PM (#23807667)
> Asking anything about VCS seems a bit off in general if the person has any experience under their belt developing software...

Why so? We don't go into great depth, but every hiring committee I've been on I make sure that we ask something about source control.

You can learn a lot about a developer's process by finding out if and how they use source control. (Red flag, for me, is if an apparent senior dev doesn't use a VCS.)

Re:Ask HN: What's the worst piece of software you use everyday? by pragmatic on Saturday July 11, 2020 @09:22PM (#23807809)
Isn't there a difference between knowing/understanding VCS and git flag trivia? Seems needlessly pendantic?
Re:Ask HN: What's the worst piece of software you use everyday? by OJFord on Sunday July 12, 2020 @07:45AM (#23810630)
Not GP, but if I were, to me 'I can never remember the flags, so I made aliases' is a good answer. (Problem-solving, learning to use tools in a way that works for them, etc.)
Re:Ask HN: What's the worst piece of software you use everyday? by james-skemp on Sunday July 12, 2020 @06:04PM (#23815149)
Whoops.

Red flag = warning sign, not anything related to Git flags.

OJFord is basically correct, though. It's 2020, so if you're interviewing for a developer/programming position, you should at least know something about the various VCS options.

If it helps, during our last set of interviews the question was "What is your strategy when using source control?"

Before that was the two part question of "Describe your preferred development environment, both physical and technical. What is one thing in your development process that you can’t live without?" (I always tell the candidate that my answer to this is some sort of VCS.)

(These were both for the second, in-person, interview. There's not necessarily a wrong answer. It's not like we're asking them to name as many differences between Git and TFS as they can. :) )

Re:Ask HN: What's the worst piece of software you use everyday? by senderista on Sunday July 12, 2020 @11:35AM (#23812099)
Who asks interview questions about git syntax? I’ve never encountered this (in 20 years) and hope I never do.
Re:Ask HN: What's the worst piece of software you use everyday? by brianpan on Sunday July 12, 2020 @03:17AM (#23809513)
I seem to make tracking branches just as often.

  git checkout -t remote-branch
Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Saturday July 11, 2020 @07:55PM (#23807292)
I like staging my changes with `git add -p` before I commit as a way of reviewing what I did. I often catch mistakes or unnecessary changes this way. I suppose you could build the same workflow with stashes, but it seems quite awkward that way.
Re:Ask HN: What's the worst piece of software you use everyday? by johannes1234321 on Saturday July 11, 2020 @09:40PM (#23807933)
git add -p is extremely useful if I encounter a typo or something while doing some other change. Then I can commit this small unrelated change in its own commit without mixing with actual changes and without losing my context (of course this should be trivial stuff only, as it might be mixed up in the feature branch of current work)
Re:Ask HN: What's the worst piece of software you use everyday? by recursive on Saturday July 11, 2020 @08:58PM (#23807685)
I just review the diff before I commit.
Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Saturday July 11, 2020 @10:14PM (#23808134)
I do the same thing for small commits. Anything larger than ~25 lines (to the point where the whole diff doesn't fit on screen at once) becomes a lot of wasted time finding where I left off. Adding things incrementally means I don't need to look at them twice.
Re:Ask HN: What's the worst piece of software you use everyday? by account42 on Monday July 13, 2020 @05:55AM (#23819016)
I rarely use git add (basically only for new files or non-text files) and instead always use commit --patch.
Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Monday July 13, 2020 @12:15PM (#23822390)
What do you do when you come across lines that you want to commit, but edit beforehand? I always run into syntax errors when I use `e` to edit a diff during `git add -p`, and it doesn't update the file in the working tree, which I also want. Skip it and then `commit --amend`?
Re:Ask HN: What's the worst piece of software you use everyday? by account42 on Tuesday July 14, 2020 @09:30AM (#23831692)
A tiny change like a typo in a comment I would just edit in both the git commit --patch `e` editor and in the working tree copy. Anything bigger I'd either abort or skip and edit/test normally and then amend. My main use for `e` are not really edits to the final code but rather for splitting up changes that affect the same line.

I only had problems with errors from `e` on Windows - I'm guessing due to wrong line endings.

Re:Ask HN: What's the worst piece of software you use everyday? by mbilker on Sunday July 12, 2020 @02:07AM (#23809250)
TIL about this. I was using `git add -i` and using the patch function.
Re:Ask HN: What's the worst piece of software you use everyday? by still_grokking on Saturday July 11, 2020 @07:00PM (#23806921)
> I think the whold concept of stage/index/cache is completely unnecessary though

I was thinking the same for many years. But lately started to use VSCode for some projects. To see how staging is integrated there was almost an enlightening experience to be honest. All it takes to make staging an extremely useful feature, compared to all the other IDEs, is a slight change in how diffs are presented: In VSCode line-change markers indicate only a diff between working tree and cache (and not working tree and HEAD, like "everywhere" else). After staging a file in VSCode all inline diff markers disappear and the file looks like it would be unmodified. Than, new changes on top of the staged stuff will result in line change markers and inline diffs (showing only the unstaged changes). This way one can track "changes on top of changes" without having to commit the intermediate steps. This makes building up even big commits quite convenient as one can do it in small steps, having a (directly visible) diff of manageable size at any time in this process.

Re:Ask HN: What's the worst piece of software you use everyday? by SiVal on Saturday July 11, 2020 @07:41PM (#23807209)
You don't need an extra cache level for that. If what you want is to accumulate "adds" one at a time into the cache to create one combined commit, you could just accumulate small commits until you had what you wanted, then merge the commits into one combined commit before pushing to the server.
Re:Ask HN: What's the worst piece of software you use everyday? by still_grokking on Saturday July 11, 2020 @07:46PM (#23807246)
Sure. And I was doing this.

But it requires a lot of additional ceremony—alone naming the intermediate steps… ◔_◔

Re:Ask HN: What's the worst piece of software you use everyday? by ptx on Saturday July 11, 2020 @08:01PM (#23807331)
Or just one commit and keep amending it.
Re:Ask HN: What's the worst piece of software you use everyday? by still_grokking on Saturday July 11, 2020 @08:34PM (#23807537)
This approach doesn't allow you to easily revert parts of your last change-set. Actually you can't even distinguish in the diff your last changes form all the other accumulated changes once the recent change-set was commited.
Re:Ask HN: What's the worst piece of software you use everyday? by smichel17 on Saturday July 11, 2020 @10:18PM (#23808155)
I don't follow. You could totally implement a staging area workflow by making a commit with the message "Staging Area", repeatedly amending it, and then finally giving it a real message when you're ready to commit "for real". The main thing you lose that way is the ability to push safely.
Re:Ask HN: What's the worst piece of software you use everyday? by imtringued on Sunday July 12, 2020 @05:18AM (#23810064)
Counter anecdote: I don't know how to create a branch without checking it out.
Re:Ask HN: What's the worst piece of software you use everyday? by recursive on Monday July 13, 2020 @11:57AM (#23822162)
`git branch {foo}`

For once, it's a git command that seems to be clear about what it does, but it just doesn't check out.

Re:Ask HN: What's the worst piece of software you use everyday? by mariusor on Monday July 13, 2020 @02:55AM (#23817784)
Not all git repositories have working trees. On a bare one a checkout doesn't work.
Re:Ask HN: What's the worst piece of software you use everyday? by michaelt on Saturday July 11, 2020 @06:22PM (#23806650)
If you want to change from a git-lover to a git-hater, just join a project that uses submodules.
Re:Ask HN: What's the worst piece of software you use everyday? by balladeer on Sunday July 12, 2020 @01:35AM (#23809117)
That happened to me few months ago when a new submodule was added that gets updated regularly (old ones are some legacy libs just lying there). I literally had to beg some colleagues to not forget to commit the changed submodule ref to host/main project. None of them even understood why it was needed since "it would anyway be solved by `git submodule update --init --recursive` anyway".

Also, of late I have turned to "a lover of git GUI apps" form a full "git in cli is the best evangelist". But that has happened for most other tools as well. I guess I am kind of done with cli.

Re:Ask HN: What's the worst piece of software you use everyday? by pintxo on Sunday July 12, 2020 @01:58AM (#23809213)
Similar here, but without learning the CLI first, I would not be comfortable with the GUIs.
Re:Ask HN: What's the worst piece of software you use everyday? by hijef on Sunday July 12, 2020 @01:34AM (#23809114)
Lol... Don't want to go down that rabbit hole. So many tools have been written to help with submodules. Such a shame. I feel like the only success path for submodules in any project is for anyone working on the project is to understand them completely.
Re:Ask HN: What's the worst piece of software you use everyday? by nicbou on Sunday July 12, 2020 @04:05AM (#23809721)
I've been using git for a decade, and I still have to Google simple tasks. The answers rarely make sense.
Re:Ask HN: What's the worst piece of software you use everyday? by mcswell on Sunday July 12, 2020 @01:22PM (#23812978)
My history with git is shorter, but ditto to the web search for simple tasks. Before git, I used svn, and most things there made sense (not everything, I admit).
Re:Ask HN: What's the worst piece of software you use everyday? by mcswell on Sunday July 12, 2020 @01:20PM (#23812956)
git mv foo.bar <SomeNewDirectory>/

It loses all history of foo.bar. I guess if you pull up a version before the mv, you can still see it, but as far as git is concerned, foo.bar in the new location has no relationship to foo.bar in the old location.

Many people have complained about this over the years, but it's still that way. Because (they say) Linus likes it that way.

Re:Ask HN: What's the worst piece of software you use everyday? by rovr138 on Sunday July 12, 2020 @05:19PM (#23814852)

    git log --follow