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

[PATCH v3 0/4] Generic conflict style fixes

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 10, 2023, 21:37 UTC
Message-ID
<20230510213738.505241-1-felipe.contreras@gmail.com>

I sent v2 of this series almost 2 years ago [1] and received zero feedback. This is the same version except rebased on top of master.

In v1 the idea was to change the default conflictstyle, but that proposal got stuck due to a variety of reasons (including unnecessary personal drama).

v2 should not have been controversial, and neither is v3.
[1] https://lore.kernel.org/git/20210622002714.1720891-1-felipe.contreras@gmail.com/
Felipe Contreras (4):
  test: add merge style config test
  merge-tree: fix merge.conflictstyle handling
  notes: fix merge.conflictstyle handling
  test: document broken merge.conflictStyle handling
 builtin/merge-tree.c               |   4 +
 builtin/notes.c                    |   3 +-
 t/t6440-config-conflict-markers.sh | 116 +++++++++++++++++++++++++++++
 3 files changed, 122 insertions(+), 1 deletion(-)
 create mode 100755 t/t6440-config-conflict-markers.sh
Range-diff against v2:
1:  51351f1a77 = 1:  6867f22f49 test: add merge style config test
2:  1fccf561ed ! 2:  60bf233000 merge-tree: fix merge.conflictstyle handling
    @@ Commit message
     
      ## builtin/merge-tree.c ##
     @@
    - #include "blob.h"
    - #include "exec-cmd.h"
      #include "merge-blobs.h"
    + #include "quote.h"
    + #include "tree.h"
     +#include "config.h"
     +#include "xdiff-interface.h"
      
    - static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
    + static int line_termination = '\n';
      
     @@ builtin/merge-tree.c: int cmd_merge_tree(int argc, const char **argv, const char *prefix)
    - 	if (argc != 4)
    - 		usage(merge_tree_usage);
    + 	if (argc != expected_remaining_argc)
    + 		usage_with_options(merge_tree_usage, mt_options);
      
     +	git_config(git_xmerge_config, NULL);
     +
    - 	buf1 = get_tree_descriptor(r, t+0, argv[1]);
    - 	buf2 = get_tree_descriptor(r, t+1, argv[2]);
    - 	buf3 = get_tree_descriptor(r, t+2, argv[3]);
    + 	/* Do the relevant type of merge */
    + 	if (o.mode == MODE_REAL)
    + 		return real_merge(&o, merge_base, argv[0], argv[1], prefix);
     
      ## t/t6440-config-conflict-markers.sh ##
     @@ t/t6440-config-conflict-markers.sh: test_expect_success 'merge' '
3:  3bb872e3cd ! 3:  cf8cabaae3 notes: fix merge.conflictstyle handling
    @@ Commit message
     
      ## builtin/notes.c ##
     @@
    - #include "notes-merge.h"
      #include "notes-utils.h"
      #include "worktree.h"
    + #include "write-or-die.h"
     +#include "xdiff-interface.h"
      
      static const char * const git_notes_usage[] = {
    @@ builtin/notes.c: int cmd_notes(int argc, const char **argv, const char *prefix)
     -	git_config(git_default_config, NULL);
     +	git_config(git_xmerge_config, NULL);
      	argc = parse_options(argc, argv, prefix, options, git_notes_usage,
    - 			     PARSE_OPT_STOP_AT_NON_OPTION);
    - 
    + 			     PARSE_OPT_SUBCOMMAND_OPTIONAL);
    + 	if (!fn) {
     
      ## t/t6440-config-conflict-markers.sh ##
     @@ t/t6440-config-conflict-markers.sh: test_expect_success 'merge-tree' '
4:  a767bc68e6 = 4:  5959fea3c4 test: document broken merge.conflictStyle handling
-- 
2.40.0+fc1
Next: Felipe Contreras
Message 1 of 5 in “Generic conflict style fixes”
  1. 0/4 Generic conflict style fixesFelipe Contreras, May 10, 2023
  2. 1/4 test: add merge style config testFelipe Contreras, May 10, 2023
  3. 2/4 merge-tree: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023
  4. 4/4 test: document broken merge.conflictStyle handlingFelipe Contreras, May 10, 2023
  5. 3/4 notes: fix merge.conflictstyle handlingFelipe Contreras, May 10, 2023

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.