Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Sep 15, 2012
  1. @gitster

    Merge branch 'jc/ll-merge-binary-ours'

    gitster authored
    "git merge -Xtheirs" did not help content-level merge of binary
    files; it should just take their version.  Also "*.jpg binary" in
    the attributes did not imply they should use the binary ll-merge
    driver.
    
    * jc/ll-merge-binary-ours:
      ll-merge: warn about inability to merge binary files only when we can't
      attr: "binary" attribute should choose built-in "binary" merge driver
      merge: teach -Xours/-Xtheirs to binary ll-merge driver
Commits on Sep 12, 2012
  1. @gitster

    ll-merge: warn about inability to merge binary files only when we can't

    gitster authored
    When a path being merged is auto detected to be a binary file, we
    warned "Cannot merge binary files" before switching to activate the
    binary ll-merge driver.  When we are merging with the -Xours/theirs
    option, however, we know what the "clean" merge result is, and the
    warning is inappropriate.
    
    In addition, when the path is explicitly marked as a binary file,
    this warning was not issued, even though without -Xours/theirs, we
    cannot cleanly automerge such a path, which was inconsistent.
    
    Move the warning code from ll_xdl_merge() to ll_binary_merge(), and
    issue the message only when we cannot cleanly automerge.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 9, 2012
  1. @gitster

    merge: teach -Xours/-Xtheirs to binary ll-merge driver

    gitster authored
    The (discouraged) -Xours/-Xtheirs modes of merge are supposed to
    give a quick and dirty way to come up with a random mixture of
    cleanly merged parts and punted conflict resolution to take contents
    from one side in conflicting parts.  These options however were only
    passed down to the low level merge driver for text.
    
    Teach the built-in binary merge driver to notice them as well.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 30, 2012
  1. @gitster

    remove superfluous newlines in error messages

    Pete Wyckoff authored gitster committed
    The error handling routines add a newline.  Remove
    the duplicate ones in error messages.
    
    Signed-off-by: Pete Wyckoff <pw@padd.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 4, 2011
  1. @mhagger @gitster

    Rename git_checkattr() to git_check_attr()

    mhagger authored gitster committed
    Suggested by: Junio Hamano <gitster@pobox.com>
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 16, 2011
  1. @jrn @gitster

    ll-merge: simplify opts == NULL case

    jrn authored gitster committed
    As long as sizeof(struct ll_merge_options) is small, there is not
    much reason not to keep a copy of the default merge options in the BSS
    section.  In return, we get clearer code and one less stack frame in
    the opts == NULL case.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 26, 2010
  1. @gitster

    merge-recursive --patience

    Justin Frankel authored gitster committed
    Teach the merge-recursive strategy a --patience option to use the
    "patience diff" algorithm, which tends to improve results when
    cherry-picking a patch that reorders functions at the same time as
    refactoring them.
    
    To support this, struct merge_options and ll_merge_options gain an
    xdl_opts member, so programs can use arbitrary xdiff flags (think
    "XDF_IGNORE_WHITESPACE") in a git-aware merge.
    
    git merge and git rebase can be passed the -Xpatience option to
    use this.
    
    [jn: split from --ignore-space patch; with documentation]
    
    Signed-off-by: Justin Frankel <justin@cockos.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jrn @gitster

    ll-merge: replace flag argument with options struct

    jrn authored gitster committed
    Keeping track of the flag bits is proving more trouble than it's
    worth.  Instead, use a pointer to an options struct like most similar
    APIs do.
    
    Callers with no special requests can pass NULL to request the default
    options.
    
    Cc: Bert Wesarg <bert.wesarg@googlemail.com>
    Cc: Avery Pennarun <apenwarr@gmail.com>
    Helped-by: Justin Frankel <justin@cockos.com>
    Helped-by: Bert Wesarg <bert.wesarg@googlemail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 6, 2010
  1. @jrn @gitster

    ll-merge: let caller decide whether to renormalize

    jrn authored gitster committed
    Add a “renormalize” bit to the ll-merge options word so callers can
    decide on a case-by-case basis whether the merge is likely to have
    overlapped with a change in smudge/clean rules.
    
    This reveals a few commands that have not been taking that situation
    into account, though it does not fix them.
    
    No functional change intended.
    
    Cc: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
    Improved-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jrn @gitster

    ll-merge: make flag easier to populate

    jrn authored gitster committed
    ll_merge() takes its options in a flag word, which has a few
    advantages:
    
     - options flags can be cheaply passed around in registers, while
       an option struct passed by pointer cannot;
    
     - callers can easily pass 0 without trouble for no options,
       while an option struct passed by value would not allow that.
    
    The downside is that code to populate and access the flag word can be
    somewhat opaque.  Mitigate that with a few macros.
    
    Cc: Avery Pennarun <apenwarr@gmail.com>
    Cc: Bert Wesarg <bert.wesarg@googlemail.com>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 2, 2010
  1. @eyvind @gitster

    Avoid conflicts when merging branches with mixed normalization

    eyvind authored gitster committed
    Currently, merging across changes in line ending normalization is
    painful since files containing CRLF will conflict with normalized files,
    even if the only difference between the two versions is the line
    endings.  Additionally, any "real" merge conflicts that exist are
    obscured because every line in the file has a conflict.
    
    Assume you start out with a repo that has a lot of text files with CRLF
    checked in (A):
    
          o---C
         /     \
        A---B---D
    
    B: Add "* text=auto" to .gitattributes and normalize all files to
       LF-only
    
    C: Modify some of the text files
    
    D: Try to merge C
    
    You will get a ridiculous number of LF/CRLF conflicts when trying to
    merge C into D, since the repository contents for C are "wrong" wrt the
    new .gitattributes file.
    
    Fix ll-merge so that the "base", "theirs" and "ours" stages are passed
    through convert_to_worktree() and convert_to_git() before a three-way
    merge.  This ensures that all three stages are normalized in the same
    way, removing from consideration differences that are only due to
    normalization.
    
    This feature is optional for now since it changes a low-level mechanism
    and is not necessary for the majority of users.  The "merge.renormalize"
    config variable enables it.
    
    Signed-off-by: Eyvind Bernhardsen <eyvind.bernhardsen@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 31, 2010
  1. @gitster

    Rewrite dynamic structure initializations to runtime assignment

    Gary V. Vaughan authored gitster committed
    Unfortunately, there are still plenty of production systems with
    vendor compilers that choke unless all compound declarations can be
    determined statically at compile time, for example hpux10.20 (I can
    provide a comprehensive list of our supported platforms that exhibit
    this problem if necessary).
    
    This patch simply breaks apart any compound declarations with dynamic
    initialisation expressions, and moves the initialisation until after
    the last declaration in the same block, in all the places necessary to
    have the offending compilers accept the code.
    
    Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 21, 2010
  1. @jrn @gitster

    ll_merge(): add ancestor label parameter for diff3-style output

    jrn authored gitster committed
    Commands using the ll_merge() function will present conflict hunks
    imitating ‘diff3 -m’ output if the merge.conflictstyle configuration
    option is set appropriately.  Unlike ‘diff3 -m’, the output does not
    include a label for the merge base on the ||||||| line of the output,
    and some tools misparse the conflict hunks without that.
    
    Add a new ancestor_label parameter to ll_merge() to give callers the
    power to rectify this situation.  If ancestor_label is NULL, the output
    format is unchanged.  All callers pass NULL for now.
    
    Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jrn @gitster

    xdl_merge(): move file1 and file2 labels to xmparam structure

    jrn authored gitster committed
    The labels for the three participants in a potential conflict are all
    optional arguments for the xdiff merge routine; if they are NULL, then
    xdl_merge() can cope by omitting the labels from its output.  Move
    them to the xmparam structure to allow new callers to save some
    keystrokes where they are not needed.
    
    This also has the virtue of making the xdiff merge interface more
    similar to merge_trees, which might make it easier to learn.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 2, 2010
  1. @bertwesarg @gitster

    refactor merge flags into xmparam_t

    bertwesarg authored gitster committed
    Include the merge level, favor, and style flags into the xmparam_t struct.
    This removes the bit twiddling with these three values into the one flags
    parameter.
    
    Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @bertwesarg @gitster

    make union merge an xdl merge favor

    bertwesarg authored gitster committed
    The current union merge driver is implemented as an post process.  But the
    xdl_merge code is quite capable to produce the result by itself.  Therefore
    move it there.
    
    Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 21, 2010
  1. @gitster

    Merge branch 'jc/conflict-marker-size'

    gitster authored
    * jc/conflict-marker-size:
      rerere: honor conflict-marker-size attribute
      rerere: prepare for customizable conflict marker length
      conflict-marker-size: new attribute
      rerere: use ll_merge() instead of using xdl_merge()
      merge-tree: use ll_merge() not xdl_merge()
      xdl_merge(): allow passing down marker_size in xmparam_t
      xdl_merge(): introduce xmparam_t for merge specific parameters
      git_attr(): fix function signature
    
    Conflicts:
    	builtin-merge-file.c
    	ll-merge.c
    	xdiff/xdiff.h
    	xdiff/xmerge.c
  2. @gitster

    Merge branch 'ap/merge-backend-opts'

    gitster authored
    * ap/merge-backend-opts:
      Document that merge strategies can now take their own options
      Extend merge-subtree tests to test -Xsubtree=dir.
      Make "subtree" part more orthogonal to the rest of merge-recursive.
      pull: Fix parsing of -X<option>
      Teach git-pull to pass -X<option> to git-merge
      git merge -X<option>
      git-merge-file --ours, --theirs
    
    Conflicts:
    	git-compat-util.h
