Open blueyed opened 9 years ago
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?
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.
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...
It is quite expensive to generate, so having it generated only once is useful.
makes sense. so maybe a --dirstat
option? unless you can think of more such hooks that would be implemented?
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
).