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

Re: Forcing --no-ff on pull

From
Stephen Haberman <stephen@exigencecorp.com>
Date
Dec 9, 2008, 16:39 UTC
Message-ID
<20081209103950.46c0cc00.stephen@exigencecorp.com>
In-Reply-To
<1228817565.18611.54.camel@starfruit.local>
Show 12 quoted lines
> > $ git config branch.stable.mergeoptions "--no-ff"
> 
> I recall stumbling across this a while ago looking at the git-config(1)
> man page, but this isn't /quite/ what we need.
> 
> I'm talking about forcing for *every* pull, it's a safe assumption to
> make that we want a merge commit every time somebody fast-forwards a
> branch. 
> 
> The only way I could think to make use of branch.<name>.mergeoptions
> would be to automagically set it up in a "pre-merge" hook, but alas
> post-merge exists but not pre-merge.

I had done something like this with a post-checkout hook. After checking out any branch, the hook sets various branch.<name>.options.

Also, I wrote a hook to enforce "only no-ff commits can move stable" and other fun stuff. It's out on github, in a semi-documented/unannounced project with the email/trac/etc. hooks we put in place:

http://github.com/stephenh/gc/tree/master/server/update-stable
- Stephen
Previous: Lars HjemliNext: Johannes Sixt
Message 8 of 15 in “Forcing --no-ff on pull”
  1. R. Tyler BallanceDec 9, 2008
  2. Jakub NarebskiDec 9, 2008
  3. Lars HjemliDec 9, 2008
  4. R. Tyler BallanceDec 9, 2008
  5. Lars HjemliDec 9, 2008
  6. R. Tyler BallanceDec 9, 2008
  7. Lars HjemliDec 9, 2008
  8. Stephen HabermanDec 9, 2008
  9. Johannes SixtDec 9, 2008
  10. Nanako ShiraishiDec 9, 2008
  11. R. Tyler BallanceDec 9, 2008
  12. Jeff KingDec 9, 2008
  13. Boyd Stephen Smith Jr.Dec 9, 2008
  14. Daniel BarkalowDec 9, 2008
  15. Stephen HabermanDec 10, 2008

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.