Comments (5)
Couldn't reproduce it:
ionicabizau@notebook:~$ cat .git-templates/hooks/post-commit
#!/bin/sh
echo ">>>"
### git-stats hook (begin) ###
# Copy last commit hash to clipboard on commit
commit_hash=$(git rev-parse HEAD)
repo_url=$(git config --get remote.origin.url)
commit_date=$(git log -1 --format=%cd)
commit_data="\"{ \"date\": \"$commit_date\", \"url\": \"$repo_url\", \"hash\": \"$commit_hash\" }\""
git-stats --record "${commit_data}"
### git-stats hook (end) ###
echo ">>> 1"
ionicabizau@notebook:~$ curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash
Setting up git-stats hooks.
Successfully set up git-stats hook at /home/ionicabizau/.git-templates/hooks/post-commit.
ionicabizau@notebook:~$ cat .git-templates/hooks/post-commit
#!/bin/sh
echo ">>>"
echo ">>> 1"
### git-stats hook (begin) ###
# Copy last commit hash to clipboard on commit
commit_hash=$(git rev-parse HEAD)
repo_url=$(git config --get remote.origin.url)
commit_date=$(git log -1 --format=%cd)
commit_data="\"{ \"date\": \"$commit_date\", \"url\": \"$repo_url\", \"hash\": \"$commit_hash\" }\""
git-stats --record "${commit_data}"
### git-stats hook (end) ###
It's true that echo ">>> 1"
went to top, but it was not removed. Can you describe your usecase?
from git-stats.
/cc @ashleyblackmore
from git-stats.
Sorry, I just got around to double-checking - I was wrong - I was looking in the wrong directory (.git-templates/hooks/
, rather than .git/hooks/
)
from git-stats.
@IonicaBizau on a related note, I like the script, so I've adapted a bit of it for my own hook and credited you in the hook comment header. However, I decided to use sed instead of perl because it is a bit cleaner. I'm on linux (and it is really only a hook for linux users), so maybe sed is a better approach than perl in my case.
Anyway, an idea of what I mean:
sed '/### git-stats hook (begin) ###/,/### git-stats hook (end) ###/d' $post_commit_path > $post_commit_path
My hook is here if you want to look.
Thanks for the great hook, by the way!
from git-stats.
@ashleyblackmore Nice! 👍
from git-stats.
Related Issues (20)
- Unable to print git-stats --athors to file HOT 2
- .
- Not working on Windows Git Bash HOT 5
- TypeError: Cannot supply flags when constructing one RegExp from another HOT 1
- Can not install git-stats HOT 1
- Show daily hours of activity over week HOT 1
- Error on install HOT 2
- Not able to see any of my own contributions HOT 2
- Aggregate a user HOT 1
- Add a command to view the number of code commit and remove lines HOT 1
- error installing on ubuntu 18 HOT 6
- Use special command execution tool to generate stats failed! HOT 1
- Ubuntu 20.04.02: install error HOT 6
- Respect XDG Base Directory Specification HOT 2
- Calendar starting on Sundays even with first_day: "Mon" HOT 3
- File filter HOT 1
- The pie chart drops top contributors from the legend if there are more than 40 HOT 2
- How to display separate stats for multiple projects? HOT 1
- `git-stats --authors` fails with redirected output
- Grey / Blank stats
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-stats.