Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Aug 24, 2012
  1. @gitster

    mergetool: style fixes

    Junio C Hamano authored gitster committed
    This script is one of the sizeable ones that tempted people to copy
    its "neibouring style" in their new code, but was littered with
    styles incompatible with our style guide.
    
     - use one tab, not four spaces, per indent level;
    
     - long lines can be wrapped after '|', '&&', or '||' for
       readability.
    
     - structures like "if .. then .. else .. fi", "while .. do .. done"
       are split into lines in such a way that does not require
       unnecessary semicolon.
    
     - case, esac and case-arms align at the same column.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 23, 2012
  1. @gitster

    mergetool: support --tool-help option like difftool does

    gitster authored
    This way we do not have to risk the list of tools going out of sync
    between the implementation and the documentation.
    
    In the same spirit as bf73fc2 (difftool: print list of valid tools
    with '--tool-help', 2012-03-29), trim the list of merge backends in
    the documentation.  We do not want to have a complete list of valid
    tools; we only want a list to help people guess what kind of things
    the tools do to be specified there, and refer them to --tool-help
    for a complete list.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 23, 2012
  1. @davvid @gitster

    mergetool: Provide an empty file when needed

    davvid authored gitster committed
    Some merge tools cannot cope when $LOCAL, $BASE, or $REMOTE are missing.
    $BASE can be missing when two branches independently add the same
    filename.
    
    Provide an empty file to make these tools happy.
    
    When a delete/modify conflict occurs, $LOCAL and $REMOTE can also be
    missing. We have special case code to handle such case so this change
    may not affect that codepath, but try to be consistent and create an
    empty file for them anyway.
    
    Reported-by: Jason Wenger <jcwenger@gmail.com>
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 10, 2011
  1. @gitster

    Merge branch 'jm/mergetool-pathspec'

    gitster authored
    * jm/mergetool-pathspec:
      mergetool: no longer need to save standard input
      mergetool: Use args as pathspec to unmerged files
Commits on Sep 26, 2011
  1. @gitster

    mergetool: no longer need to save standard input

    gitster authored
    Earlier code wanted to run merge_file and prompt_after_failed_merge
    both of which wanted to read from the standard input of the entire
    script inside a while loop, which read from a pipe, and in order to
    do so, it redirected the original standard input to another file
    descriptor. We no longer need to do so after the previous change.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @jmah @gitster

    mergetool: Use args as pathspec to unmerged files

    jmah authored gitster committed
    Mergetool now treats its path arguments as a pathspec (like other git
    subcommands), restricting action to the given files and directories.
    Files matching the pathspec are filtered so mergetool only acts on
    unmerged paths; previously it would assume each path argument was in an
    unresolved state, and get confused when it couldn't check out their
    other stages.
    
    Running "git mergetool subdir" will prompt to resolve all conflicted
    blobs under subdir.
    
    Signed-off-by: Jonathon Mah <me@JonathonMah.com>
    Acked-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 20, 2011
  1. @jaysoffian @gitster

    git-mergetool: check return value from read

    jaysoffian authored gitster committed
    Mostly fixed already by 6b44577 (mergetool: check return value
    from read, 2011-07-01). Catch two uses it missed.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 1, 2011
  1. @gitster

    mergetool: check return value from read

    gitster authored
    The process may not even have the standard input open in which case it
    will get stuck in an infinite loop to prompt and read nothing.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 13, 2011
  1. @jmah @gitster

    mergetool: Teach about submodules

    jmah authored gitster committed
    When the index has conflicted submodules, mergetool used to mildly
    clobber the module, renaming it to mymodule.BACKUP.nnnn, then failing to
    copy it non-recursively.
    
    Recognize submodules and offer a resolution instead:
    
      Submodule merge conflict for 'Shared':
        {local}: submodule commit ad9f12e3e6205381bf2163a793d1e596a9e211d0
        {remote}: submodule commit f5893fb70ec5646efcd9aa643c5136753ac89253
      Use (l)ocal or (r)emote, or (a)bort?
    
    Selecting a commit will stage it, but not update the submodule (as git
    does had there been no conflict). Type changes are also supported,
    should the path be a submodule on one side, and a file, symlink,
    directory, or deleted on the other.
    
    Signed-off-by: Jonathon Mah <me@JonathonMah.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 16, 2011
  1. @gitster

    mergetool: don't skip modify/remove conflicts

    Martin von Zweigbergk authored gitster committed
    Since bb0a484 (mergetool: Skip autoresolved paths, 2010-08-17),
    mergetool uses different ways of figuring out the list of files with
    merge conflicts depending on whether rerere is active. If rerere is
    active, mergetool will use 'git rerere status' to list the files with
    remaining conflicts. However, the output from that command does not
    list conflicts of types that rerere does not handle, such as
    modify/remove conflicts.
    
    Another problem with solely relying on the output from 'git rerere
    status' is that, for new conflicts that are not yet known to rerere,
    the output from the command will list the files even after adding them
    to the index. This means that if the conflicts in some files have been
    resolved and 'git mergetool' is run again, it will ask the user
    something like the following for each of those files.
    
     file1: file does not need merging
     Continue merging other unresolved paths (y/n) ?
    
    Solve both of these problems by replacing the call to 'git rerere
    status' with a call to the new 'git rerere remaining' that was
    introduced in the previous commit.
    
    Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 3, 2010
  1. @gitster

    Merge branch 'cb/maint-mergetool-no-tty'

    gitster authored
    * cb/maint-mergetool-no-tty:
      mergetool: Remove explicit references to /dev/tty
    
    Conflicts:
    	git-mergetool.sh
Commits on Aug 20, 2010
  1. @hashpling @gitster

    mergetool: Remove explicit references to /dev/tty

    hashpling authored gitster committed
    mergetool used /dev/tty to switch back to receiving input from the user
    via inside a block with a redirected stdin.
    
    This harms testability, so change mergetool to save its original stdin
    to an alternative fd in this block and restore it for those sub-commands
    that need the original stdin.
    
    Includes additional compatibility fix from Jonathan Nieder.
    
    Tested-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 17, 2010
  1. @davvid @gitster

    mergetool: Skip autoresolved paths

    davvid authored gitster committed
    When mergetool is run without path limiters it loops
    over each entry in 'git ls-files -u'.  This includes
    autoresolved paths.
    
    Teach mergetool to only merge files listed in 'rerere status'
    when rerere is enabled.
    
    There are some subtle but harmless changes in behavior.
    We now call cd_to_toplevel when no paths are given.
    We do this because 'rerere status' paths are always relative
    to the root.  This is beneficial for the non-rerere use as
    well in that mergetool now runs against all unmerged files
    regardless of the current directory.
    
    This also slightly tweaks the output when run without paths
    to be more readable.
    
    The old output:
    
    Merging the files: foo
    bar
    baz
    
    The new output:
    
    Merging:
    foo
    bar
    baz
    
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 12, 2009
  1. @davvid @gitster

    mergetool--lib: simplify API usage by removing more global variables

    davvid authored gitster committed
    The mergetool--lib scriplet was tricky to use because it relied upon
    the existance of several global shell variables.  This removes more
    global variables so that things are simpler for callers.
    
    A side effect is that some variables are recomputed each time
    run_merge_tool() is called, but the overhead for recomputing
    them is justified by the simpler implementation.
    
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 11, 2009
  1. @fhuberts @gitster

    Fix misspelled mergetool.keepBackup

    fhuberts authored gitster committed
    In several places mergetool.keepBackup was misspelled as merge.keepBackup.
    
    Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 8, 2009
  1. @davvid @gitster

    difftool/mergetool: refactor commands to use git-mergetool--lib

    davvid authored gitster committed
    This consolidates the common functionality from git-mergetool and
    git-difftool--helper into a single git-mergetool--lib scriptlet.
    
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @davvid @gitster

    mergetool: use $( ... ) instead of `backticks`

    davvid authored gitster committed
    This makes mergetool consistent with Documentation/CodingGuidelines.
    
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @hartwork @gitster

    difftool/mergetool: add diffuse as merge and diff tool

    hartwork authored gitster committed
    This adds diffuse as a built-in merge tool.
    
    Signed-off-by: Sebastian Pipping <sebastian@pipping.org>
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @marcows @gitster

    git-mergetool: add new merge tool TortoiseMerge

    marcows authored gitster committed
    TortoiseMerge comes with TortoiseSVN or TortoiseGit for Windows. It can
    only be used as a merge tool with an existing base file. It cannot be
    used without a base nor as a diff tool.
    
    The documentation only mentions the slash '/' as command line option
    prefix, which refused to work, but the parser also accepts the dash '-'
    
    See http://code.google.com/p/msysgit/issues/detail?id=226
    
    Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  5. @marcows @gitster

    git-mergetool/difftool: make (g)vimdiff workable under Windows

    marcows authored gitster committed
    Under Windows vimdiff and gvimdiff are not available as symbolic links,
    but as batch files vimdiff.bat and gvimdiff.bat. These files weren't
    found by 'type vimdiff' which led to the following error:
    
        The merge tool vimdiff is not available as 'vimdiff'
    
    Even if they were found, it wouldn't work to invoke these batch files
    from git-mergetool.
    
    To solve this, use vim and gvim (vim.exe and gvim.exe) and pass the -d
    command line switch over to them.
    
    Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 6, 2009
  1. @gitster

    Merge branch 'cb/mergetool'

    gitster authored
    * cb/mergetool:
      mergetool: fix running mergetool in sub-directories
      mergetool: Add a test for running mergetool in a sub-directory
      mergetool: respect autocrlf by using checkout-index
Commits on Jan 31, 2009
  1. @hashpling @gitster

    mergetool: fix running mergetool in sub-directories

    hashpling authored gitster committed
    The previous fix to mergetool to use checkout-index instead of cat-file
    broke running mergetool anywhere except the root of the repository.
    
    This fixes it by using the correct relative paths for temporary files
    and index paths.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 27, 2009
  1. @hashpling @gitster

    mergetool: respect autocrlf by using checkout-index

    hashpling authored gitster committed
    Previously, git mergetool used cat-file which does not perform git to
    worktree conversion. This changes mergetool to use git checkout-index
    instead which means that the temporary files used for mergetool use the
    correct line endings for the platform.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @heipei @gitster

    mergetool: Don't repeat merge tool candidates

    heipei authored gitster committed
    git mergetool listed some candidates for mergetools twice, depending on
    the environment.
    
    This slightly changes the behavior when both KDE_FULL_SESSION and
    GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case
    meld is used in favor of kdiff3 (the old code favored kdiff3 in such a
    case), but it should not matter in practice.
    
    Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 18, 2009
  1. @marcows @gitster

    mergetool: put the cursor on the editable file for Vim

    marcows authored gitster committed
    When resolving conflicts, you only need to edit the $MERGED file. Put
    the cursor automatically into its window for vimdiff and gvimdiff to
    avoid doing <C-w>l every time.
    
    Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
    Tested-by: SZEDER Gábor <szeder@ira.uka.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 1, 2009
  1. @gitster

    Merge branch 'cb/mergetool'

    gitster authored
    * cb/mergetool:
      mergetool: Don't keep temporary merge files unless told to
      mergetool: Add prompt to continue after failing to merge a file
      Add -y/--no-prompt option to mergetool
      Fix some tab/space inconsistencies in git-mergetool.sh
Commits on Dec 20, 2008
  1. @davvid @gitster

    git-mergetool: properly handle "git mergetool -- filename"

    davvid authored gitster committed
    Like many git commands, git-mergetool allows "--" to signal
    the end of option processing.  This adds a missing "shift"
    statement so that this is correctly handled.
    
    Signed-off-by: David Aguilar <davvid@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Dec 13, 2008
  1. @hashpling @gitster

    mergetool: Don't keep temporary merge files unless told to

    hashpling authored gitster committed
    This changes git mergetool to remove the temporary files used to invoke
    the merge tool even if it returns non-zero.
    
    This also adds a configuration option (mergetool.keepTemporaries) to
    retain the previous behaviour if desired.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @hashpling @gitster

    mergetool: Add prompt to continue after failing to merge a file

    hashpling authored gitster committed
    This option stops git mergetool from aborting at the first failed merge.
    After a failed merge the user will be prompted to indicated whether he
    wishes to continue with attempting to merge subsequent paths or to
    abort.
    
    This allows some additional use patterns. Merge conflicts can now be
    previewed one at time and merges can also be skipped so that they can be
    performed in a later pass.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 15, 2008
  1. @hashpling @gitster

    Add -y/--no-prompt option to mergetool

    hashpling authored gitster committed
    This option lets git mergetool invoke the conflict resolution program
    without waiting for a user prompt each time.
    
    Also added a mergetool.prompt (default true) configuration variable
    controlling the same behaviour
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @hashpling @gitster

    Fix some tab/space inconsistencies in git-mergetool.sh

    hashpling authored gitster committed
    git-mergetool.sh mostly uses 8 space tabs and 4 spaces per indent. This
    change corrects this in a part of the file affect by a later commit in
    this patch series. diff -w considers this change is to be a null change.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 19, 2008
  1. @gitster

    Remove the use of '--' in merge program invocation

    Patrick Higgins authored gitster committed
    Put a "./" at the beginning of all paths given to the merge program so
    that filenames beginning with a '-' character don't get interpreted as
    options.
    
    This deals with a problem where kdiff3 can be compiled with or without
    support for the '--' separator between options and filenames.
    
    Signed-off-by: Patrick Higgins <patrick.higgins@cexp.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 11, 2008
  1. @gitster

    mergetool: Make ECMerge use the settings as specified by the user in …

    Sebastian Schuberth authored gitster committed
    …the GUI
    
    When run from the command line, ECMerge does not automatically use the same
    settings for a merge / diff that it would use when starting the GUI and loading
    files manually. In the first case the built-in factory defaults would be used,
    while in the second case the settings the user has specified in the GUI would
    be used, which can be misleading. Specifying the "--default" command line
    option changes this behavior so that always the user specfified GUI settings
    are used.
    
    Signed-off-by: Sebastian Schuberth <sschuberth@visageimaging.com>
    Tested-by: Steffen Prohaska <prohaska@zib.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 5, 2008
  1. @hashpling @gitster

    Teach git mergetool to use custom commands defined at config time

    hashpling authored gitster committed
    Currently git mergetool is restricted to a set of commands defined
    in the script. You can subvert the mergetool.<tool>.path to force
    git mergetool to use a different command, but if you have a command
    whose invocation syntax does not match one of the current tools then
    you would have to write a wrapper script for it.
    
    This patch adds two git config variable patterns which allow a more
    flexible choice of merge tool.
    
    If you run git mergetool with -t/--tool or the merge.tool config
    variable set to an unrecognized tool then git mergetool will query the
    mergetool.<tool>.cmd config variable. If this variable exists, then git
    mergetool will treat the specified tool as a custom command and will use
    a shell eval to run the command with the documented shell variables set.
    
    mergetool.<tool>.trustExitCode can be used to indicate that the exit
    code of the custom command can be used to determine the success of the
    merge.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @hashpling @gitster

    Changed an internal variable of mergetool to support custom commands

    hashpling authored gitster committed
    The variable $path changes to $MERGED so that it is more consistent
    with $BASE, $LOCAL and $REMOTE for future custom command lines.
    
    Signed-off-by: Charles Bailey <charles@hashpling.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.