Commits on Jan 18, 2010
  1. @apenwarr @gitster

    git merge -X<option>

    apenwarr authored gitster committed
    Teach "-X <option>" command line argument to "git merge" that is passed to
    strategy implementations.  "ours" and "theirs" autoresolution introduced
    by the previous commit can be asked to the recursive strategy.
    
    Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 17, 2010
  1. @gitster

    rerere: honor conflict-marker-size attribute

    gitster authored
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    conflict-marker-size: new attribute

    gitster authored
    This can be specified to set the length of the conflict marker (usually 7)
    to a non-default value per path.  Only the callers of ll_merge() that are
    aware of the per-path attributes are modified.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    xdl_merge(): introduce xmparam_t for merge specific parameters

    gitster authored
    So far we have only needed to be able to pass an option that is generic to
    xdiff family of functions to this function.  Extend the interface so that
    we can give it merge specific parameters.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @gitster

    git_attr(): fix function signature

    gitster authored
    The function took (name, namelen) as its arguments, but all the public
    callers wanted to pass a full string.
    
    Demote the counted-string interface to an internal API status, and allow
    public callers to just pass the string to the function.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 6, 2010
  1. @peff @gitster

    run-command: convert simple callsites to use_shell

    peff authored gitster committed
    Now that we have the use_shell feature, these callsites can
    all be converted with small changes.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 11, 2009
  1. @gitster

    Merge branch 'js/run-command-updates'

    gitster authored
    * js/run-command-updates:
      api-run-command.txt: describe error behavior of run_command functions
      run-command.c: squelch a "use before assignment" warning
      receive-pack: remove unnecessary run_status report
      run_command: report failure to execute the program, but optionally don't
      run_command: encode deadly signal number in the return value
      run_command: report system call errors instead of returning error codes
      run_command: return exit code as positive value
      MinGW: simplify waitpid() emulation macros
