bup-cron icon indicating copy to clipboard operation
bup-cron copied to clipboard

More verbose stats / after-hook

Open blueyed opened this issue 9 years ago • 5 comments

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).

blueyed avatar Dec 17 '14 17:12 blueyed

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?

anarcat avatar Dec 18 '14 02:12 anarcat

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.

blueyed avatar Dec 18 '14 03:12 blueyed

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...

anarcat avatar Dec 18 '14 04:12 anarcat

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

blueyed avatar Dec 18 '14 13:12 blueyed

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

anarcat avatar Dec 18 '14 21:12 anarcat