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

Re: [PATCH] Add post-merge hook.

From
JEJosh England <jjengla@sandia.gov>
Date
Sep 4, 2007, 20:32 UTC
Message-ID
<1188937975.6192.59.camel@beauty>
In-Reply-To
<7vodgimc53.fsf@gitster.siamese.dyndns.org>
On Tue, 2007-09-04 at 13:03 -0700, Junio C Hamano wrote:
Show 19 quoted lines
> >> >>  * Do you want to run the post-merge hook even for a squash
> >> >>    merge?
> >> >
> >> > Yes.  I'd like to run it at any time that the working tree might be
> >> > updated.
> >> 
> >> If that is the case, perhaps your hook may want to get a
> >> parameter to tell it what kind of "git-merge" invocation it was?
> >> Squash merge does not even advance the HEAD and is of a very
> >> different nature from a normal merge.
> >
> > OK.  Should it just pass in a flag (squash or normal), or are there
> > other merge types it should need to know about.
> 
> I suspect you have thought abuot the issues involved longer than
> I have ;-), so you should take whatever I say with grain of
> salt, but I think you would also want to know fast-forwards and
> up-to-dates if the hook wants to be generic, not "for Josh's
> workflow only".

Generic is great, I'm just trying to figure out when/why someone would need to know the exact type of merge operation used. The hook should be generic, yet not require an end user to know any git internals not explicitly mentioned in the git-merge man page. I'm thinking that it will be sufficient to pass a flag indicating whether the working tree has been modified or not. The flag can be set for normal merge and fast-forward merges, and unset for up-to-dates and squash merges. I don't really know git internals myself. Am I missing anything?

-JE
Previous: Junio C HamanoNext: Steven Grimm
Message 7 of 9 in “Add post-merge hook.”
  1. Add post-merge hook.jjengla@sandia.gov, Aug 30, 2007
  2. Junio C HamanoAug 30, 2007
  3. Josh EnglandSep 4, 2007
  4. Junio C HamanoSep 4, 2007
  5. Josh EnglandSep 4, 2007
  6. Junio C HamanoSep 4, 2007
  7. Josh EnglandSep 4, 2007
  8. Steven GrimmSep 4, 2007
  9. Josh EnglandSep 4, 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.