Does Git Have Anything Like `svn Propset Svn:keywords` Or Pre-/post-commit Hooks?
Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks or the "propset" features that can, say, update a version number or copyright notice within a file whenever it is committed to the repository.
Are git users expected to write external scripts for this sort of functionality (which doesn't seem out of the question) or have I just missed something obvious?
Edit : Just to be clear, I'm more interested in, e.g.,
svn propset svn:keywords "Author Date Id Revision" expl3.dtx
where a string like this:
$Id: expl3.dtx 780 2008-08-30 12:32:34Z morten $
is kept up-to-date with the relevant info whenever a commit occurs.
Quoting from the Git FAQ:
Does git have keyword expansion?
Not recommended. Keyword expansion causes all sorts of strange problems and isn't really useful anyway, especially within the context of an SCM. Outside git you may perform keyword expansion using a script. The Linux kernel export script does this to set the EXTRA_VERSION variable in the Makefile.
See gitattributes(5) if you really want to do this. If your translation is not reversible (eg SCCS keyword expansion) this may be problematic.
- → Commits from different branch on GitHub Pull Request
- → Split SVN repository into several Git repositories
- → File Specific Report generator
- → How to skip first N commits when converting svn repo to Git using reposurgeon?
- → Does Go development require a paid Github account for private development?
- → Git still showing end of line characters
- → Are git and svn different tools with the same purpose or are they different tools for different tasks?
- → Svn to Git of only one subdirectory
- → Incorporate existing project into existing git repo
- → SVN-Git migration: clean-git branch error
- → Why does git-svn make branches with names like [email protected]
- → How can multiple web devs use git to work on one page simultaneously?
- → Getting Subclipse in Aptana to work with the newest release of Subversion