Commits on Jul 6, 2009
  1. @gitster

    Merge branch 'tr/die_errno'

    gitster authored
    * tr/die_errno:
      Use die_errno() instead of die() when checking syscalls
      Convert existing die(..., strerror(errno)) to die_errno()
      die_errno(): double % in strerror() output just in case
      Introduce die_errno() that appends strerror(errno) to die()
Commits on Jul 5, 2009
  1. @gitster

    run_command: return exit code as positive value

    Johannes Sixt authored gitster committed
    As a general guideline, functions in git's code return zero to indicate
    success and negative values to indicate failure. The run_command family of
    functions followed this guideline. But there are actually two different
    kinds of failure:
    
    - failures of system calls;
    
    - non-zero exit code of the program that was run.
    
    Usually, a non-zero exit code of the program is a failure and means a
    failure to the caller. Except that sometimes it does not. For example, the
    exit code of merge programs (e.g. external merge drivers) conveys
    information about how the merge failed, and not all exit calls are
    actually failures.
    
    Furthermore, the return value of run_command is sometimes used as exit
    code by the caller.
    
    This change arranges that the exit code of the program is returned as a
    positive value, which can now be regarded as the "result" of the function.
    System call failures continue to be reported as negative values.
    
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 2, 2009
  1. @martinxyz @gitster

    Remove filename from conflict markers

    martinxyz authored gitster committed
    Put filenames into the conflict markers only when they are different.
    Otherwise they are redundant information clutter.
    
    Print the filename explicitely when warning about a binary conflict.
    
    Signed-off-by: Martin Renold <martinxyz@gmx.ch>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 27, 2009
  1. @trast @gitster

    Use die_errno() instead of die() when checking syscalls

    trast authored gitster committed
    Lots of die() calls did not actually report the kind of error, which
    can leave the user confused as to the real problem.  Use die_errno()
    where we check a system/library call that sets errno on failure, or
    one of the following that wrap such calls:
    
      Function              Passes on error from
      --------              --------------------
      odb_pack_keep         open
      read_ancestry         fopen
      read_in_full          xread
      strbuf_read           xread
      strbuf_read_file      open or strbuf_read_file
      strbuf_readlink       readlink
      write_in_full         xwrite
    
    Signed-off-by: Thomas Rast <trast@student.ethz.ch>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 21, 2009
  1. @gitster

    Merge branch 'sb/maint-1.6.0-add-config-fix'

    gitster authored
    * sb/maint-1.6.0-add-config-fix:
      add: allow configurations to be overriden by command line
      use xstrdup, not strdup in ll-merge.c
    
    Conflicts:
    	builtin-add.c
