• 0 Posts
  • 43 Comments
Joined 11 months ago
cake
Cake day: August 13th, 2023

help-circle





  • 2019, so 4-5 years ago so not that recent but not ancient either. But unfortunately tutorials have not been updated.

    I would say that the biggest benefit of git switch is that you can’t switch to a detached state without using a flag (--detached or -d). If you do git co $tag or git co $sha-1 you may get at one point the error “you are in a detached state” which is ununderstable for begginers. To get the same error with git switch you must explicitely use git switch --detached $tag/$sha-1 which makes it much easier to understand and remember that you are going to do something unusual.

    More generally it’s harder to misuse git switch/git restore. And it’s easier to explain them since the only do one thing (unlike git checkout which is a mess !).

    So if it’s only for you git checkout is fine, but I would still advice to use git switch and git restore so you will have an easier time to teach/help begginers.



  • I am always doubtful when people say that accessing information inside git is hard. I totally agree that defaults in git can be improved (and they are, git restore and git switch are a much better alternative to git checkout that I no longer use). So let’s review the section “A Few Reasons Why SQLite Does Not Use Git”:

    “Git does not provide good situational awareness”

    git log --graph --oneline --author-date-order --since=1week

    Make it an alias if you use it often. Alias is what helps you create your own good default (until everyone uses the same alias and in that case it should be part of the base set of commands).

    “Git makes it difficult to find successors (descendants) of a check-in”

    git log --graph --oneline --all --ancestry-path ${commit}~..

    Likewise you could consider making it an alias if you use it often. Aliases can also be used as a post-it to help you remember what are the command that you find useful but you only use once in a blue moon!

    The mental model for Git is needlessly complex

    I may agree about that one. For reference, this is what the article says:

    A user of Git needs to keep all of the following in mind: The working directory The “index” or staging area The local head The local copy of the remote head The actual remote head

    If git fetch was run automatically every so often, as well as git push (of course in a personal branch), then this model could be simplified as

    • the working directory
    • the “index” or staging area (I actually think that being able to have more than one for drafting multiples commit at once, like a fix and a feature at the same time would be better than only having a single index)
    • your working copy of the shared branch
    • the shared branch

    And integrating your changes (merging/rebasing) should probably be exclusively done using a PR-like mechanism.

    Git does not track historical branch names

    I’m skeptical about the usefulness of this. But since git was my first real vcs (10 years ago), it may just be that I have not used a workflow that took advantaged of persistant branches. I assume that git annotate could be a solution here.

    Git requires more administrative support

    most developers use a third-party service such as GitHub or GitLab, and thus introduce additional dependencies.

    That’s absolutely true but I’m not sure it’s a real issue. Given how many strategies there are for CI/CD (and none is the definitive winner yet) I do think that being able to select the right option for you/your team/your org is probably a good idea.

    Git provides a poor user experience

    https://xkcd.com/1597/

    I highly disagree about that xkcd comics. Git is compatible will all workflows so you have to use a subset of all the commands. Of course you will have more commands that you never use if a software is usable for all the workflow that you don’t use. But you need about 15 commands to do stuff, 30 to be fluent, and some more to be able to help anyone. Compared to any other complex software that I use I really don’t think that it’s an unreasonably high count. That being said I totally agree that git from 10+ years ago was more complex and we should correctly teach what is needed to junior. HTML/css/js is a nightmare of complexity but it doesn’t stop 15 years old kid with no mentoring to build cool stuff because you don’t need to know everything to be able to do most of the things you may think of, just a good minimal set of tools. And people should definitively take the time to learn git, and stop using outdated guide. Anything that don’t use git switch, git restore and git rebase --interactive and presents you have to inspect the history in length (git log --graph or any graphical interface that show the history in a graph, git show, and more generally than you can filter the history in any way you want, being by author, date, folder, file type, …) is definitively not a good guide.


    To sum-up, I think that from this presentation fossil seems more opinionated than git which means that it will be simpler as long as your workflow exactly matches the expected workflow whereas using git requires to curate its list of commands to select only the one useful for yours.




  • You seems to have a severe issue so I’m not sure what I’m going to say may help.

    Learning something and then forgeting it is absolutely normal. Repetition over and exponentially long time and sleep in between helps a lot. Some people use flashcards to helps with memorisation. The idea is simple, when you learn something you write question + answers on a piece on paper (usually bristol for easy manipulation) and put it in a box. This box has multiple compartment: every day, every second day, once a week, once every second week, once every second month for example. When you add a card you add it to the “every day” compartment. Then each day you open all the compartment of the current day and ask yourself all the questions. If you correctly remember the answer you put it in the next compartment, and if you don’t you put it back to the “every day” one.

    Another way to helps you understand and rembembering things is to explain them to others. If you don’t have someone to explain what you just learn you can create youtube video (even if noone will watch them but you do as if you had an audience). As bonus you now have a video that explains using your language something you just learn if you ever forget it!






  • I can totally understand the iterating speed due to higher cognitive load of a statically typed language, and non instant compilation.

    However I am very surprised about your refactoring experience. For me Rust is at least in a league of its own. In python/js I am terrified that I could break some unknown parts of my code whenever I touch anything. In C++ I fear that I just broke an invariants and made something UB. In all those languages, I expect regressions when I’m refactoring. But in Rust, even for large scale architecture changes if it compiles I’m quite certain that it’s going to be easy to validate and often works the first try. What point points do you enconter that make your experience sub-optimal ?


  • I need to re-try it. I really like like lsp/dsp are first class cityzen, including the keybindings, and that there is better text objects than in vanilla neovim. Last time I tried it there was a few things that where not that easy to set-up (I forget what), but I should definitively take the time to learn it.

    I just wish that neovim/kakoune/helix had a marketplace just like vscode. It make the discovery and installation so much easier when everyone use the same tools.