Skip to content

Instantly share code, notes, and snippets.

@andrewgregory
Created September 2, 2016 19:47
Show Gist options
  • Save andrewgregory/770cbedfa2da3817d762483155a330b8 to your computer and use it in GitHub Desktop.
Save andrewgregory/770cbedfa2da3817d762483155a330b8 to your computer and use it in GitHub Desktop.
makepkg wrapper with shallow git clones
#!/bin/bash
git() {
if [[ $# -gt 1 && $1 == 'clone' ]]; then
/bin/git "$@" --depth=1
else
/bin/git "$@"
fi
}
source /bin/makepkg "$@"
@c0des1ayr
Copy link

c0des1ayr commented Aug 31, 2025

I personally did this:

#!/usr/bin/env bash 

git() {
  opt="$1"
  shift
  if [[ $# > 1 && "$opt" = "clone" ]]; then
    /usr/bin/git "$opt" --depth 1 --shallow-submodules "$@"
  else
    /usr/bin/git "$opt" "$@"
  fi
}

source /usr/bin/makepkg "$@"

because if you're gonna use bash, you might as well use bash.
And yes, I know I'm 9 years later.
I don't care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment