From fe292c02c918cb44d2c64245290aac620bf769d2 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 5 May 2024 21:04:02 +0200 Subject: [PATCH] Add change 25 instructions --- how_to/Change_25.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 how_to/Change_25.md diff --git a/how_to/Change_25.md b/how_to/Change_25.md new file mode 100644 index 0000000..941593d --- /dev/null +++ b/how_to/Change_25.md @@ -0,0 +1,12 @@ +- cli: pass HEAD by default in argparse + +First, make "@" be an alias for HEAD. (Implemented in `get_oid`) + +Second, do a little refactoring in *cli.py*. Some commands accept an optional +OID argument and if the argument isn't provided it defaults to HEAD. For example +`git log` can get an OID to start logging from, but by default it logs all +commits before HEAD. + +Instead of having each command implement this logic, let's just make "@" (HEAD) +be the default value for those commands. The relevant commands at this stage +are `log` and `tag`. More will follow.