From 81bf86d41bb9bc67ad6f65bf00a487c777ee5ad2 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 23 Apr 2024 17:36:02 +0200 Subject: [PATCH] Add change 24 instructions --- how_to/Change_24.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 how_to/Change_24.md diff --git a/how_to/Change_24.md b/how_to/Change_24.md new file mode 100644 index 0000000..21243b3 --- /dev/null +++ b/how_to/Change_24.md @@ -0,0 +1,18 @@ +- base: Try different directories when searching for a ref + +In the previous change, you might have noticed that we need to spell out the +full name of a tag (Like *refs/tags/mytag*). This isn't very convenient, we +would like to have shorter command names. For example, if we've created "mytag" +tag, we should be able to do `ugit log mytag` rather than having to specify +`ugit log refs/tags/mytag`. + +We'll extend `get_oid` to search in different ref subdirectories when resolving +a name. We'll search in: +``` + Root (.ugit): This way we can specify refs/tags/mytag + .ugit/refs: This way we can specify tags/mytag + .ugit/refs/tags: This way we can specify mytag + .ugit/refs/heads: This will be needed for a future change +``` +If we find the requested name in any of the directories, return it. Otherwise +assume that the name is an OID.