Merge branch 'es/worktree-add-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Aug 2015 21:09:56 +0000 (14:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Aug 2015 21:09:56 +0000 (14:09 -0700)
The "new-worktree-mode" hack in "checkout" that was added in
nd/multiple-work-trees topic has been removed by updating the
implementation of new "worktree add".

* es/worktree-add-cleanup: (25 commits)
Documentation/git-worktree: fix duplicated 'from'
Documentation/config: mention "now" and "never" for 'expire' settings
Documentation/git-worktree: fix broken 'linkgit' invocation
checkout: drop intimate knowledge of newly created worktree
worktree: populate via "git reset --hard" rather than "git checkout"
worktree: avoid resolving HEAD unnecessarily
worktree: make setup of new HEAD distinct from worktree population
worktree: detect branch-name/detached and error conditions locally
worktree: add_worktree: construct worktree-population command locally
worktree: elucidate environment variables intended for child processes
worktree: make branch creation distinct from worktree population
worktree: add: suppress auto-vivication with --detach and no <branch>
worktree: make --detach mutually exclusive with -b/-B
worktree: introduce options container
worktree: simplify new branch (-b/-B) option checking
worktree: improve worktree setup message
branch: publish die_if_checked_out()
checkout: teach check_linked_checkout() about symbolic link HEAD
checkout: check_linked_checkout: simplify symref parsing
checkout: check_linked_checkout: improve "already checked out" aesthetic
...

1  2 
Documentation/config.txt
branch.c
builtin/checkout.c
builtin/worktree.c
index 1a8a399dd36f46d54d182b02187a35a87b2de52c,e09ee02df87359cdb92f8e2b3a6cabbce5456148..016f6e9f952fc4aee60bd77565164b20344be89f
@@@ -1304,31 -1223,37 +1304,37 @@@ gc.packRefs:
        to enable it within all non-bare repos or it can be set to a
        boolean value.  The default is `true`.
  
 -gc.pruneexpire::
 +gc.pruneExpire::
        When 'git gc' is run, it will call 'prune --expire 2.weeks.ago'.
        Override the grace period with this config variable.  The value
-       "now" may be used to disable this  grace period and always prune
-       unreachable objects immediately.
+       "now" may be used to disable this grace period and always prune
+       unreachable objects immediately, or "never" may be used to
+       suppress pruning.
  
  gc.worktreePruneExpire::
        When 'git gc' is run, it calls
        'git worktree prune --expire 3.months.ago'.
        This config variable can be used to set a different grace
        period. The value "now" may be used to disable the grace
-       period and prune $GIT_DIR/worktrees immediately.
+       period and prune $GIT_DIR/worktrees immediately, or "never"
+       may be used to suppress pruning.
  
 -gc.reflogexpire::
 -gc.<pattern>.reflogexpire::
 +gc.reflogExpire::
 +gc.<pattern>.reflogExpire::
        'git reflog expire' removes reflog entries older than
-       this time; defaults to 90 days.  With "<pattern>" (e.g.
+       this time; defaults to 90 days. The value "now" expires all
+       entries immediately, and "never" suppresses expiration
+       altogether. With "<pattern>" (e.g.
        "refs/stash") in the middle the setting applies only to
        the refs that match the <pattern>.
  
 -gc.reflogexpireunreachable::
 -gc.<ref>.reflogexpireunreachable::
 +gc.reflogExpireUnreachable::
 +gc.<ref>.reflogExpireUnreachable::
        'git reflog expire' removes reflog entries older than
        this time and are not reachable from the current tip;
-       defaults to 30 days.  With "<pattern>" (e.g. "refs/stash")
+       defaults to 30 days. The value "now" expires all entries
+       immediately, and "never" suppresses expiration altogether.
+       With "<pattern>" (e.g. "refs/stash")
        in the middle, the setting applies only to the refs that
        match the <pattern>.
  
diff --cc branch.c
Simple merge
Simple merge
index 6a264ee749221cd6c6bf98ce68790bdec3dd82c5,5d9371cf950cc1cc2201fe2aefc6d7111264eb27..430b51e7a74bb28ac1532ac836e9770121977096
@@@ -3,9 -3,10 +3,11 @@@
  #include "dir.h"
  #include "parse-options.h"
  #include "argv-array.h"
+ #include "branch.h"
+ #include "refs.h"
  #include "run-command.h"
  #include "sigchain.h"
 +#include "refs.h"
  
  static const char * const worktree_usage[] = {
        N_("git worktree add [<options>] <path> <branch>"),