[PATCH/RFC] updating examples/git-merge (plus a builtin/merge fix)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While preparing to make some minor "git merge" changes, I noticed that
the old merge script does not pass all tests any more.  Since it can
be easier to prototype in shell and then port to C, I think that is
worth fixing.

Of course this is not urgent at all.

Patch 1 fixes a minor bug that the scripted implementation does not
suffer from, illustrated by the test "merge early part of c2" from
t7600-merge.sh.

The underlying problem is a subtlety in the resolve_ref() API (from
v0.99.8~13, Use resolve_ref() to implement read_ref(), 2005-09-30):
the "reading" argument to resolve_ref() should usually be true, but
that is not obvious to newcomers.

Patches 2-7 are minor test changes.  They are early in the series
to give flexibility about when to merge them.

Patches 8-10 expose functionality used by merge when handling octopus
merges.  merge-base --octopus is get_octopus_merge_bases(), used to
provide basis arguments when running the "git merge-octopus" command.
Of course the latter does not care about its basis arguments, but
that is a topic for another series.  merge-base --independent is
reduce_refs(), used to reduce the parent list when --no-ff is not
in use.

These are analagous to show-branch --merge-base and
show-branch --independent but are slower and can be used with more
than 25 refs.

Patch 11 exposes the functionality from fmt-merge-msg needed to
implement merge --log -m.

Patches 12 and later are ports of various patches to builtin/merge.c.
I did the bare minimum to make tests pass. :)

Patches are against jn/merge-renormalize~2 (rerere: migrate to
parse-options API) from pu, because without that,
"rerere --rerere-autoupdate" does not work.

Thoughts?

Jonathan Nieder (24):
  merge: do not mistake (ancestor of) tag for branch
  t7600 (merge): modernize style
  t7600 (merge): do not launch gitk for --debug
  t7600 (merge): check reflog entry
  t7600 (merge): test merge from branch yet to be born
  t6010 (merge-base): modernize style
  t6200 (fmt-merge-msg): style nitpicks
  Documentation: add a SEE ALSO section for merge-base
  merge-base --octopus to mimic show-branch --merge-base
  merge-base --independent to print reduced parent list in a merge
  fmt-merge-msg -m to replace subject line
  merge script: --squash, --ff from unborn branch are errors
  merge script: tweak unmerged files message to match builtin
  merge script: refuse to merge during merge
  merge script: improve log message subject
  merge script: merge -X<option>
  merge script: allow custom strategies
  merge script: forbid merge -s index
  merge script: handle -m --log correctly
  merge script: handle many-way octopus
  merge script: --ff-only to disallow true merge
  merge script: handle --no-ff --no-commit correctly
  merge script: notice @{-1} shorthand
  merge script: learn --[no-]rerere-autoupdate

 Documentation/git-fmt-merge-msg.txt |    9 +-
 Documentation/git-merge-base.txt    |   34 +++-
 builtin/fmt-merge-msg.c             |   18 ++-
 builtin/merge-base.c                |   44 ++++-
 builtin/merge.c                     |    2 +-
 contrib/examples/git-merge.sh       |  115 ++++++++---
 t/t6010-merge-base.sh               |  358 +++++++++++++++++++--------------
 t/t6200-fmt-merge-msg.sh            |  306 ++++++++++++++--------------
 t/t7600-merge.sh                    |  385 +++++++++++++++--------------------
 9 files changed, 705 insertions(+), 566 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]