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

Re: Thoughts on adding another hook to git

From
David Kowis <dkowis@shlrm.org>
Date
Jun 13, 2006, 13:03 UTC
Message-ID
<448EB7B6.4020708@shlrm.org>
In-Reply-To
<dbfc82860606122329w77c566evb94ca79081a0a057@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Nikolai Weibull wrote:
Show 16 quoted lines
> On 6/12/06, David Kowis <dkowis@shlrm.org> wrote:
>> Yakov Lerner wrote:
> 
>> > git-commit sure creates those temp files with
>> > specific naming in specific dir. You could check for
>> > that in EDITOR script. In the script, you could even check
>> > the name of the parent process.
> 
>> This is true. However, I'd be running that script every time something
>> invoked $EDITOR. And some people may not like that solution. I'm
>> thinking that more than just I will like to use this pre-edit hook.
>> Especially in the distro I'm helping develop.
> 
> Perhaps you could tell us what editor you are using.  That way we may
> provide additional solutions.
> 
I'm using vim. But that's irrelevant with what I'm trying to do.
Perhaps I need to explain more:

In SourceMage, we have a collection of scripts, the grimoire, that contain the little bits of instructions on how to build and install all the software. 99% of the time most commits are based in one directory. For example: I just updated the abook spell (A spell is that collection of instructions I mentioned earlier.)

I modified two files. DETAILS and HISTORY. DETAILS contains the version information, and a source hash to verify downloads (and a bit of other stuff, but it's not important). HISTORY is just a changelog. Now I do `git commit .` I get:

  1 # Explicit paths specified without -i nor -o; assuming --only paths...
  2 #
  3 # Updated but not checked in:
  4 #   (will commit)
  5 #
  6 #   modified: mail/abook/DETAILS
  7 #   modified: mail/abook/HISTORY

What I'd like to be able to do is have that "abook" directory name automatically added to the top of my commit message before it gets into the editor. I can do this with a script (echo ${PWD##*/}) but it'd need to be a hook before the editor shows up.

  1 abook:
  2 # Explicit paths specified without -i nor -o; assuming --only paths...
  3 #
  4 # Updated but not checked in:
  5 #   (will commit)
  6 #
  7 #   modified: mail/abook/DETAILS
  8 #   modified: mail/abook/HISTORY

It helps in the short log (git log) for describing for which spell the log refers. Although it could be done with an EDITOR script I don't think that's the best solution. It's certainly not a good solution to give out to a lot of people. Most of the changes to our grimoire are like this one, so this would be extremely useful to us.

Hope that clears things up a bit,
- --
David Kowis

ISO Team Lead - www.sourcemage.org Source Mage GNU/Linux

Progress isn't made by early risers. It's made by lazy men trying to
find easier ways to do something.
  - Robert Heinlein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iQGVAwUBRI63tsnf+vRw63ObAQqvqAv/QkyEi4/wIDo+sQGMPkXhj/e7yMDXbVLm XYaVhlxOG3rXfaEu6ecdjm8b6h4UYCMFnhYKUiDqD42LlEdofCIOecGULyP5Nx9q JAL8BaZpq4MwRQt4HiX9oLQBTIW2ZcD9Fg5ZqFUL3QWFbjednbEl+M8/41JGFL4s XpvIcKHfAy90qdG5QrgsHdQTAS6JG+9mFmyi4d0wlDWBh4WoutfEfL/nwbH79d2B Udq6j/SIy0dmsbjNmzJnPYn5IVrFYGez4y5bW7LDpO5ddf4027iz9mNb8hd0wCzL akh1f4xQQ178iaFz4y60TTmNavxswRmdoKTghRKet0MXTtBTUXe0TUJ5vNOtKODz 5MWu9M5/olCcLqlb7L6wnvqJ9HnJTvAEAUQpvKztQcC2Uy2XkpznW3XmeEK50CLU VQjxSzubUfXDxkf/hS1nY3WKL3UuQoGWVDmL2Maxno+Kwb3YoyW5+etvYvfoqNT7 Vi7bpiX6fPVF/r6ogATzqla2EFLsta1f =m3vG -----END PGP SIGNATURE-----

Previous: Nikolai WeibullNext: Nikolai Weibull
Message 7 of 9 in “Thoughts on adding another hook to git”
  1. David KowisJun 12, 2006
  2. Yakov LernerJun 12, 2006
  3. David KowisJun 12, 2006
  4. Yakov LernerJun 12, 2006
  5. David KowisJun 12, 2006
  6. Nikolai WeibullJun 13, 2006
  7. David KowisJun 13, 2006
  8. Nikolai WeibullJun 13, 2006
  9. Junio C HamanoJun 13, 2006

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.