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

[PATCH v3 0/4] git-merge: ignore space support

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 26, 2010, 05:41 UTC
Message-ID
<20100826054158.GB9708@burratino>
In-Reply-To
<20100823205915.GA4484@ns1.cockos.com>
Hi,
Justin Frankel wrote:
> git-merge and git-rebase can now be passed -Xignore-space-at-eol,
> -Xignore-space-change, -Xignore-all-space, -Xpatience options.

I've tried this out a little and it seems to do the right thing. Here's the series in its current state.

Patch 1 is to avoid the code duplication between builtin/merge and merge-recursive you noticed, by adding a function that recognizes -X options to merge-recursive.h.

Unlike the trial balloon patch I sent before, it uses a conventional return value with 0 meaning "recognized" and -1 meaning "not recognized".

Patch 2 replaces the flag parameter to ll_merge with a struct. I think the maintenance trouble of keeping track of the flag bits is not worth it for a marginal speedup.

Patches 3 and 4 provide "merge -Xpatience" and "merge -Xignore-space-change" et al on top of this foundation. I split them up and put patience first because it is worth thinking carefully about which version of a line with only whitespace changes a merge will take.

No tests yet. (If someone would like to add them, that would be great.) Probably after responding to initial comments I will not have much time for this series, so please feel free to pick it up and take it in whatever direction you wish.

Jonathan Nieder (2):
  merge-recursive: expose merge options for builtin merge
  ll-merge: replace flag argument with options struct
Justin Frankel (2):
  merge-recursive --patience
  merge-recursive: options to ignore whitespace changes
 Documentation/merge-strategies.txt    |   22 ++++++++++
 Documentation/technical/api-merge.txt |   73 +++++++++++++++++++++++---------
 builtin/checkout.c                    |    2 +-
 builtin/merge-recursive.c             |   15 +------
 builtin/merge.c                       |   20 +--------
 ll-merge.c                            |   50 +++++++++++++++-------
 ll-merge.h                            |   22 +++-------
 merge-file.c                          |    2 +-
 merge-recursive.c                     |   54 +++++++++++++++++++-----
 merge-recursive.h                     |    3 +
 rerere.c                              |    2 +-
 11 files changed, 168 insertions(+), 97 deletions(-)
-- 
1.7.2.2
Previous: Jonathan NiederNext: Jonathan Nieder
Message 15 of 23 in “git-merge: ignore space support”
  1. git-merge: ignore space supportJustin Frankel, Aug 23, 2010
  2. Jonathan NiederAug 24, 2010
  3. merge-recursive: expose merge options for builtin mergeJonathan Nieder, Aug 24, 2010
  4. Junio C HamanoAug 24, 2010
  5. Jonathan NiederAug 25, 2010
  6. Justin FrankelAug 24, 2010
  7. Jonathan NiederAug 25, 2010
  8. Bert WesargAug 25, 2010
  9. Justin FrankelAug 25, 2010
  10. Junio C HamanoAug 25, 2010
  11. Justin FrankelAug 25, 2010
  12. Junio C HamanoAug 24, 2010
  13. Bert WesargAug 24, 2010
  14. Jonathan NiederAug 25, 2010
  15. 0/4 git-merge: ignore space supportJonathan Nieder, Aug 26, 2010
  16. 1/4 merge-recursive: expose merge options for builtin mergeJonathan Nieder, Aug 26, 2010
  17. 2/4 ll-merge: replace flag argument with options structJonathan Nieder, Aug 26, 2010
  18. Junio C HamanoAug 26, 2010
  19. ll-merge: simplify opts == NULL caseJonathan Nieder, Jan 16, 2011
  20. 3/4 merge-recursive --patienceJonathan Nieder, Aug 26, 2010
  21. 4/4 merge-recursive: options to ignore whitespace changesJonathan Nieder, Aug 26, 2010
  22. Junio C HamanoAug 26, 2010
  23. Jonathan NiederAug 27, 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.