Merge branch 'jc/clean-config'
authorJunio C Hamano <gitster@pobox.com>
Thu, 8 Nov 2007 02:19:38 +0000 (18:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Nov 2007 02:19:38 +0000 (18:19 -0800)
* jc/clean-config:
clean: require -f to do damage by default

1  2 
Documentation/config.txt
t/t7300-clean.sh
diff --combined Documentation/config.txt
index 0df004ea261d6862db0a9b528ec7f2c11bdd5b65,aeb7961adefeb098f4a468bb560dcc95be9abd0a..8d5d2005806289b7da9290fd0c40f12016d5ef53
@@@ -188,7 -188,7 +188,7 @@@ core.worktree:
        Set the path to the working tree.  The value will not be
        used in combination with repositories found automatically in
        a .git directory (i.e. $GIT_DIR is not set).
 -      This can be overriden by the GIT_WORK_TREE environment
 +      This can be overridden by the GIT_WORK_TREE environment
        variable and the '--work-tree' command line option.
  
  core.logAllRefUpdates::
@@@ -324,11 -324,10 +324,11 @@@ branch.<name>.remote:
        If this option is not given, `git fetch` defaults to remote "origin".
  
  branch.<name>.merge::
 -      When in branch <name>, it tells `git fetch` the default refspec to
 -      be marked for merging in FETCH_HEAD. The value has exactly to match
 -      a remote part of one of the refspecs which are fetched from the remote
 -      given by "branch.<name>.remote".
 +      When in branch <name>, it tells `git fetch` the default
 +      refspec to be marked for merging in FETCH_HEAD. The value is
 +      handled like the remote part of a refspec, and must match a
 +      ref which is fetched from the remote given by
 +      "branch.<name>.remote".
        The merge information is used by `git pull` (which at first calls
        `git fetch`) to lookup the default branch for merging. Without
        this option, `git pull` defaults to merge the first refspec fetched.
        branch.<name>.merge to the desired branch, and use the special setting
        `.` (a period) for branch.<name>.remote.
  
 +branch.<name>.mergeoptions::
 +      Sets default options for merging into branch <name>. The syntax and
 +      supported options are equal to that of gitlink:git-merge[1], but
 +      option values containing whitespace characters are currently not
 +      supported.
 +
  clean.requireForce::
-       A boolean to make git-clean do nothing unless given -f or -n.  Defaults
-       to false.
+       A boolean to make git-clean do nothing unless given -f
+       or -n.   Defaults to true.
  
  color.branch::
        A boolean to enable/disable color in the output of
@@@ -446,19 -439,6 +446,19 @@@ gc.aggressiveWindow:
        algorithm used by 'git gc --aggressive'.  This defaults
        to 10.
  
 +gc.auto::
 +      When there are approximately more than this many loose
 +      objects in the repository, `git gc --auto` will pack them.
 +      Some Porcelain commands use this command to perform a
 +      light-weight garbage collection from time to time.  Setting
 +      this to 0 disables it.
 +
 +gc.autopacklimit::
 +      When there are more than this many packs that are not
 +      marked with `*.keep` file in the repository, `git gc
 +      --auto` consolidates them into one larger pack.  Setting
 +      this to 0 disables this.
 +
  gc.packrefs::
        `git gc` does not run `git pack-refs` in a bare repository by
        default so that older dumb-transport clients can still fetch
@@@ -608,7 -588,7 +608,7 @@@ merge.verbosity:
        message if conflicts were detected. Level 1 outputs only
        conflicts, 2 outputs conflicts and file changes.  Level 5 and
        above outputs debugging information.  The default is level 2.
 -      Can be overriden by 'GIT_MERGE_VERBOSITY' environment variable.
 +      Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
  
  merge.<driver>.name::
        Defines a human readable name for a custom low-level
@@@ -650,26 -630,9 +650,26 @@@ pack.deltaCacheSize:
        A value of 0 means no limit. Defaults to 0.
  
  pack.deltaCacheLimit::
 -      The maxium size of a delta, that is cached in
 +      The maximum size of a delta, that is cached in
        gitlink:git-pack-objects[1]. Defaults to 1000.
  
 +pack.threads::
 +      Specifies the number of threads to spawn when searching for best
 +      delta matches.  This requires that gitlink:git-pack-objects[1]
 +      be compiled with pthreads otherwise this option is ignored with a
 +      warning. This is meant to reduce packing time on multiprocessor
 +      machines. The required amount of memory for the delta search window
 +      is however multiplied by the number of threads.
 +
 +pack.indexVersion::
 +      Specify the default pack index version.  Valid values are 1 for
 +      legacy pack index used by Git versions prior to 1.5.2, and 2 for
 +      the new pack index with capabilities for packs larger than 4 GB
 +      as well as proper protection against the repacking of corrupted
 +      packs.  Version 2 is selected and this config option ignored
 +      whenever the corresponding pack is larger than 2 GB.  Otherwise
 +      the default is 1.
 +
  pull.octopus::
        The default merge strategy to use when pulling multiple branches
        at once.
diff --combined t/t7300-clean.sh
index 23274361877e6d09eec51793cf6c2253541622f8,8697213e6b63fcaaaf2d91b7a3dc1b4e34f825ee..25d3102dedd31f43bfaabd1ae05fdebbc51863f8
@@@ -7,6 -7,8 +7,8 @@@ test_description='git-clean basic tests
  
  . ./test-lib.sh
  
+ git config clean.requireForce no
  test_expect_success 'setup' '
  
        mkdir -p src &&
@@@ -37,93 -39,6 +39,93 @@@ test_expect_success 'git-clean' 
  
  '
  
 +test_expect_success 'git-clean src/' '
 +
 +      mkdir -p build docs &&
 +      touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
 +      git-clean src/ &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test -f a.out &&
 +      test ! -f src/part3.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +
 +test_expect_success 'git-clean src/ src/' '
 +
 +      mkdir -p build docs &&
 +      touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
 +      git-clean src/ src/ &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test -f a.out &&
 +      test ! -f src/part3.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +
 +test_expect_success 'git-clean with prefix' '
 +
 +      mkdir -p build docs &&
 +      touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
 +      (cd src/ && git-clean) &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test -f a.out &&
 +      test ! -f src/part3.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +test_expect_success 'git-clean -d with prefix and path' '
 +
 +      mkdir -p build docs src/feature &&
 +      touch a.out src/part3.c src/feature/file.c docs/manual.txt obj.o build/lib.so &&
 +      (cd src/ && git-clean -d feature/) &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test -f a.out &&
 +      test -f src/part3.c &&
 +      test ! -f src/feature/file.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +
 +test_expect_success 'git-clean symbolic link' '
 +
 +      mkdir -p build docs &&
 +      touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
 +      ln -s docs/manual.txt src/part4.c
 +      git-clean &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test ! -f a.out &&
 +      test ! -f src/part3.c &&
 +      test ! -f src/part4.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +
  test_expect_success 'git-clean -n' '
  
        mkdir -p build docs &&
@@@ -158,24 -73,6 +160,24 @@@ test_expect_success 'git-clean -d' 
  
  '
  
 +test_expect_success 'git-clean -d src/ examples/' '
 +
 +      mkdir -p build docs examples &&
 +      touch a.out src/part3.c docs/manual.txt obj.o build/lib.so examples/1.c &&
 +      git-clean -d src/ examples/ &&
 +      test -f Makefile &&
 +      test -f README &&
 +      test -f src/part1.c &&
 +      test -f src/part2.c &&
 +      test -f a.out &&
 +      test ! -f src/part3.c &&
 +      test ! -f examples/1.c &&
 +      test -f docs/manual.txt &&
 +      test -f obj.o &&
 +      test -f build/lib.so
 +
 +'
 +
  test_expect_success 'git-clean -x' '
  
        mkdir -p build docs &&
@@@ -244,6 -141,13 +246,13 @@@ test_expect_success 'git-clean -d -X' 
  
  '
  
+ test_expect_success 'clean.requireForce defaults to true' '
+       git config --unset clean.requireForce &&
+       ! git-clean
+ '
  test_expect_success 'clean.requireForce' '
  
        git config clean.requireForce true &&