git/list[1] front-page[2] threads[3] people[4] search[5] about
 

StGit hooks

From
Karl Hasselström <kha@treskal.com>
Date
Nov 28, 2007, 10:17 UTC
Message-ID
<20071128101718.GA13940@diana.vm.bytemark.co.uk>
In-Reply-To
<20071128093403.GB12977@diana.vm.bytemark.co.uk>
On 2007-11-28 10:34:03 +0100, Karl Hasselström wrote:
> It would also be convenient with a post-commit hook that turns new
> commits into patches automatically. And gives "git commit --amend"
> the semantics of "stg refresh".

Hmm, so what I'd want for this is a hook that gets called every time a branch ref is updated (after the update), preferably with the ref name and its old and new values as arguments (but as long as I get the ref name, I guess I could just ask git for the sha1s?). Is there such a hook? I poked around a bit, but couldn't find any.

For extra points, I'd like to know what operation caused the ref update. I'd want to do different things depending on whether the user did a "commit" or "commit --amend", for example. I could use a heuristic, but I'd rather not if there's a way to know for sure. (Hmm. It looks like the reflog messages could be used here. Are they stable enough?)

Also, if StGit is to set up hooks automatically (commit hooks, pre-rebase hooks, whatever), it'd be nice to not have to worry about overwriting any existing hooks the user might have. But git currently allows only one hook script per hook, right?

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Karl HasselströmNext: Andreas Ericsson
Message 5 of 26 in “stgit: lost all my patches again”
  1. Jon SmirlNov 27, 2007
  2. Jakub NarebskiNov 27, 2007
  3. Jon SmirlNov 27, 2007
  4. Karl HasselströmNov 28, 2007
  5. StGit hooksKarl Hasselström, Nov 28, 2007
  6. Andreas EricssonNov 28, 2007
  7. Karl HasselströmNov 28, 2007
  8. Andreas EricssonNov 28, 2007
  9. Karl HasselströmNov 28, 2007
  10. Andreas EricssonNov 28, 2007
  11. Jon SmirlNov 28, 2007
  12. Andreas EricssonNov 28, 2007
  13. Karl HasselströmNov 28, 2007
  14. Andreas EricssonNov 28, 2007
  15. Karl HasselströmNov 28, 2007
  16. Junio C HamanoNov 28, 2007
  17. Jon SmirlNov 28, 2007
  18. Karl HasselströmNov 28, 2007
  19. Jon SmirlNov 28, 2007
  20. Karl HasselströmNov 28, 2007
  21. Jon SmirlNov 28, 2007
  22. Karl HasselströmNov 28, 2007
  23. Make "stg repair" help text more helpfulKarl Hasselström, Nov 30, 2007
  24. Junio C HamanoNov 28, 2007
  25. Jon SmirlNov 28, 2007
  26. Karl HasselströmNov 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.