Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More verbose stats / after-hook #6

Open
blueyed opened this issue Dec 17, 2014 · 5 comments
Open

More verbose stats / after-hook #6

blueyed opened this issue Dec 17, 2014 · 5 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Dec 17, 2014

It would be nice to have more detailed stats in the notes, e.g. similar to git log --dirstat=lines,cumulative,3.

Since preferences differ here, and this takes some time to generate, it would be nice to have a hook here, which would export the necessary information for an external tool / command.

This hook might not be linked to the "notes" process, but could be a generic one, allowing the user to add additional notes like suggested above (by using git notes append).

@anarcat
Copy link
Owner

anarcat commented Dec 18, 2014

hmm... i'm not sure i understand what --dirstat does.

having a hook makes sense, i'd be open to adding that if it's simple enough. maybe the way snapshots are extended?

@blueyed
Copy link
Contributor Author

blueyed commented Dec 18, 2014

Try GIT_DIR=$repo git log --dirstat=lines,cumulative,3 $YOURBRANCH.

It shows how much has changed. I find this very useful when trying to keep the backups small.

maybe the way snapshots are extended?

I haven't looked into this yet, but it would make sense to have a similar interface probably.
I would like to set something like the following in the config:

after_save=git log --dirstat=lines,cumulative,3 $branch | git notes append -F - $branch

Where GIT_DIR and BUP_DIR would be set/exported in the environment for the current repo, and $branch would be set to the current branch.

@anarcat
Copy link
Owner

anarcat commented Dec 18, 2014

i see. this seems like very useful stuff! but i understand why this needs to be in the notes if you can generate it afterwards anyways...

@blueyed
Copy link
Contributor Author

blueyed commented Dec 18, 2014

It is quite expensive to generate, so having it generated only once is useful.

@anarcat
Copy link
Owner

anarcat commented Dec 18, 2014

makes sense. so maybe a --dirstat option? unless you can think of more such hooks that would be implemented?

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

No branches or pull requests

2 participants