Browse Source

feat: Add version and improve fetch in ai-rebase.sh

This commit introduces a version variable and improves the git
fetch command within the ai-rebase.sh script.  It makes the
script more robust and informative by displaying its version.
The fetch command is modified to correctly parse arguments.
seno 6 days ago
parent
commit
bbcb713ca7
1 changed files with 8 additions and 2 deletions
  1. 8 2
      ai-rebase.sh

+ 8 - 2
ai-rebase.sh

@@ -1,5 +1,8 @@
 #!/bin/bash
 #!/bin/bash
 set -e
 set -e
+VERSION=1.0
+
+echo "AI-Rebase v$VERSION"
 
 
 # Check for required Git configuration files
 # Check for required Git configuration files
 if [ ! -f "$HOME/.gitconfig" ]; then
 if [ ! -f "$HOME/.gitconfig" ]; then
@@ -12,7 +15,10 @@ if [ ! -f "$HOME/.git-credentials" ]; then
 	exit 1
 	exit 1
 fi
 fi
 
 
-git fetch "$@"
+IFS='/' read -r part1 part2 <<<"$1"
+
+echo git fetch $part1 $part2
+git fetch $part1 $part2
 
 
 docker run --rm -it \
 docker run --rm -it \
 	-v "$(pwd):/repo" \
 	-v "$(pwd):/repo" \
@@ -21,4 +27,4 @@ docker run --rm -it \
 	-e GEMINI_API_KEY="$GEMINI_API_KEY" \
 	-e GEMINI_API_KEY="$GEMINI_API_KEY" \
 	-e GEMINI_MODEL="${GEMINI_MODEL:-gemini-2.0-flash}" \
 	-e GEMINI_MODEL="${GEMINI_MODEL:-gemini-2.0-flash}" \
 	-u "$(id -u):$(id -g)" \
 	-u "$(id -u):$(id -g)" \
-	"${DOCKER_IMAGE_NAME:-senomas/git-rebase:1.0}" "$@"
+	"senomas/git-rebase:$VERSION" "$@"