Commits on Jun 14, 2009
  1. @meyering @gitster

    use xstrdup, not strdup in ll-merge.c

    meyering authored gitster committed
    Otherwise, a fluky allocation failure would cause merge
    configuration settings to be silently ignored.
    
    Signed-off-by: Jim Meyering <meyering@redhat.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 9, 2009
  1. @gitster

    Simplify some instances of run_command() by using run_command_v_opt().

    Johannes Sixt authored gitster committed
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 30, 2009
  1. @raalkml @gitster

    replace direct calls to unlink(2) with unlink_or_warn

    raalkml authored gitster committed
    This helps to notice when something's going wrong, especially on
    systems which lock open files.
    
    I used the following criteria when selecting the code for replacement:
    - it was already printing a warning for the unlink failures
    - it is in a function which already printing something or is
      called from such a function
    - it is in a static function, returning void and the function is only
      called from a builtin main function (cmd_)
    - it is in a function which handles emergency exit (signal handlers)
    - it is in a function which is obvously cleaning up the lockfiles
    
    Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 24, 2008
  1. @gitster

    merge-recursive: use strbuf_expand() instead of interpolate()

    René Scharfe authored gitster committed
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 31, 2008
  1. @gitster

    git-merge-recursive: learn to honor merge.conflictstyle

    gitster authored
    This teaches the low-level ll_xdl_merge() routine to honor
    merge.conflictstyle configuration variable, so that merge-recursive
    strategy can show the conflicts in the style of user's choice.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.