@matheusbsbs / matheus-bagliano / commits / 5c94f87e6b
Fork 0

use 'init' instead of 'init-db' for shipped docs and tools

While 'init-db' still is and probably will always remain a valid git command for obvious backward compatibility reasons, it would be a good idea to move shipped tools and docs to using 'init' instead. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>

Nicolas Pitre committed Jan 12, 2007 at 16:01 UTC 5c94f87e6b17cab5d3b87998d6c907745cb6f5a4
29 files changed +42 -45
Documentation/config.txt
+1 -1
@@ -100,7 +100,7 @@ core.sharedRepository::
100 group-writable). When 'all' (or 'world' or 'everybody'), the
101 repository will be readable by all users, additionally to being
102 group-shareable. When 'umask' (or 'false'), git will use permissions
103 - reported by umask(2). See gitlink:git-init-db[1]. False by default.
103 + reported by umask(2). See gitlink:git-init[1]. False by default.
104
105 core.warnAmbiguousRefs::
106 If true, git will warn you if the ref name you passed it is ambiguous
Documentation/core-tutorial.txt
+5 -5
@@ -46,12 +46,12 @@ to import into git.
46 For our first example, we're going to start a totally new repository from
47 scratch, with no pre-existing files, and we'll call it `git-tutorial`.
48 To start up, create a subdirectory for it, change into that
49 -subdirectory, and initialize the git infrastructure with `git-init-db`:
49 +subdirectory, and initialize the git infrastructure with `git-init`:
50
51 ------------------------------------------------
52 $ mkdir git-tutorial
53 $ cd git-tutorial
54 -$ git-init-db
54 +$ git-init
55 ------------------------------------------------
56
57 to which git will reply
@@ -1371,11 +1371,11 @@ $ mkdir my-git.git
1371 ------------
1372
1373 Then, make that directory into a git repository by running
1374 -`git init-db`, but this time, since its name is not the usual
1374 +`git init`, but this time, since its name is not the usual
1375 `.git`, we do things slightly differently:
1376
1377 ------------
1378 -$ GIT_DIR=my-git.git git-init-db
1378 +$ GIT_DIR=my-git.git git-init
1379 ------------
1380
1381 Make sure this directory is available for others you want your
@@ -1511,7 +1511,7 @@ A recommended workflow for a "project lead" goes like this:
1511 +
1512 If other people are pulling from your repository over dumb
1513 transport protocols (HTTP), you need to keep this repository
1514 -'dumb transport friendly'. After `git init-db`,
1514 +'dumb transport friendly'. After `git init`,
1515 `$GIT_DIR/hooks/post-update` copied from the standard templates
1516 would contain a call to `git-update-server-info` but the
1517 `post-update` hook itself is disabled by default -- enable it
Documentation/cvs-migration.txt
+1 -1
@@ -80,7 +80,7 @@ it:
80 ------------------------------------------------
81 $ mkdir /pub/my-repo.git
82 $ cd /pub/my-repo.git
83 -$ git --bare init-db --shared
83 +$ git --bare init --shared
84 $ git --bare fetch /home/alice/myproject master:master
85 ------------------------------------------------
86
Documentation/git-init.txt
+1 -3
@@ -79,9 +79,7 @@ was primarily meant to initialize the object database, but over
79 time it has become responsible for setting up the other aspects
80 of the repository, such as installing the default hooks and
81 setting the configuration variables. The old name is retained
82 -because people are so used to it and many existing documents
83 -refer to it that way, and this will not change for some time to
84 -come.
82 +for backward compatibility reasons.
83
84
85 EXAMPLES
Documentation/git-p4import.txt
+1 -1
@@ -93,7 +93,7 @@ perforce branch into a branch named "jammy", like so:
93 ------------
94 $ mkdir -p /home/sean/import/jam
95 $ cd /home/sean/import/jam
96 -$ git init-db
96 +$ git init
97 $ git p4import //public/jam jammy
98 ------------
99
Documentation/git-svn.txt
+3 -3
@@ -171,7 +171,7 @@ OPTIONS
171 --shared::
172 --template=<template_directory>::
173 Only used with the 'init' command.
174 - These are passed directly to gitlink:git-init-db[1].
174 + These are passed directly to gitlink:git-init[1].
175
176 -r <ARG>::
177 --revision <ARG>::
@@ -367,7 +367,7 @@ Basic Examples
367 Tracking and contributing to a the trunk of a Subversion-managed project:
368
369 ------------------------------------------------------------------------
370 -# Initialize a repo (like git init-db):
370 +# Initialize a repo (like git init):
371 git-svn init http://svn.foo.org/project/trunk
372 # Fetch remote revisions:
373 git-svn fetch
@@ -388,7 +388,7 @@ See also:
388 '<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
389
390 ------------------------------------------------------------------------
391 -# Initialize a repo (like git init-db):
391 +# Initialize a repo (like git init):
392 git-svn multi-init http://svn.foo.org/project \
393 -T trunk -b branches -t tags
394 # Fetch remote revisions:
Documentation/git.txt
+1 -2
@@ -354,8 +354,7 @@ gitlink:git-index-pack[1]::
354 Build pack idx file for an existing packed archive.
355
356 gitlink:git-init[1]::
357 -gitlink:git-init-db[1]::
358 - Creates an empty git object database, or reinitialize an
357 + Creates an empty git repository, or reinitialize an
358 existing one.
359
360 gitlink:git-merge-file[1]::
Documentation/hooks.txt
+1 -1
@@ -3,7 +3,7 @@ Hooks used by git
3
4 Hooks are little scripts you can place in `$GIT_DIR/hooks`
5 directory to trigger action at certain points. When
6 -`git-init-db` is run, a handful example hooks are copied in the
6 +`git-init` is run, a handful example hooks are copied in the
7 `hooks` directory of the new repository, but by default they are
8 all disabled. To enable a hook, make it executable with `chmod +x`.
9
Documentation/howto/setup-git-server-over-http.txt
+1 -1
@@ -70,7 +70,7 @@ DocumentRoot /where/ever/httpd.conf" to find your root:
70 Initialize a bare repository
71
72 $ cd my-new-repo.git
73 - $ git --bare init-db
73 + $ git --bare init
74
75
76 Change the ownership to your web-server's credentials. Use "grep ^User
Documentation/repository-layout.txt
+1 -1
@@ -102,7 +102,7 @@ branches::
102 hooks::
103 Hooks are customization scripts used by various git
104 commands. A handful of sample hooks are installed when
105 - `git init-db` is run, but all of them are disabled by
105 + `git init` is run, but all of them are disabled by
106 default. To enable, they need to be made executable.
107 Read link:hooks.html[hooks] for more details about
108 each hook.
INSTALL
+1 -1
@@ -95,7 +95,7 @@ Issues of note:
95 repository itself. For example, you could:
96
97 $ mkdir manual && cd manual
98 - $ git init-db
98 + $ git init
99 $ git fetch-pack git://git.kernel.org/pub/scm/git/git.git man html |
100 while read a b
101 do
builtin-init-db.c
+1 -1
@@ -56,7 +56,7 @@ static void copy_templates_1(char *path, int baselen,
56
57 /* Note: if ".git/hooks" file exists in the repository being
58 * re-initialized, /etc/core-git/templates/hooks/update would
59 - * cause git-init-db to fail here. I think this is sane but
59 + * cause git-init to fail here. I think this is sane but
60 * it means that the set of templates we ship by default, along
61 * with the way the namespace under .git/ is organized, should
62 * be really carefully chosen.
generate-cmdlist.sh
+1 -1
@@ -22,7 +22,7 @@ commit
22 diff
23 fetch
24 grep
25 -init-db
25 +init
26 log
27 merge
28 mv
git-archimport.perl
+1 -1
@@ -226,7 +226,7 @@ my $import = 0;
226 unless (-d $git_dir) { # initial import
227 if ($psets[0]{type} eq 'i' || $psets[0]{type} eq 't') {
228 print "Starting import from $psets[0]{id}\n";
229 - `git-init-db`;
229 + `git-init`;
230 die $! if $?;
231 $import = 1;
232 } else {
git-clone.sh
+1 -1
@@ -214,7 +214,7 @@ yes)
214 GIT_DIR="$D" ;;
215 *)
216 GIT_DIR="$D/.git" ;;
217 -esac && export GIT_DIR && git-init-db ${template+"$template"} || usage
217 +esac && export GIT_DIR && git-init ${template+"$template"} || usage
218
219 if test -n "$reference"
220 then
git-cvsimport.perl
+2 -2
@@ -520,7 +520,7 @@ $orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE};
520 my %index; # holds filenames of one index per branch
521
522 unless (-d $git_dir) {
523 - system("git-init-db");
523 + system("git-init");
524 die "Cannot init the GIT db at $git_tree: $?\n" if $?;
525 system("git-read-tree");
526 die "Cannot init an empty tree: $?\n" if $?;
@@ -660,7 +660,7 @@ $ignorebranch{'#CVSPS_NO_BRANCH'} = 1;
660 sub commit {
661 if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
662 # looks like an initial commit
663 - # use the index primed by git-init-db
663 + # use the index primed by git-init
664 $ENV{GIT_INDEX_FILE} = '.git/index';
665 $index{$branch} = '.git/index';
666 } else {
git-p4import.py
+1 -1
@@ -163,7 +163,7 @@ class git_command:
163 self.gitdir = self.get_single("rev-parse --git-dir")
164 report(2, "gdir:", self.gitdir)
165 except:
166 - die("Not a git repository... did you forget to \"git init-db\" ?")
166 + die("Not a git repository... did you forget to \"git init\" ?")
167 try:
168 self.cdup = self.get_single("rev-parse --show-cdup")
169 if self.cdup != "":
git-svn.perl
+1 -1
@@ -286,7 +286,7 @@ sub init {
286
287 $SVN_URL = $url;
288 unless (-d $GIT_DIR) {
289 - my @init_db = ('init-db');
289 + my @init_db = ('init');
290 push @init_db, "--template=$_template" if defined $_template;
291 push @init_db, "--shared" if defined $_shared;
292 command_noisy(@init_db);
git-svnimport.perl
+1 -1
@@ -285,7 +285,7 @@ my $last_rev = "";
285 my $last_branch;
286 my $current_rev = $opt_s || 1;
287 unless(-d $git_dir) {
288 - system("git-init-db");
288 + system("git-init");
289 die "Cannot init the GIT db at $git_tree: $?\n" if $?;
290 system("git-read-tree");
291 die "Cannot init an empty tree: $?\n" if $?;
perl/Git.pm
+1 -1
@@ -63,7 +63,7 @@ for doing easily operations which are not totally trivial to do over
63 the generic command interface.
64
65 While some commands can be executed outside of any context (e.g. 'version'
66 -or 'init-db'), most operations require a repository context, which in practice
66 +or 'init'), most operations require a repository context, which in practice
67 means getting an instance of the Git object using the repository() constructor.
68 (In the future, we will also get a new_repository() constructor.) All commands
69 called as methods of the object are then executed in the context of the
t/README
+1 -1
@@ -18,7 +18,7 @@ The easiest way to run tests is to say "make". This runs all
18 the tests.
19
20 *** t0000-basic.sh ***
21 - * ok 1: .git/objects should be empty after git-init-db in an empty repo.
21 + * ok 1: .git/objects should be empty after git-init in an empty repo.
22 * ok 2: .git/objects should have 256 subdirectories.
23 * ok 3: git-update-index without --add should fail adding.
24 ...
t/t0000-basic.sh
+2 -2
@@ -31,12 +31,12 @@ fi
31 . ./test-lib.sh
32
33 ################################################################
34 -# init-db has been done in an empty repository.
34 +# git-init has been done in an empty repository.
35 # make sure it is empty.
36
37 find .git/objects -type f -print >should-be-empty
38 test_expect_success \
39 - '.git/objects should be empty after git-init-db in an empty repo.' \
39 + '.git/objects should be empty after git-init in an empty repo.' \
40 'cmp -s /dev/null should-be-empty'
41
42 # also it should have 2 subdirectories; no fan-out anymore, pack, and info.
t/t4116-apply-reverse.sh
+2 -2
@@ -50,12 +50,12 @@ test_expect_success 'setup separate repository lacking postimage' '
50
51 git tar-tree initial initial | tar xf - &&
52 (
53 - cd initial && git init-db && git add .
53 + cd initial && git init && git add .
54 ) &&
55
56 git tar-tree second second | tar xf - &&
57 (
58 - cd second && git init-db && git add .
58 + cd second && git init && git add .
59 )
60
61 '
t/t5300-pack-object.sh
+3 -3
@@ -44,7 +44,7 @@ test_expect_success \
44 'unpack without delta' \
45 "GIT_OBJECT_DIRECTORY=.git2/objects &&
46 export GIT_OBJECT_DIRECTORY &&
47 - git-init-db &&
47 + git-init &&
48 git-unpack-objects -n <test-1-${packname_1}.pack &&
49 git-unpack-objects <test-1-${packname_1}.pack"
50
@@ -75,7 +75,7 @@ test_expect_success \
75 'unpack with delta' \
76 'GIT_OBJECT_DIRECTORY=.git2/objects &&
77 export GIT_OBJECT_DIRECTORY &&
78 - git-init-db &&
78 + git-init &&
79 git-unpack-objects -n <test-2-${packname_2}.pack &&
80 git-unpack-objects <test-2-${packname_2}.pack'
81
@@ -100,7 +100,7 @@ test_expect_success \
100 'use packed objects' \
101 'GIT_OBJECT_DIRECTORY=.git2/objects &&
102 export GIT_OBJECT_DIRECTORY &&
103 - git-init-db &&
103 + git-init &&
104 cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
105 git-diff-tree --root -p $commit &&
106 while read object
t/t5500-fetch-pack.sh
+1 -1
@@ -97,7 +97,7 @@ pull_to_client () {
97 (
98 mkdir client &&
99 cd client &&
100 - git-init-db 2>> log2.txt
100 + git-init 2>> log2.txt
101 )
102
103 add A1
t/t5510-fetch.sh
+1 -1
@@ -73,7 +73,7 @@ test_expect_success 'fetch following tags' '
73
74 mkdir four &&
75 cd four &&
76 - git init-db &&
76 + git init &&
77
78 git fetch .. :track &&
79 git show-ref --verify refs/tags/anno &&
t/t5520-pull.sh
+1 -1
@@ -17,7 +17,7 @@ test_expect_success setup '
17 test_expect_success 'pulling into void' '
18 mkdir cloned &&
19 cd cloned &&
20 - git init-db &&
20 + git init &&
21 git pull ..
22 '
23
t/t7001-mv.sh
+2 -2
@@ -88,7 +88,7 @@ test_expect_success \
88
89 test_expect_success "Michael Cassar's test case" '
90 rm -fr .git papers partA &&
91 - git init-db &&
91 + git init &&
92 mkdir -p papers/unsorted papers/all-papers partA &&
93 echo a > papers/unsorted/Thesis.pdf &&
94 echo b > partA/outline.txt &&
@@ -109,7 +109,7 @@ rm -fr papers partA path?
109
110 test_expect_success "Sergey Vlasov's test case" '
111 rm -fr .git &&
112 - git init-db &&
112 + git init &&
113 mkdir ab &&
114 date >ab.c &&
115 date >ab/d &&
t/test-lib.sh
+2 -2
@@ -220,8 +220,8 @@ test_create_repo () {
220 repo="$1"
221 mkdir "$repo"
222 cd "$repo" || error "Cannot setup test environment"
223 - "$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
224 - error "cannot run git init-db -- have you built things yet?"
223 + "$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
224 + error "cannot run git init -- have you built things yet?"
225 mv .git/hooks .git/hooks-disabled
226 cd "$owd"
227 }