Skip to content

Commit

Permalink
fix git not apply for current user
Browse files Browse the repository at this point in the history
  • Loading branch information
caothu159 committed May 2, 2024
1 parent 2a001a6 commit 86ddbd9
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 52 deletions.
5 changes: 2 additions & 3 deletions src/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ductn (4.0.2+debian~rc1.1) mantic; urgency=medium
ductn (4.0.2+debian~rc1.2) mantic; urgency=medium

* support mssql
* ISSUES fix
* ISSUES git config for current user

-- Tran Ngoc Duc <ductn@diepxuan.com> Sun, 01 Oct 2023 10:59:38 +0700
2 changes: 2 additions & 0 deletions var/ductn
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
declare -F | awk '{print $3}' | grep -e "^--" | sed 's/--//g' | grep -v "commands"
}

[ ! -x "--$@" ] && echo "ductn: '$1' is not a ductn command." && exit 1

"--$@"
96 changes: 47 additions & 49 deletions var/lib/git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,53 @@
#!/bin/bash

--git:configure() {
if [[ "$USERNAME" == "ductn" ]]; then
# global gitignore
git config --global core.excludesfile ~/.gitignore

# setting
git config --global user.name "Tran Ngoc Duc"
git config --global user.email "caothu91@gmail.com"

# alias
# git config --global alias.plog "log --graph --pretty=format:'%h -%d %s %n' --abbrev-commit --date=relative --branches"

# push
git config --global push.default simple

# file mode
git config --global core.fileMode false

# line endings
git config --global core.autocrlf false
git config --global core.eol lf

# Cleanup
git config --global gc.auto 0

# remote server
git config --global receive.denyCurrentBranch updateInstead

echo "$_gitignore" >~/.gitignore
chmod 644 ~/.gitignore

# if [[ -d ./.git ]]; then
# # remote repository

# # cat <<EOF >.git/hooks/push-to-checkout
# # #!/bin/sh
# # set -ex
# # git read-tree --reset -u HEAD "$1"
# # EOF

# # cat <<EOF >.git/hooks/pre-commit
# # #!/bin/sh
# # echo $(tail -1 version | xargs) | awk -F. -v OFS=. '{$NF += 1 ; print}' >>version
# # echo $(tail -1 version | xargs) >version
# # git add version
# # exit 0
# # EOF
# chmod +x ./.git/hooks/*
# fi
fi
# global gitignore
git config --global core.excludesfile ~/.gitignore

# setting
git config --global user.name "Tran Ngoc Duc"
git config --global user.email "caothu91@gmail.com"

# alias
# git config --global alias.plog "log --graph --pretty=format:'%h -%d %s %n' --abbrev-commit --date=relative --branches"

# push
git config --global push.default simple

# file mode
git config --global core.fileMode false

# line endings
git config --global core.autocrlf false
git config --global core.eol lf

# Cleanup
git config --global gc.auto 0

# remote server
git config --global receive.denyCurrentBranch updateInstead

echo "$_gitignore" >~/.gitignore
chmod 644 ~/.gitignore

# if [[ -d ./.git ]]; then
# # remote repository

# # cat <<EOF >.git/hooks/push-to-checkout
# # #!/bin/sh
# # set -ex
# # git read-tree --reset -u HEAD "$1"
# # EOF

# # cat <<EOF >.git/hooks/pre-commit
# # #!/bin/sh
# # echo $(tail -1 version | xargs) | awk -F. -v OFS=. '{$NF += 1 ; print}' >>version
# # echo $(tail -1 version | xargs) >version
# # git add version
# # exit 0
# # EOF
# chmod +x ./.git/hooks/*
# fi
}

_gitignore=$(
Expand Down

0 comments on commit 86ddbd9

Please # to comment.