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

Re: git: please refuse push containing commits marked for autosquash by default

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 16, 2010, 19:04 UTC
Message-ID
<20100716190432.GA16371@burratino>
In-Reply-To
<20100716123715.16356.65888.reportbug@richter>
Hi Simon,
Simon Richter wrote:
> When using the --autosquash feature, quite a number of temporary commits
> are created that should never be pushed anywhere. It might be a good
> idea to have an option to refuse to transfer commits whose messages
> start with "fixup!" or "squash!", both on the server and client side.

At first glance this looks very useful, as an optional hook rather than on by default[1].

It sounds like a good use for hooks.

Receiving side: an update hook should do the trick. See the githooks manual page, or /usr/share/doc/git/contrib/hooks/update-paranoid for an example.

Sending side: there is no pre-push hook yet, but there was some work towards that about a year and a half ago[2]. Maybe someone interested could revive the topic or figure out what remains to be done.

Jonathan

[1] Sometimes I send works in progress from one machine to another; it would be quite unnerving if this resulted in some puzzling message about how I forgot to rebase first.

[2] http://thread.gmane.org/gmane.comp.version-control.git/92900 http://thread.gmane.org/gmane.comp.version-control.git/128426/focus=128433

Next: Jeff King
Message 1 of 2 in “Re: git: please refuse push containing commits marked for autosquash by default”
  1. Jonathan NiederJul 16, 2010
  2. Jeff KingJul 26, 2010

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.