5 ms·
Git could learn from Pijul, IMHO, in the sense of better emphasis for newcomers for how to think in terms of patches. For example Pijul aims to focus on first
by jph 6y ago
Git could learn from Pijul, IMHO, in the sense of better emphasis for newcomers for how to think in terms of patches.
For example Pijul aims to focus on first creating a patch, whereas git tutorials IME tend to focus on first creating a branch, then editing files, and only later discussing patch oriented areas such as `git add --patch` and `git stash`. I see many newcomers finally get their "AHA" insights about git's power when they learn `--patch`.
- jiofih 6y agoI haven’t met a single person that used manual git patches in my entire career (10+ years, web services).
- WorldMaker 6y agoI've met a lot of people that would use it if they knew how. (It's so very common to work on things side-by-side and then want to split things out into more logical commits to describe things as individual changes.) Coming from a darcs background where that was a natural and very easy part of the UX, I had reason to learn how to do it in git (because I was used to doing it quite often in darcs). When people watch me do it, they can't believe that magic exists in git. I agree with the above poster that if graphical user interfaces prioritized it better, if the CLI had a bit fewer warts (I still often confuse when to use `git add --patch` and when to use `git add --interactive` though it isn't an awful confusion because you can get to one from the other when you remember how to use it), and if tutorials tried better to train people on the tools that already exist, a lot more people would presumably use them (daily in some cases). More awareness of tools like darcs and pijul does help in that by presenting UXes built around it, it does drive people to ask how to do equivalents in git. (Why just the other week there was an HN headline where someone was really excited they hacked the email-focused `git format-patch` and a workflow akin to sending email to oneself to replicate `git add --patch` because they didn't realize `git add --patch` was also a built-in tool.)
- chriswarbo 6y agoJust wanted to say that the Magit UI makes it really easy to pick and choose which lines to commit (plus it has code-folding for files and chunks, which is nice). I still drop into the git CLI if I need to do things like editing the contents of lines, e.g. if I've added a new function and renamed an existing one, and I want to add these as two commits, I might edit the first commit to use the old name.
- chriswarbo 6y agoOne great use-case for git patches is moving files between repos without losing their history. I've done this many times, e.g. solving a problem in an application, then later wanting to move that code into a library so it can be used elsewhere. I do this so infrequently that I never remember the commands, but frequently enough that I remember which StackOverflow answer to Google for: https://stackoverflow.com/a/11426261/884682 https://stackoverflow.com/a/11426261/884682