Open ns-rse opened 1 month ago
Tpyo in commiterdate
Not regexs for .gitignore
patterns/globs instead.
GH gitignores collection: https://github.com/github/gitignore
In Challenge for .gitignore
make sure to add into the solution creating a branch.
sdiff as a possible alteranative to difftastic
EDIT : Considered adding reference to sdiff
but have opted not to as there is no clear way of how to install it on Windows (for example its not listed here) and the package its part of on Linux systems may differ. In contrast difftastic
has clear instructions for all platforms.
difftastic, "like the following where the old lines are started with - signs and may well be in red and the newer lines are started with + and may well be in green." Rather than old/newer, -
refers to lines deleted, and +
lines added? (changes within a line are reflected as a delete and addition)
Atomic commits, (title) git commit --ammend
(typo amend)
Same typo again in the body of "Squashing commits"
git commit --ammend
- would be nice for an explanation of what you were about to do before launching straight into commands?
section after this is Making Amends, which demos git commit --fixup
? naming might be inconsistent
or is Making Amends a sub-section of git commit --ammend? fond size is larger so it looks like a new section
Make example for git commit --ammend
in python-maths
What are the caveats of fixup/ammend/rebase?
Perhaps include aspects of force pushing when squashing/fixup as its important to know about what force pushes are and why you do them.
Warn about force pushing things that have been merged into main
.
More explanation/motivation of why you would be doing ammend
/ fixup
/ squash
at each stage.
Perhaps exclude fixup and git absorb
and focus just on git rebase -i
which is what these are doing in the background.
If garbage collection is automatic how necessary is it to know about it?
Could have a exercise after conventional commits to go back and fix your commit message, using that as an excuse for some of the git amend/rebase type stuff
arithmatic (typo of arithmetic) in various places.
"perf:ormance" in the conventional commits list?
How do hooks work on Windows?
pre-push
hook recommend git fetch
if on collaborative work.
Again emphasise the importance and value of these to researchers.
git commit --fixup for me did not work at all using git rebase -i --autosquash [commit of the target of the fixup] as I think the documentation is suggesting.
git commit --fixup 4fda15f
git rebase -i --autosquash 4fda15f
I needed to go one commit further back. Related, the text that says just change pick to fixup should also note that you need to move the line the fixup is on as well. Also a warning that this clobbers commit IDs and that you probably shouldn't do this if you've pushed and something else is referencing those commit IDs you're about to clobber.
Having now struggled a git hygiene thing again (previously with git amend) without really understanding exactly what was going to happen and all the implications, I'm a bit more concerned about handing researchers these tools to alter history. It's so easy to mess up, and without the tools for someone to undo their mistake, could cause a lot of stress.
I think if the course contains so many ways to clobber things it really needs to include a section on how to undo mistakes - git reflog has saved my bacon multiple times now.
Thanks for the on-going testing and feedback @fredsonnenwald
Duly noted about having to go one commit hash back, I rarely use the command line approach when I do fixups as I use Magit which has the ability to apply a fixup to the selected commit and squash it all there and then.
I've added #79 to remind me to add warnings about force pushing if others have touched the branch although in practice I personally find its quite rare for more than one person to work on a branch simultaneously (its still worth calling out though).
I'm finding its a tricky balance between introducing new ideas ("keep commits atomic and avoid commits that correct tpyos or linting, instead ammend or fixup") and not overwhelming/confusing people with complex topics such as full git rebase
usage which is why I introduce rebase only after introducing --amend
and --fixup
in the hope of easing people into it. Further with the scope for messing things up that git rebase
introduces I didn't want to cover it in detail (although obviously I need to get what I do cover correct).
Messing with reflog
feels like an Advanced topic and would take up considerable time, the material is already in need of trimming back as it is so as useful as it might be I might have to just reference it and suggest some articles for people to go and read if they want to know more.
Mention the ability to include hunks of files that have changed via git add --patch
as it aids reviewing what is being added and the ability to exclude e.g. debugging statements.
Thanks @Robadob for the suggestion.
Git configuration, "The global configuration file lives in your home director and on GNU/Linux and OSX systems is" (Typo) "Configuration defined locally over-rides global configurations." (should be plural, or preceded by "a")