Skip to main content

git: better debugging; handle ?tab query param

ID
33e9644
date
2025-10-19 20:45:39+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
10a5d4e
message
git: better debugging; handle ?tab query param
changed files
1 file, 3 additions, 3 deletions

Changed files

fish_functions/github-clone.fish (3451) → fish_functions/github-clone.fish (3511)

diff --git a/fish_functions/github-clone.fish b/fish_functions/github-clone.fish
index 0791d8d..c0ae08e 100644
--- a/fish_functions/github-clone.fish
+++ b/fish_functions/github-clone.fish
@@ -5,7 +5,7 @@
 # Because switching to the repo homepage, clicking, copying the clone URL,
 # typing 'git clone', pasting, are all more effort than I care to do manually.
 function github-clone --description "Clone a GitHub repository into my ~/repos directory"
-    set url "$argv[1]"
+    set url (string replace '?tab=readme-ov-file' '' "$argv[1]")
 
     # Get the identifiers for the repository
     set components (string split "/" "$url")
@@ -37,14 +37,14 @@ function github-clone --description "Clone a GitHub repository into my ~/repos d
         cd $repo
         git remote -v | grep "$owner" >/dev/null 2>&1
         if [ $status != 0 ]
-            echo "git remote add $owner $repo_url"
+            print_info "-> git remote add $owner $repo_url"
             git remote add $owner $repo_url
         end
         set remote (git remote -v | grep "$owner" | awk '{print $1}')
         git fetch
     else
         # Otherwise, clone a fresh copy of the repo
-        echo "git clone $repo_url"
+        print_info "-> git clone $repo_url"
         git clone $repo_url
         cd $repo