Compare commits

...

2 Commits

Author SHA1 Message Date
David Doblas Jiménez d00a7817ab Add oid parameter to log 2024-03-29 18:10:35 +01:00
David Doblas Jiménez 8ac5264366 Add change 18 to instructions 2024-03-29 18:10:16 +01:00
2 changed files with 7 additions and 1 deletions

5
how_to/Change_18.md Normal file
View File

@ -0,0 +1,5 @@
- log: Add oid parameter
Just a small cosmetic change: Instead of always printing the list of commits
from HEAD, add an optional parameter to specify an alternative commit OID to
start from. By default it will still be HEAD.

View File

@ -43,6 +43,7 @@ def parse_args():
log_parser = commands.add_parser("log")
log_parser.set_defaults(func=log)
log_parser.add_argument("oid", nargs="?")
return parser.parse_args()
@ -75,7 +76,7 @@ def commit(args):
def log(args):
oid = data.get_HEAD()
oid = args.oid or data.get_HEAD()
while oid:
commit = base.get_commit(oid)