Code

Merge branch 'cb/ignored-paths-are-precious' into pu
authorJunio C Hamano <gitster@pobox.com>
Mon, 31 Jan 2011 03:03:19 +0000 (19:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 31 Jan 2011 03:03:19 +0000 (19:03 -0800)
* cb/ignored-paths-are-precious:
  checkout/merge: optionally fail operation when ignored files need to be overwritten

Conflicts:
Documentation/config.txt
builtin/checkout.c

1  2 
Documentation/config.txt
builtin/checkout.c
builtin/merge.c
cache.h
config.c
environment.c

index c5e183516a104e6efb7ed597fb4498d75560ab68,fdaa586f08b60758aafca7d8b01ab6cd979dd039..312293799d3731f488547b7904398b2bb16de81d
@@@ -461,21 -450,13 +461,28 @@@ core.excludesfile:
        to the value of `$HOME` and "{tilde}user/" to the specified user's
        home directory.  See linkgit:gitignore[5].
  
 +core.askpass::
 +      Some commands (e.g. svn and http interfaces) that interactively
 +      ask for a password can be told to use an external program given
 +      via the value of this variable. Can be overridden by the 'GIT_ASKPASS'
 +      environment variable. If not set, fall back to the value of the
 +      'SSH_ASKPASS' environment variable or, failing that, a simple password
 +      prompt. The external program shall be given a suitable prompt as
 +      command line argument and write the password on its STDOUT.
 +
 +core.attributesfile::
 +      In addition to '.gitattributes' (per-directory) and
 +      '.git/info/attributes', git looks into this file for attributes
 +      (see linkgit:gitattributes[5]). Path expansions are made the same
 +      way as for `core.excludesfile`.
 +
+ core.ignoredareprecious::
+       By default ignored (i.e. trashable) untracked files are
+       automatically removed from the working tree when they get in
+       the way of merge or switching between branches.  This option
+       declares that such files are precious instead, and prevents
+       merges and checkouts from succeeding.
  core.editor::
        Commands such as `commit` and `tag` that lets you edit
        messages by launching an editor uses the value of this
index d3cfaf0f45cea2c27dd8d7caf47ac43cd499c79e,cb83e6a6318b8b723a3ab9d97eac1556e2aa1d9b..0ca8f6a2061b177410136fb89b988806a05eb16e
@@@ -691,16 -670,18 +693,18 @@@ int cmd_checkout(int argc, const char *
                           "create and checkout a new branch"),
                OPT_STRING('B', NULL, &opts.new_branch_force, "branch",
                           "create/reset and checkout a branch"),
 -              OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "log for new branch"),
 -              OPT_SET_INT('t', "track",  &opts.track, "track",
 +              OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "create reflog for new branch"),
 +              OPT_SET_INT('t', "track",  &opts.track, "set upstream info for new branch",
                        BRANCH_TRACK_EXPLICIT),
                OPT_STRING(0, "orphan", &opts.new_orphan_branch, "new branch", "new unparented branch"),
 -              OPT_SET_INT('2', "ours", &opts.writeout_stage, "stage",
 +              OPT_SET_INT('2', "ours", &opts.writeout_stage, "checkout our version for unmerged files",
                            2),
 -              OPT_SET_INT('3', "theirs", &opts.writeout_stage, "stage",
 +              OPT_SET_INT('3', "theirs", &opts.writeout_stage, "checkout their version for unmerged files",
                            3),
 -              OPT_BOOLEAN('f', "force", &opts.force, "force"),
 +              OPT__FORCE(&opts.force, "force checkout (throw away local modifications)"),
+               OPT_BOOLEAN('i', "ignored-are-precious", &ignored_are_precious,
+                 "fail when an ignored file needs to be overwritten"),
 -              OPT_BOOLEAN('m', "merge", &opts.merge, "merge"),
 +              OPT_BOOLEAN('m', "merge", &opts.merge, "perform a 3-way merge with the new branch"),
                OPT_STRING(0, "conflict", &conflict_style, "style",
                           "conflict style (merge or diff3)"),
                OPT_BOOLEAN('p', "patch", &patch_mode, "select hunks interactively"),
diff --cc builtin/merge.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc config.c
Simple merge
diff --cc environment.c
Simple merge