From 5c94f87e6b17cab5d3b87998d6c907745cb6f5a4 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Fri, 12 Jan 2007 16:01:46 -0500 Subject: [PATCH] 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 Signed-off-by: Junio C Hamano --- Documentation/config.txt | 2 +- Documentation/core-tutorial.txt | 10 +++++----- Documentation/cvs-migration.txt | 2 +- Documentation/git-init.txt | 4 +--- Documentation/git-p4import.txt | 2 +- Documentation/git-svn.txt | 6 +++--- Documentation/git.txt | 3 +-- Documentation/hooks.txt | 2 +- Documentation/howto/setup-git-server-over-http.txt | 2 +- Documentation/repository-layout.txt | 2 +- INSTALL | 2 +- builtin-init-db.c | 2 +- generate-cmdlist.sh | 2 +- git-archimport.perl | 2 +- git-clone.sh | 2 +- git-cvsimport.perl | 4 ++-- git-p4import.py | 2 +- git-svn.perl | 2 +- git-svnimport.perl | 2 +- perl/Git.pm | 2 +- t/README | 2 +- t/t0000-basic.sh | 4 ++-- t/t4116-apply-reverse.sh | 4 ++-- t/t5300-pack-object.sh | 6 +++--- t/t5500-fetch-pack.sh | 2 +- t/t5510-fetch.sh | 2 +- t/t5520-pull.sh | 2 +- t/t7001-mv.sh | 4 ++-- t/test-lib.sh | 4 ++-- 29 files changed, 42 insertions(+), 45 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index b4aae0d0a..f7dba8977 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -100,7 +100,7 @@ core.sharedRepository:: group-writable). When 'all' (or 'world' or 'everybody'), the repository will be readable by all users, additionally to being group-shareable. When 'umask' (or 'false'), git will use permissions - reported by umask(2). See gitlink:git-init-db[1]. False by default. + reported by umask(2). See gitlink:git-init[1]. False by default. core.warnAmbiguousRefs:: If true, git will warn you if the ref name you passed it is ambiguous diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt index 5ea611748..0cd33fb5b 100644 --- a/Documentation/core-tutorial.txt +++ b/Documentation/core-tutorial.txt @@ -46,12 +46,12 @@ to import into git. For our first example, we're going to start a totally new repository from scratch, with no pre-existing files, and we'll call it `git-tutorial`. To start up, create a subdirectory for it, change into that -subdirectory, and initialize the git infrastructure with `git-init-db`: +subdirectory, and initialize the git infrastructure with `git-init`: ------------------------------------------------ $ mkdir git-tutorial $ cd git-tutorial -$ git-init-db +$ git-init ------------------------------------------------ to which git will reply @@ -1371,11 +1371,11 @@ $ mkdir my-git.git ------------ Then, make that directory into a git repository by running -`git init-db`, but this time, since its name is not the usual +`git init`, but this time, since its name is not the usual `.git`, we do things slightly differently: ------------ -$ GIT_DIR=my-git.git git-init-db +$ GIT_DIR=my-git.git git-init ------------ 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: + If other people are pulling from your repository over dumb transport protocols (HTTP), you need to keep this repository -'dumb transport friendly'. After `git init-db`, +'dumb transport friendly'. After `git init`, `$GIT_DIR/hooks/post-update` copied from the standard templates would contain a call to `git-update-server-info` but the `post-update` hook itself is disabled by default -- enable it diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt index 8e09beaa7..775bf4266 100644 --- a/Documentation/cvs-migration.txt +++ b/Documentation/cvs-migration.txt @@ -80,7 +80,7 @@ it: ------------------------------------------------ $ mkdir /pub/my-repo.git $ cd /pub/my-repo.git -$ git --bare init-db --shared +$ git --bare init --shared $ git --bare fetch /home/alice/myproject master:master ------------------------------------------------ diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt index e1fd6884f..596b567c9 100644 --- a/Documentation/git-init.txt +++ b/Documentation/git-init.txt @@ -79,9 +79,7 @@ was primarily meant to initialize the object database, but over time it has become responsible for setting up the other aspects of the repository, such as installing the default hooks and setting the configuration variables. The old name is retained -because people are so used to it and many existing documents -refer to it that way, and this will not change for some time to -come. +for backward compatibility reasons. EXAMPLES diff --git a/Documentation/git-p4import.txt b/Documentation/git-p4import.txt index ee9e8fa90..6edb9f12b 100644 --- a/Documentation/git-p4import.txt +++ b/Documentation/git-p4import.txt @@ -93,7 +93,7 @@ perforce branch into a branch named "jammy", like so: ------------ $ mkdir -p /home/sean/import/jam $ cd /home/sean/import/jam -$ git init-db +$ git init $ git p4import //public/jam jammy ------------ diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 1b013139a..9ed721118 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -171,7 +171,7 @@ OPTIONS --shared:: --template=:: Only used with the 'init' command. - These are passed directly to gitlink:git-init-db[1]. + These are passed directly to gitlink:git-init[1]. -r :: --revision :: @@ -367,7 +367,7 @@ Basic Examples Tracking and contributing to a the trunk of a Subversion-managed project: ------------------------------------------------------------------------ -# Initialize a repo (like git init-db): +# Initialize a repo (like git init): git-svn init http://svn.foo.org/project/trunk # Fetch remote revisions: git-svn fetch @@ -388,7 +388,7 @@ See also: '<>' ------------------------------------------------------------------------ -# Initialize a repo (like git init-db): +# Initialize a repo (like git init): git-svn multi-init http://svn.foo.org/project \ -T trunk -b branches -t tags # Fetch remote revisions: diff --git a/Documentation/git.txt b/Documentation/git.txt index 5662cdc27..f89d745ef 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -354,8 +354,7 @@ gitlink:git-index-pack[1]:: Build pack idx file for an existing packed archive. gitlink:git-init[1]:: -gitlink:git-init-db[1]:: - Creates an empty git object database, or reinitialize an + Creates an empty git repository, or reinitialize an existing one. gitlink:git-merge-file[1]:: diff --git a/Documentation/hooks.txt b/Documentation/hooks.txt index 161123f14..e3b76f96e 100644 --- a/Documentation/hooks.txt +++ b/Documentation/hooks.txt @@ -3,7 +3,7 @@ Hooks used by git Hooks are little scripts you can place in `$GIT_DIR/hooks` directory to trigger action at certain points. When -`git-init-db` is run, a handful example hooks are copied in the +`git-init` is run, a handful example hooks are copied in the `hooks` directory of the new repository, but by default they are all disabled. To enable a hook, make it executable with `chmod +x`. diff --git a/Documentation/howto/setup-git-server-over-http.txt b/Documentation/howto/setup-git-server-over-http.txt index ba191569a..a202f3a46 100644 --- a/Documentation/howto/setup-git-server-over-http.txt +++ b/Documentation/howto/setup-git-server-over-http.txt @@ -70,7 +70,7 @@ DocumentRoot /where/ever/httpd.conf" to find your root: Initialize a bare repository $ cd my-new-repo.git - $ git --bare init-db + $ git --bare init Change the ownership to your web-server's credentials. Use "grep ^User diff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt index e20fb7e74..0fdd36614 100644 --- a/Documentation/repository-layout.txt +++ b/Documentation/repository-layout.txt @@ -102,7 +102,7 @@ branches:: hooks:: Hooks are customization scripts used by various git commands. A handful of sample hooks are installed when - `git init-db` is run, but all of them are disabled by + `git init` is run, but all of them are disabled by default. To enable, they need to be made executable. Read link:hooks.html[hooks] for more details about each hook. diff --git a/INSTALL b/INSTALL index e7aea60e9..361c65bac 100644 --- a/INSTALL +++ b/INSTALL @@ -95,7 +95,7 @@ Issues of note: repository itself. For example, you could: $ mkdir manual && cd manual - $ git init-db + $ git init $ git fetch-pack git://git.kernel.org/pub/scm/git/git.git man html | while read a b do diff --git a/builtin-init-db.c b/builtin-init-db.c index 22729f01a..8e7540b69 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -56,7 +56,7 @@ static void copy_templates_1(char *path, int baselen, /* Note: if ".git/hooks" file exists in the repository being * re-initialized, /etc/core-git/templates/hooks/update would - * cause git-init-db to fail here. I think this is sane but + * cause git-init to fail here. I think this is sane but * it means that the set of templates we ship by default, along * with the way the namespace under .git/ is organized, should * be really carefully chosen. diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 1de14ea82..975777f05 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -22,7 +22,7 @@ commit diff fetch grep -init-db +init log merge mv diff --git a/git-archimport.perl b/git-archimport.perl index ada60ec24..2e1578124 100755 --- a/git-archimport.perl +++ b/git-archimport.perl @@ -226,7 +226,7 @@ my $import = 0; unless (-d $git_dir) { # initial import if ($psets[0]{type} eq 'i' || $psets[0]{type} eq 't') { print "Starting import from $psets[0]{id}\n"; - `git-init-db`; + `git-init`; die $! if $?; $import = 1; } else { diff --git a/git-clone.sh b/git-clone.sh index cf761b2c6..0f7bbbfb3 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -214,7 +214,7 @@ yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; -esac && export GIT_DIR && git-init-db ${template+"$template"} || usage +esac && export GIT_DIR && git-init ${template+"$template"} || usage if test -n "$reference" then diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 1018f4f6f..35ef0c0ee 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -520,7 +520,7 @@ $orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE}; my %index; # holds filenames of one index per branch unless (-d $git_dir) { - system("git-init-db"); + system("git-init"); die "Cannot init the GIT db at $git_tree: $?\n" if $?; system("git-read-tree"); die "Cannot init an empty tree: $?\n" if $?; @@ -660,7 +660,7 @@ $ignorebranch{'#CVSPS_NO_BRANCH'} = 1; sub commit { if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) { # looks like an initial commit - # use the index primed by git-init-db + # use the index primed by git-init $ENV{GIT_INDEX_FILE} = '.git/index'; $index{$branch} = '.git/index'; } else { diff --git a/git-p4import.py b/git-p4import.py index 908941dd7..5c56cace0 100644 --- a/git-p4import.py +++ b/git-p4import.py @@ -163,7 +163,7 @@ class git_command: self.gitdir = self.get_single("rev-parse --git-dir") report(2, "gdir:", self.gitdir) except: - die("Not a git repository... did you forget to \"git init-db\" ?") + die("Not a git repository... did you forget to \"git init\" ?") try: self.cdup = self.get_single("rev-parse --show-cdup") if self.cdup != "": diff --git a/git-svn.perl b/git-svn.perl index 56f17002d..9986a0c9b 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -286,7 +286,7 @@ sub init { $SVN_URL = $url; unless (-d $GIT_DIR) { - my @init_db = ('init-db'); + my @init_db = ('init'); push @init_db, "--template=$_template" if defined $_template; push @init_db, "--shared" if defined $_shared; command_noisy(@init_db); diff --git a/git-svnimport.perl b/git-svnimport.perl index f1f1a7dbe..3af8c7e11 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -285,7 +285,7 @@ my $last_rev = ""; my $last_branch; my $current_rev = $opt_s || 1; unless(-d $git_dir) { - system("git-init-db"); + system("git-init"); die "Cannot init the GIT db at $git_tree: $?\n" if $?; system("git-read-tree"); die "Cannot init an empty tree: $?\n" if $?; diff --git a/perl/Git.pm b/perl/Git.pm index 2b26b65bf..3474ad320 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -63,7 +63,7 @@ for doing easily operations which are not totally trivial to do over the generic command interface. While some commands can be executed outside of any context (e.g. 'version' -or 'init-db'), most operations require a repository context, which in practice +or 'init'), most operations require a repository context, which in practice means getting an instance of the Git object using the repository() constructor. (In the future, we will also get a new_repository() constructor.) All commands called as methods of the object are then executed in the context of the diff --git a/t/README b/t/README index 7abab1daf..36f251761 100644 --- a/t/README +++ b/t/README @@ -18,7 +18,7 @@ The easiest way to run tests is to say "make". This runs all the tests. *** t0000-basic.sh *** - * ok 1: .git/objects should be empty after git-init-db in an empty repo. + * ok 1: .git/objects should be empty after git-init in an empty repo. * ok 2: .git/objects should have 256 subdirectories. * ok 3: git-update-index without --add should fail adding. ... diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index 0cd1c4186..186de7024 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -31,12 +31,12 @@ fi . ./test-lib.sh ################################################################ -# init-db has been done in an empty repository. +# git-init has been done in an empty repository. # make sure it is empty. find .git/objects -type f -print >should-be-empty test_expect_success \ - '.git/objects should be empty after git-init-db in an empty repo.' \ + '.git/objects should be empty after git-init in an empty repo.' \ 'cmp -s /dev/null should-be-empty' # also it should have 2 subdirectories; no fan-out anymore, pack, and info. diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh index 74f5c2a57..aa2c869e0 100755 --- a/t/t4116-apply-reverse.sh +++ b/t/t4116-apply-reverse.sh @@ -50,12 +50,12 @@ test_expect_success 'setup separate repository lacking postimage' ' git tar-tree initial initial | tar xf - && ( - cd initial && git init-db && git add . + cd initial && git init && git add . ) && git tar-tree second second | tar xf - && ( - cd second && git init-db && git add . + cd second && git init && git add . ) ' diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index de45ac4e0..f51154745 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -44,7 +44,7 @@ test_expect_success \ 'unpack without delta' \ "GIT_OBJECT_DIRECTORY=.git2/objects && export GIT_OBJECT_DIRECTORY && - git-init-db && + git-init && git-unpack-objects -n > log2.txt + git-init 2>> log2.txt ) add A1 diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 90eeeba2a..3ce944621 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -73,7 +73,7 @@ test_expect_success 'fetch following tags' ' mkdir four && cd four && - git init-db && + git init && git fetch .. :track && git show-ref --verify refs/tags/anno && diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index f84157457..7eb37838b 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -17,7 +17,7 @@ test_expect_success setup ' test_expect_success 'pulling into void' ' mkdir cloned && cd cloned && - git init-db && + git init && git pull .. ' diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 2f4ff82e1..344033249 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -88,7 +88,7 @@ test_expect_success \ test_expect_success "Michael Cassar's test case" ' rm -fr .git papers partA && - git init-db && + git init && mkdir -p papers/unsorted papers/all-papers partA && echo a > papers/unsorted/Thesis.pdf && echo b > partA/outline.txt && @@ -109,7 +109,7 @@ rm -fr papers partA path? test_expect_success "Sergey Vlasov's test case" ' rm -fr .git && - git init-db && + git init && mkdir ab && date >ab.c && date >ab/d && diff --git a/t/test-lib.sh b/t/test-lib.sh index 72ea2b259..8e3ee6cd7 100755 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -220,8 +220,8 @@ test_create_repo () { repo="$1" mkdir "$repo" cd "$repo" || error "Cannot setup test environment" - "$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 || - error "cannot run git init-db -- have you built things yet?" + "$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 || + error "cannot run git init -- have you built things yet?" mv .git/hooks .git/hooks-disabled cd "$owd" } -- 2.30.2