From 150324c3ac6ca43117b1747686eb8e51dc01e626 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 2 Dec 2021 23:28:11 +0100 Subject: [PATCH] bin/git: fix little script issues --- .local/bin/scripts/git-l | 2 +- .local/bin/scripts/git-unamend | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/scripts/git-l b/.local/bin/scripts/git-l index df54615..248b459 100755 --- a/.local/bin/scripts/git-l +++ b/.local/bin/scripts/git-l @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash git rev-parse @{upstream} >/dev/null 2>&1 || git branch --set-upstream-to=@{push} git pull --rebase --autostash "$@" 2> >(head -3 >&2) || diff --git a/.local/bin/scripts/git-unamend b/.local/bin/scripts/git-unamend index fabcc5e..1bcc155 100755 --- a/.local/bin/scripts/git-unamend +++ b/.local/bin/scripts/git-unamend @@ -1,5 +1,5 @@ #!/bin/sh # Remove the given files from the last commit -#git diff -p HEAD~ -- "$@" | git apply --reverse --cached +# https://stackoverflow.com/a/70197343 git reset HEAD~ "$@" -git commit --amend +git commit -v --amend