3 ms·
> I said this in another comment recently about git, but I find it odd that even after a decade of using git as a mandatory part of my professional life, I'm st
by js2 4y ago
> I said this in another comment recently about git, but I find it odd that even after a decade of using git as a mandatory part of my professional life, I'm still learning new things.
If I can humbly offer a suggestion: read the man pages. A man page read once thoroughly is much more useful than the same man page skimmed 1000 times. The syntax in question is in the rev-parse man page (`git help rev-parse`).
These are tools we use every day. Look, I'm the first person to throw out those furniture assembly instructions and dive right in. But the truth is, we'd all be better off reading the documentation for our tools.
The git man pages are far from the best, but they contain tons of useful information.
And it's not just with git that developers seem allergic to reading documentation. I noticed a colleague the other day doing this from a shell script:
BRANCH=$(python -c 'import os; print(os.environ["BRANCH"].split("/")[1])')
I asked what they were trying to do. They wanted to strip "origin/" from the front of BRANCH. I showed them you can do that directly in the shell:
BRANCH="${BRANCH#origin/}" # strip origin/ from front
Or:
BRANCH="${BRANCH#*/}" # strip */ from front
They'd never read the bash man page. Had no idea the shell could do this. So I pointed them at https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html https://www.gnu.org/software/bash/manual/html_node/Shell-Par...
I think we'd all be better developers if we RTFM, at least for the tools/languages we use every day. You simply don't know what you don't know. This way you at least know a little more what you don't know. :-)
- vasergen 4y agoAgree with your point, but I am thinking now how many people understand python part and how many bash version.
- mabbo 4y agoI think rather than asking everyone to read the manual, the designers of software systems ought to all read Don Norman's "The Design of Everyday Things". Apple products became what they are because no manual was needed. They were designed with patterns that were intuitive, affordances, and a deep understanding of human psychology. What I am arguing is that git lacks those very things that make reading a manual not needed.