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

Re: GNU-style ChangeLog merge driver for Git

From
BHBruno Haible <bruno@clisp.org>
Date
Oct 9, 2007, 19:38 UTC
Message-ID
<200710092138.47147.bruno@clisp.org>
In-Reply-To
<BC06CC09-FD81-4153-AA54-A1A74250946B@lrde.epita.fr>
Hello Benoit,
Show 19 quoted lines
> Akim Demaille would also like it to squash the commits added by the  
> merge (the new commits in OTHERS):
> 
> YYYY-MM-DD  Author  <who@where.com>
> 
> 	Merge whatever:
> 
> 	YYYY-MM-DD  Someone Else  <foo@bar.com>
> 	Some change.
> 	* FileChanged.c: Whatever.
> 
> 	YYYY-MM-DD  Who Cares  <who@cares.com>
> 	Some other change.
> 	* OtherFile.c: Do it.
> 
> I thought this was mandated by the GNU Coding Standards but I  
> checked, it doesn't say anything about merges.  Would this sort of  
> strategy be useful to you?  Should it be default (or enabled by some  
> --squash option)?
This merge is occurring in a different situation:

The situation where we need ChangeLog merging most often is when a developer has made changes on his own and pulls in the changes from the remote repository (via "git stash; git pull; git stash apply").

The situation that Akim is describing is that he pulls changes from the repository of Someone Else and Who Cares, and then pushes them into the central repository, under his responsibility.

For the first situation, the non-remote ChangeLog entries should be moved to the top, without modification or indentation.

For the second situation, three different styles are in use at GNU (because they don't use "Signed-off" lines):

1) unmodified copying of the ChangeLog entries:
YYYY-MM-DD  Someone Else  <foo@bar.com>
	Some change.
	* FileChanged.c: Whatever.
YYYY-MM-DD  Who Cares  <who@cares.com>
	Some other change.
	* OtherFile.c: Do it.
2) copying with lieutenant's email address, like Akim described it:
YYYY-MM-DD  Lieu Tenant  <who@where.com>
	YYYY-MM-DD  Someone Else  <foo@bar.com>
	Some change.
	* FileChanged.c: Whatever.
	YYYY-MM-DD  Who Cares  <who@cares.com>
	Some other change.
	* OtherFile.c: Do it.
3) similar, but with indentation of the entire copied-in ChangeLog entries:
YYYY-MM-DD  Lieu Tenant  <who@where.com>
	YYYY-MM-DD  Someone Else  <foo@bar.com>
		Some change.
		* FileChanged.c: Whatever.
	YYYY-MM-DD  Who Cares  <who@cares.com>
		Some other change.
		* OtherFile.c: Do it.

First of all, your merge driver could try to guess whether we're in the first or second situation (maybe by testing whether the names in the ChangeLog entry match the [user]name from the git config).

Then, for the second situation, there can be some flag in the driver or in the git config that describes which of the 3 styles to apply.

Bruno
Previous: Benoit SIGOURE
Message 15 of 15 in “Re: git: avoiding merges, rebasing”
  1. Eric BlakeOct 2, 2007
  2. making "git stash" safer to useBruno Haible, Oct 3, 2007
  3. Junio C HamanoOct 3, 2007
  4. Joachim B HagaOct 4, 2007
  5. David KastrupOct 4, 2007
  6. stash clear, was Re: git: avoiding merges, rebasingJohannes Schindelin, Oct 19, 2007
  7. Miles BaderOct 23, 2007
  8. Bruno HaibleOct 3, 2007
  9. Benoit SIGOUREOct 8, 2007
  10. Benoit SIGOUREOct 8, 2007
  11. Johannes SchindelinOct 9, 2007
  12. Benoit SIGOUREOct 9, 2007
  13. Bruno HaibleOct 9, 2007
  14. GNU-style ChangeLog merge driver for Git (was: Re: git: avoiding merges, rebasing)Benoit SIGOURE, Oct 9, 2007
  15. Bruno HaibleOct 9, 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.