]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'jc/checkout'
authorJunio C Hamano <gitster@pobox.com>
Mon, 2 Jun 2008 05:55:33 +0000 (22:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Jun 2008 05:55:36 +0000 (22:55 -0700)
* 'jc/checkout':
  checkout: "best effort" checkout
  unpack_trees(): allow callers to differentiate worktree errors from merge errors
  checkout: consolidate reset_{to_new,clean_to_new}()
  checkout: make reset_clean_to_new() not die by itself

27 files changed:
Documentation/Makefile
Documentation/config.txt
Documentation/git-init.txt
Documentation/git-svn.txt
Documentation/git.txt
Documentation/gitcore-tutorial.txt [moved from Documentation/core-tutorial.txt with 99% similarity]
Documentation/gitcvs-migration.txt
Documentation/gitglossary.txt [new file with mode: 0644]
Documentation/gittutorial-2.txt
Documentation/gittutorial.txt
Documentation/glossary-content.txt [moved from Documentation/glossary.txt with 98% similarity]
Documentation/pull-fetch-param.txt
Documentation/technical/api-revision-walking.txt
Documentation/urls-remotes.txt
Documentation/user-manual.txt
builtin-init-db.c
git-svn.perl
gitweb/test/Märchen [deleted file]
gitweb/test/file with spaces [deleted file]
gitweb/test/file+plus+sign [deleted file]
graph.c
http-push.c
lockfile.c
perl/Git.pm
read-cache.c
t/t0001-init.sh
t/t7502-commit.sh

index 9750334b9764dc5901069501fd6b6fe196d22ca5..ca4dadf940a9e0228348c5793beaddcd2483461d 100644 (file)
@@ -4,7 +4,7 @@ MAN1_TXT= \
        gitk.txt
 MAN5_TXT=gitattributes.txt gitignore.txt gitmodules.txt githooks.txt
 MAN7_TXT=git.txt gitcli.txt gittutorial.txt gittutorial-2.txt \
-       gitcvs-migration.txt
+       gitcvs-migration.txt gitcore-tutorial.txt gitglossary.txt
 
 MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
 MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
@@ -12,13 +12,11 @@ MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
 
 DOC_HTML=$(MAN_HTML)
 
-ARTICLES = core-tutorial
-ARTICLES += diffcore
+ARTICLES = diffcore
 ARTICLES += howto-index
 ARTICLES += repository-layout
 ARTICLES += everyday
 ARTICLES += git-tools
-ARTICLES += glossary
 # with their own formatting rules.
 SP_ARTICLES = howto/revert-branch-rebase howto/using-merge-subtree user-manual
 API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt)))
index c298dc21c5a4ba28eaf35c4d12ae9f0030487e83..5331b450ea051334d53ce3f1e727e33def2ea2cf 100644 (file)
@@ -205,10 +205,13 @@ Can be overridden by the 'GIT_PROXY_COMMAND' environment variable
 handling).
 
 core.ignoreStat::
-       The working copy files are assumed to stay unchanged until you
-       mark them otherwise manually - Git will not detect the file changes
-       by lstat() calls. This is useful on systems where those are very
-       slow, such as Microsoft Windows.  See linkgit:git-update-index[1].
+       If true, commands which modify both the working tree and the index
+       will mark the updated paths with the "assume unchanged" bit in the
+       index. These marked files are then assumed to stay unchanged in the
+       working copy, until you mark them otherwise manually - Git will not
+       detect the file changes by lstat() calls. This is useful on systems
+       where those are very slow, such as Microsoft Windows.
+       See linkgit:git-update-index[1].
        False by default.
 
 core.preferSymlinkRefs::
index b17ae8485cf2d3eb4fc21acba769942a57d33e67..b48c31289923345d8f50342780d30dbcb4e01399 100644 (file)
@@ -8,7 +8,7 @@ git-init - Create an empty git repository or reinitialize an existing one
 
 SYNOPSIS
 --------
-'git-init' [-q | --quiet] [--template=<template_directory>] [--shared[=<permissions>]]
+'git-init' [-q | --quiet] [--bare] [--template=<template_directory>] [--shared[=<permissions>]]
 
 
 OPTIONS
@@ -20,6 +20,11 @@ OPTIONS
 
 Only print error and warning messages, all other output will be suppressed.
 
+--bare::
+
+Create a bare repository. If GIT_DIR environment is not set, it is set to the
+current working directory.
+
 --template=<template_directory>::
 
 Provide the directory from which templates will be used.  The default template
index c9e4efe7f4678ecc0beb87b387c71a7ebd0efc71..f4cbd2f212e544f0a17c761a4c870a925db5802b 100644 (file)
@@ -365,11 +365,15 @@ Passed directly to git-rebase when using 'dcommit' if a
 -n::
 --dry-run::
 
-This is only used with the 'dcommit' command.
+This can be used with the 'dcommit' and 'rebase' commands.
 
-Print out the series of git arguments that would show
+For 'dcommit', print out the series of git arguments that would show
 which diffs would be committed to SVN.
 
+For 'rebase', display the local branch associated with the upstream svn
+repository associated with the current branch and the URL of svn
+repository that will be fetched from.
+
 --
 
 ADVANCED OPTIONS
index 7182bb7f7e54685839ef7bade6c8d66cd1772c3b..dae1b4031c12e1bf5b49c42bf4530f865efd656f 100644 (file)
@@ -174,7 +174,7 @@ See the references above to get started using git.  The following is
 probably more detail than necessary for a first-time user.
 
 The link:user-manual.html#git-concepts[git concepts chapter of the
-user-manual] and the link:core-tutorial.html[Core tutorial] both provide
+user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial] both provide
 introductions to the underlying git architecture.
 
 See also the link:howto-index.html[howto] documents for some useful
@@ -374,7 +374,7 @@ Higher level SCMs may provide and manage additional information in the
 
 Terminology
 -----------
-Please see the link:glossary.html[glossary] document.
+Please see the linkgit:gitglossary[7][glossary] document.
 
 
 Environment Variables
@@ -518,7 +518,7 @@ Discussion[[Discussion]]
 
 More detail on the following is available from the
 link:user-manual.html#git-concepts[git concepts chapter of the
-user-manual] and the link:core-tutorial.html[Core tutorial].
+user-manual] and the linkgit:gitcore-tutorial[7][Core tutorial].
 
 A git project normally consists of a working directory with a ".git"
 subdirectory at the top level.  The .git directory contains, among other
@@ -579,6 +579,13 @@ The documentation for git suite was started by David Greaves
 <david@dgreaves.com>, and later enhanced greatly by the
 contributors on the git-list <git@vger.kernel.org>.
 
+SEE ALSO
+--------
+linkgit:gittutorial[7], linkgit:gittutorial-2[7],
+linkgit:giteveryday[7], linkgit:gitcvs-migration[7],
+linkgit:gitglossary[7], linkgit:gitcore-tutorial[7],
+link:user-manual.html[The Git User's Manual]
+
 GIT
 ---
 Part of the linkgit:git[7] suite
similarity index 99%
rename from Documentation/core-tutorial.txt
rename to Documentation/gitcore-tutorial.txt
index b50b5dd487fc7d7fef32408683373e9dade0f3c1..5995a2e1525eeee764b5c141b8c558ccba0a953b 100644 (file)
@@ -1,8 +1,16 @@
-A git core tutorial for developers
-==================================
+gitcore-tutorial(7)
+===================
 
-Introduction
-------------
+NAME
+----
+gitcore-tutorial - A git core tutorial for developers
+
+SYNOPSIS
+--------
+git *
+
+DESCRIPTION
+-----------
 
 This tutorial explains how to use the "core" git programs to set up and
 work with a git repository.
@@ -1679,3 +1687,13 @@ merge two at a time, documenting how you resolved the conflicts,
 and the reason why you preferred changes made in one side over
 the other.  Otherwise it would make the project history harder
 to follow, not easier.
+
+SEE ALSO
+--------
+linkgit:gittutorial[7], linkgit:gittutorial-2[7],
+linkgit:giteveryday[7], linkgit:gitcvs-migration[7],
+link:user-manual.html[The Git User's Manual]
+
+GIT
+---
+Part of the linkgit:git[7] suite.
index c41080502705907d5940f1ea1f0ca68e25f18770..de02a4268eae5213a257cf70a04916baaeb32e62 100644 (file)
@@ -20,7 +20,7 @@ this document explains how to do that.
 
 Some basic familiarity with git is required.  This
 linkgit:gittutorial[7][tutorial introduction to git] and the
-link:glossary.html[git glossary] should be sufficient.
+linkgit:gitglossary[7][git glossary] should be sufficient.
 
 Developing against a shared repository
 --------------------------------------
@@ -184,7 +184,10 @@ repositories without the need for a central maintainer.
 
 SEE ALSO
 --------
-linkgit:gittutorial[7], linkgit:gittutorial-2[7],
+linkgit:gittutorial[7],
+linkgit:gittutorial-2[7],
+linkgit:gitcore-tutorial[7],
+linkgit:gitglossary[7],
 link:everyday.html[Everyday Git],
 link:user-manual.html[The Git User's Manual]
 
diff --git a/Documentation/gitglossary.txt b/Documentation/gitglossary.txt
new file mode 100644 (file)
index 0000000..e8475a0
--- /dev/null
@@ -0,0 +1,25 @@
+gitglossary(7)
+==============
+
+NAME
+----
+gitglossary - A GIT Glossary
+
+SYNOPSIS
+--------
+*
+
+DESCRIPTION
+-----------
+
+include::glossary-content.txt[]
+
+SEE ALSO
+--------
+linkgit:gittutorial[7], linkgit:gittutorial-2[7],
+linkgit:giteveryday[7], linkgit:gitcvs-migration[7],
+link:user-manual.html[The Git User's Manual]
+
+GIT
+---
+Part of the linkgit:git[7] suite.
index 5bbbf430561a5528233317cf8f9bc25e8a763c4a..4880ba9ae91efac4cb9b064f5f0e1b42b99110fb 100644 (file)
@@ -390,7 +390,7 @@ in the index file is identical to the one in the working directory.
 In addition to being the staging area for new commits, the index file
 is also populated from the object database when checking out a
 branch, and is used to hold the trees involved in a merge operation.
-See the link:core-tutorial.html[core tutorial] and the relevant man
+See the linkgit:gitcore-tutorial[7][core tutorial] and the relevant man
 pages for details.
 
 What next?
@@ -400,7 +400,7 @@ At this point you should know everything necessary to read the man
 pages for any of the git commands; one good place to start would be
 with the commands mentioned in link:everyday.html[Everyday git].  You
 should be able to find any unknown jargon in the
-link:glossary.html[Glossary].
+linkgit:gitglossary[7][Glossary].
 
 The link:user-manual.html[Git User's Manual] provides a more
 comprehensive introduction to git.
@@ -412,7 +412,7 @@ CVS-like way.
 For some interesting examples of git use, see the
 link:howto-index.html[howtos].
 
-For git developers, the link:core-tutorial.html[Core tutorial] goes
+For git developers, the linkgit:gitcore-tutorial[7][Core tutorial] goes
 into detail on the lower-level git mechanisms involved in, for
 example, creating a new commit.
 
@@ -420,6 +420,8 @@ SEE ALSO
 --------
 linkgit:gittutorial[7],
 linkgit:gitcvs-migration[7],
+linkgit:gitcore-tutorial[7],
+linkgit:gitglossary[7],
 link:everyday.html[Everyday git],
 link:user-manual.html[The Git User's Manual]
 
index 898acdb5332a8ff98a88780a42c61de1c379bdb0..722b3232148643896e7d3bdc36f717f726547200 100644 (file)
@@ -598,6 +598,8 @@ SEE ALSO
 --------
 linkgit:gittutorial-2[7],
 linkgit:gitcvs-migration[7],
+linkgit:gitcore-tutorial[7],
+linkgit:gitglossary[7],
 link:everyday.html[Everyday git],
 link:user-manual.html[The Git User's Manual]
 
similarity index 98%
rename from Documentation/glossary.txt
rename to Documentation/glossary-content.txt
index 51b63532b67870960351bf6942f7baf7a7a64c6f..9b4a4f45e900a96c4ddeb214816877f39cca15a5 100644 (file)
@@ -1,6 +1,3 @@
-GIT Glossary
-============
-
 [[def_alternate_object_database]]alternate object database::
        Via the alternates mechanism, a <<def_repository,repository>>
        can inherit part of its <<def_object_database,object database>>
@@ -90,11 +87,10 @@ to point at the new commit.
        source code management tools.
 
 [[def_DAG]]DAG::
-       Directed acyclic graph. The <<def_commit,commit>> objects form a
+       Directed acyclic graph. The <<def_commit_object,commit objects>> form a
        directed acyclic graph, because they have parents (directed), and the
-       graph of commit objects is acyclic (there is no
-       <<def_chain,chain>> which begins and ends with the same
-       <<def_object,object>>).
+       graph of commit objects is acyclic (there is no <<def_chain,chain>>
+       which begins and ends with the same <<def_object,object>>).
 
 [[def_dangling_object]]dangling object::
        An <<def_unreachable_object,unreachable object>> which is not
@@ -250,9 +246,10 @@ This commit is referred to as a "merge commit", or sometimes just a
        the <<def_hash,hash>> of the object.
 
 [[def_object_type]]object type::
-       One of the identifiers
-       "<<def_commit,commit>>","<<def_tree,tree>>","<<def_tag,tag>>" or "<<def_blob_object,blob>>"
-       describing the type of an <<def_object,object>>.
+       One of the identifiers "<<def_commit_object,commit>>",
+       "<<def_tree_object,tree>>", "<<def_tag_object,tag>>" or
+       "<<def_blob_object,blob>>" describing the type of an
+       <<def_object,object>>.
 
 [[def_octopus]]octopus::
        To <<def_merge,merge>> more than two <<def_branch,branches>>. Also denotes an
index b6eb7fc6189daece1a200293dc767b6bc064620a..cbee369947bf43c245994607ba5d3f77246cce6d 100644 (file)
@@ -1,6 +1,8 @@
 <repository>::
        The "remote" repository that is the source of a fetch
-       or pull operation.  See the section <<URLS,GIT URLS>> below.
+       or pull operation.  This parameter can be either a URL
+       (see the section <<URLS,GIT URLS>> below) or the name
+       of a remote (see the section <<REMOTES,REMOTES>> below).
 
 <refspec>::
        The canonical format of a <refspec> parameter is
index 01a24551af063d82f57929e0bdbe08f3455dc016..996da0503acfa3e3a0ed0f57a951d0fbc1500fb8 100644 (file)
@@ -1,9 +1,67 @@
 revision walking API
 ====================
 
+The revision walking API offers functions to build a list of revisions
+and then iterate over that list.
+
+Calling sequence
+----------------
+
+The walking API has a given calling sequence: first you need to
+initialize a rev_info structure, then add revisions to control what kind
+of revision list do you want to get, finally you can iterate over the
+revision list.
+
+Functions
+---------
+
+`init_revisions`::
+
+       Initialize a rev_info structure with default values. The second
+       parameter may be NULL or can be prefix path, and then the `.prefix`
+       variable will be set to it. This is typically the first function you
+       want to call when you want to deal with a revision list. After calling
+       this function, you are free to customize options, like set
+       `.ignore_merges` to 0 if you don't want to ignore merges, and so on. See
+       `revision.h` for a complete list of available options.
+
+`add_pending_object`::
+
+       This function can be used if you want to add commit objects as revision
+       information. You can use the `UNINTERESTING` object flag to indicate if
+       you want to include or exclude the given commit (and commits reachable
+       from the given commit) from the revision list.
++
+NOTE: If you have the commits as a string list then you probably want to
+use setup_revisions(), instead of parsing each string and using this
+function.
+
+`setup_revisions`::
+
+       Parse revision information, filling in the `rev_info` structure, and
+       removing the used arguments from the argument list. Returns the number
+       of arguments left that weren't recognized, which are also moved to the
+       head of the argument list. The last parameter is used in case no
+       parameter given by the first two arguments.
+
+`prepare_revision_walk`::
+
+       Prepares the rev_info structure for a walk. You should check if it
+       returns any error (non-zero return code) and if it does not, you can
+       start using get_revision() to do the iteration.
+
+`get_revision`::
+
+       Takes a pointer to a `rev_info` structure and iterates over it,
+       returning a `struct commit *` each time you call it. The end of the
+       revision list is indicated by returning a NULL pointer.
+
+Data structures
+---------------
+
 Talk about <revision.h>, things like:
 
 * two diff_options, one for path limiting, another for output;
-* calling sequence: init_revisions(), setup_revsions(), get_revision();
+* remaining functions;
 
 (Linus, JC, Dscho)
index 5dd1f836c6f251bdc6ae8d4e34783177bb6876f6..99753006e290040be941194b23c7ab26d9e9354e 100644 (file)
@@ -1,55 +1,82 @@
 include::urls.txt[]
 
-REMOTES
--------
+REMOTES[[REMOTES]]
+------------------
 
-In addition to the above, as a short-hand, the name of a
-file in `$GIT_DIR/remotes` directory can be given; the
-named file should be in the following format:
+The name of one of the following can be used instead
+of a URL as `<repository>` argument:
 
-------------
-       URL: one of the above URL format
-       Push: <refspec>
-       Pull: <refspec>
+* a remote in the git configuration file: `$GIT_DIR/config`,
+* a file in the `$GIT_DIR/remotes` directory, or
+* a file in the `$GIT_DIR/branches` directory.
 
-------------
+All of these also allow you to omit the refspec from the command line
+because they each contain a refspec which git will use by default.
 
-Then such a short-hand is specified in place of
-<repository> without <refspec> parameters on the command
-line, <refspec> specified on `Push:` lines or `Pull:`
-lines are used for `git-push` and `git-fetch`/`git-pull`,
-respectively.  Multiple `Push:` and `Pull:` lines may
-be specified for additional branch mappings.
+Named remote in configuration file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-Or, equivalently, in the `$GIT_DIR/config` (note the use
-of `fetch` instead of `Pull:`):
+You can choose to provide the name of a remote which you had previously
+configured using linkgit:git-remote[1], linkgit:git-config[1]
+or even by a manual edit to the `$GIT_DIR/config` file.  The URL of
+this remote will be used to access the repository.  The refspec
+of this remote will be used by default when you do
+not provide a refspec on the command line.  The entry in the
+config file would appear like this:
 
 ------------
-       [remote "<remote>"]
+       [remote "<name>"]
                url = <url>
                push = <refspec>
                fetch = <refspec>
-
 ------------
 
-The name of a file in `$GIT_DIR/branches` directory can be
-specified as an older notation short-hand; the named
-file should contain a single line, a URL in one of the
-above formats, optionally followed by a hash `#` and the
-name of remote head (URL fragment notation).
-`$GIT_DIR/branches/<remote>` file that stores a <url>
-without the fragment is equivalent to have this in the
-corresponding file in the `$GIT_DIR/remotes/` directory.
+
+Named file in `$GIT_DIR/remotes`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can choose to provide the name of a
+file in `$GIT_DIR/remotes`.  The URL
+in this file will be used to access the repository.  The refspec
+in this file will be used as default when you do not
+provide a refspec on the command line.  This file should have the
+following format:
+
+------------
+       URL: one of the above URL format
+       Push: <refspec>
+       Pull: <refspec>
 
 ------------
-       URL: <url>
-       Pull: refs/heads/master:<remote>
 
+`Push:` lines are used by `git-push` and
+`Pull:` lines are used by `git-pull` and `git-fetch`.
+Multiple `Push:` and `Pull:` lines may
+be specified for additional branch mappings.
+
+Named file in `$GIT_DIR/branches`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can choose to provide the name of a
+file in `$GIT_DIR/branches`.
+The URL in this file will be used to access the repository.
+This file should have the following format:
+
+
+------------
+       <url>#<head>
 ------------
 
-while having `<url>#<head>` is equivalent to
+`<url>` is required; `#<head>` is optional.
+When you do not provide a refspec on the command line,
+git will use the following refspec, where `<head>` defaults to `master`,
+and `<repository>` is the name of this file
+you provided in the command line.
 
 ------------
-       URL: <url>
-       Pull: refs/heads/<head>:<remote>
+       refs/heads/<head>:<repository>
 ------------
+
+
+
+
index fd8cdb625afbfc8d8921a5e085abe32e05c2da9a..bfde507e0ec9a5aadf71bfb42470b8669369ad56 100644 (file)
@@ -4252,7 +4252,10 @@ You see, Git is actually the best tool to find out about the source of Git
 itself!
 
 [[glossary]]
-include::glossary.txt[]
+GIT Glossary
+============
+
+include::glossary-content.txt[]
 
 [[git-quick-start]]
 Appendix A: Git Quick Reference
index d8bdf928b1e97864722352955a2e2e37b5c00806..e23b8438c741651f48bbf529f89d0336cc718fed 100644 (file)
@@ -364,7 +364,7 @@ static int guess_repository_type(const char *git_dir)
 }
 
 static const char init_db_usage[] =
-"git-init [-q | --quiet] [--template=<template-directory>] [--shared]";
+"git-init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]]";
 
 /*
  * If you want to, you can share the DB area with any number of branches.
@@ -383,7 +383,12 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
                const char *arg = argv[1];
                if (!prefixcmp(arg, "--template="))
                        template_dir = arg+11;
-               else if (!strcmp(arg, "--shared"))
+               else if (!strcmp(arg, "--bare")) {
+                       static char git_dir[PATH_MAX+1];
+                       is_bare_repository_cfg = 1;
+                       setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir,
+                                               sizeof(git_dir)), 0);
+               } else if (!strcmp(arg, "--shared"))
                        shared_repository = PERM_GROUP;
                else if (!prefixcmp(arg, "--shared="))
                        shared_repository = git_config_perm("arg", arg+9);
index 3a6eb1cb9da752a3a6fa35d781cade9c886e03b9..47b0c37d17101e17e34fab8ed04c3409fe106e87 100755 (executable)
@@ -177,6 +177,7 @@ my %cmd = (
                          'strategy|s=s' => \$_strategy,
                          'local|l' => \$_local,
                          'fetch-all|all' => \$_fetch_all,
+                         'dry-run|n' => \$_dry_run,
                          %fc_opts } ],
        'commit-diff' => [ \&cmd_commit_diff,
                           'Commit a diff between two trees',
@@ -557,6 +558,11 @@ sub cmd_rebase {
                die "Unable to determine upstream SVN information from ",
                    "working tree history\n";
        }
+       if ($_dry_run) {
+               print "Remote Branch: " . $gs->refname . "\n";
+               print "SVN URL: " . $url . "\n";
+               return;
+       }
        if (command(qw/diff-index HEAD --/)) {
                print STDERR "Cannot rebase with uncommited changes:\n";
                command_noisy('status');
@@ -745,7 +751,7 @@ sub cmd_commit_diff {
        my $usage = "Usage: $0 commit-diff -r<revision> ".
                    "<tree-ish> <tree-ish> [<URL>]";
        fatal($usage) if (!defined $ta || !defined $tb);
-       my $svn_path;
+       my $svn_path = '';
        if (!defined $url) {
                my $gs = eval { Git::SVN->new };
                if (!$gs) {
@@ -769,7 +775,6 @@ sub cmd_commit_diff {
                $_message ||= get_commit_entry($tb)->{log};
        }
        my $ra ||= Git::SVN::Ra->new($url);
-       $svn_path ||= $ra->{svn_path};
        my $r = $_revision;
        if ($r eq 'HEAD') {
                $r = $ra->get_latest_revnum;
@@ -1918,7 +1923,7 @@ sub prop_walk {
 
        foreach (sort keys %$dirent) {
                next if $dirent->{$_}->{kind} != $SVN::Node::dir;
-               $self->prop_walk($p . $_, $rev, $sub);
+               $self->prop_walk($self->{path} . $p . $_, $rev, $sub);
        }
 }
 
diff --git a/gitweb/test/Märchen b/gitweb/test/Märchen
deleted file mode 100644 (file)
index 8f7a1d3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Märchen
-Märchen
diff --git a/gitweb/test/file with spaces b/gitweb/test/file with spaces
deleted file mode 100644 (file)
index f108543..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This
-filename
-contains
-spaces.
diff --git a/gitweb/test/file+plus+sign b/gitweb/test/file+plus+sign
deleted file mode 100644 (file)
index fd05278..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-This
-filename
-contains
-+
-plus
-chars.
diff --git a/graph.c b/graph.c
index 26b8c5209e280697cc35ffd5313fe3e79681fc43..edfab2d5b461f5bfd39d32fa843ee59841b4ce0a 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -80,6 +80,27 @@ struct git_graph {
         * This tells us what kind of line graph_next_line() should output.
         */
        enum graph_state state;
+       /*
+        * The output state for the previous line of output.
+        * This is primarily used to determine how the first merge line
+        * should appear, based on the last line of the previous commit.
+        */
+       enum graph_state prev_state;
+       /*
+        * The index of the column that refers to this commit.
+        *
+        * If none of the incoming columns refer to this commit,
+        * this will be equal to num_columns.
+        */
+       int commit_index;
+       /*
+        * The commit_index for the previously displayed commit.
+        *
+        * This is used to determine how the first line of a merge
+        * graph output should appear, based on the last line of the
+        * previous commit.
+        */
+       int prev_commit_index;
        /*
         * The maximum number of columns that can be stored in the columns
         * and new_columns arrays.  This is also half the number of entries
@@ -137,6 +158,9 @@ struct git_graph *graph_init(struct rev_info *opt)
        graph->num_parents = 0;
        graph->expansion_row = 0;
        graph->state = GRAPH_PADDING;
+       graph->prev_state = GRAPH_PADDING;
+       graph->commit_index = 0;
+       graph->prev_commit_index = 0;
        graph->num_columns = 0;
        graph->num_new_columns = 0;
        graph->mapping_size = 0;
@@ -164,6 +188,12 @@ void graph_release(struct git_graph *graph)
        free(graph);
 }
 
+static void graph_update_state(struct git_graph *graph, enum graph_state s)
+{
+       graph->prev_state = graph->state;
+       graph->state = s;
+}
+
 static void graph_ensure_capacity(struct git_graph *graph, int num_columns)
 {
        if (graph->column_capacity >= num_columns)
@@ -342,6 +372,7 @@ static void graph_update_columns(struct git_graph *graph)
                if (col_commit == graph->commit) {
                        int old_mapping_idx = mapping_idx;
                        seen_this = 1;
+                       graph->commit_index = i;
                        for (parent = graph->commit->parents;
                             parent;
                             parent = parent->next) {
@@ -394,6 +425,13 @@ void graph_update(struct git_graph *graph, struct commit *commit)
                        graph->num_parents++;
        }
 
+       /*
+        * Store the old commit_index in prev_commit_index.
+        * graph_update_columns() will update graph->commit_index for this
+        * commit.
+        */
+       graph->prev_commit_index = graph->commit_index;
+
        /*
         * Call graph_update_columns() to update
         * columns, new_columns, and mapping.
@@ -404,21 +442,26 @@ void graph_update(struct git_graph *graph, struct commit *commit)
 
        /*
         * Update graph->state.
+        * Note that we don't call graph_update_state() here, since
+        * we don't want to update graph->prev_state.  No line for
+        * graph->state was ever printed.
         *
         * If the previous commit didn't get to the GRAPH_PADDING state,
         * it never finished its output.  Goto GRAPH_SKIP, to print out
         * a line to indicate that portion of the graph is missing.
         *
-        * Otherwise, if there are 3 or more parents, we need to print
-        * extra rows before the commit, to expand the branch lines around
-        * it and make room for it.
+        * If there are 3 or more parents, we may need to print extra rows
+        * before the commit, to expand the branch lines around it and make
+        * room for it.  We need to do this only if there is a branch row
+        * (or more) to the right of this commit.
         *
         * If there are less than 3 parents, we can immediately print the
         * commit line.
         */
        if (graph->state != GRAPH_PADDING)
                graph->state = GRAPH_SKIP;
-       else if (graph->num_parents >= 3)
+       else if (graph->num_parents >= 3 &&
+                graph->commit_index < (graph->num_columns - 1))
                graph->state = GRAPH_PRE_COMMIT;
        else
                graph->state = GRAPH_COMMIT;
@@ -497,10 +540,11 @@ static void graph_output_skip_line(struct git_graph *graph, struct strbuf *sb)
        strbuf_addstr(sb, "...");
        graph_pad_horizontally(graph, sb);
 
-       if (graph->num_parents >= 3)
-               graph->state = GRAPH_PRE_COMMIT;
+       if (graph->num_parents >= 3 &&
+           graph->commit_index < (graph->num_columns - 1))
+               graph_update_state(graph, GRAPH_PRE_COMMIT);
        else
-               graph->state = GRAPH_COMMIT;
+               graph_update_state(graph, GRAPH_COMMIT);
 }
 
 static void graph_output_pre_commit_line(struct git_graph *graph,
@@ -535,7 +579,22 @@ static void graph_output_pre_commit_line(struct git_graph *graph,
                if (col->commit == graph->commit) {
                        seen_this = 1;
                        strbuf_addf(sb, "| %*s", graph->expansion_row, "");
-               } else if (seen_this) {
+               } else if (seen_this && (graph->expansion_row == 0)) {
+                       /*
+                        * This is the first line of the pre-commit output.
+                        * If the previous commit was a merge commit and
+                        * ended in the GRAPH_POST_MERGE state, all branch
+                        * lines after graph->prev_commit_index were
+                        * printed as "\" on the previous line.  Continue
+                        * to print them as "\" on this line.  Otherwise,
+                        * print the branch lines as "|".
+                        */
+                       if (graph->prev_state == GRAPH_POST_MERGE &&
+                           graph->prev_commit_index < i)
+                               strbuf_addstr(sb, "\\ ");
+                       else
+                               strbuf_addstr(sb, "| ");
+               } else if (seen_this && (graph->expansion_row > 0)) {
                        strbuf_addstr(sb, "\\ ");
                } else {
                        strbuf_addstr(sb, "| ");
@@ -550,7 +609,7 @@ static void graph_output_pre_commit_line(struct git_graph *graph,
         */
        graph->expansion_row++;
        if (graph->expansion_row >= num_expansion_rows)
-               graph->state = GRAPH_COMMIT;
+               graph_update_state(graph, GRAPH_COMMIT);
 }
 
 static void graph_output_commit_char(struct git_graph *graph, struct strbuf *sb)
@@ -625,10 +684,8 @@ void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
                        seen_this = 1;
                        graph_output_commit_char(graph, sb);
 
-                       if (graph->num_parents < 2)
+                       if (graph->num_parents < 3)
                                strbuf_addch(sb, ' ');
-                       else if (graph->num_parents == 2)
-                               strbuf_addstr(sb, "  ");
                        else {
                                int num_dashes =
                                        ((graph->num_parents - 2) * 2) - 1;
@@ -636,8 +693,27 @@ void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
                                        strbuf_addch(sb, '-');
                                strbuf_addstr(sb, ". ");
                        }
-               } else if (seen_this && (graph->num_parents > 1)) {
+               } else if (seen_this && (graph->num_parents > 2)) {
                        strbuf_addstr(sb, "\\ ");
+               } else if (seen_this && (graph->num_parents == 2)) {
+                       /*
+                        * This is a 2-way merge commit.
+                        * There is no GRAPH_PRE_COMMIT stage for 2-way
+                        * merges, so this is the first line of output
+                        * for this commit.  Check to see what the previous
+                        * line of output was.
+                        *
+                        * If it was GRAPH_POST_MERGE, the branch line
+                        * coming into this commit may have been '\',
+                        * and not '|' or '/'.  If so, output the branch
+                        * line as '\' on this line, instead of '|'.  This
+                        * makes the output look nicer.
+                        */
+                       if (graph->prev_state == GRAPH_POST_MERGE &&
+                           graph->prev_commit_index < i)
+                               strbuf_addstr(sb, "\\ ");
+                       else
+                               strbuf_addstr(sb, "| ");
                } else {
                        strbuf_addstr(sb, "| ");
                }
@@ -649,11 +725,11 @@ void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
         * Update graph->state
         */
        if (graph->num_parents > 1)
-               graph->state = GRAPH_POST_MERGE;
+               graph_update_state(graph, GRAPH_POST_MERGE);
        else if (graph_is_mapping_correct(graph))
-               graph->state = GRAPH_PADDING;
+               graph_update_state(graph, GRAPH_PADDING);
        else
-               graph->state = GRAPH_COLLAPSING;
+               graph_update_state(graph, GRAPH_COLLAPSING);
 }
 
 void graph_output_post_merge_line(struct git_graph *graph, struct strbuf *sb)
@@ -679,9 +755,7 @@ void graph_output_post_merge_line(struct git_graph *graph, struct strbuf *sb)
                        strbuf_addch(sb, '|');
                        for (j = 0; j < graph->num_parents - 1; j++)
                                strbuf_addstr(sb, "\\ ");
-                       if (graph->num_parents == 2)
-                               strbuf_addch(sb, ' ');
-               } else if (seen_this && (graph->num_parents > 2)) {
+               } else if (seen_this) {
                        strbuf_addstr(sb, "\\ ");
                } else {
                        strbuf_addstr(sb, "| ");
@@ -694,9 +768,9 @@ void graph_output_post_merge_line(struct git_graph *graph, struct strbuf *sb)
         * Update graph->state
         */
        if (graph_is_mapping_correct(graph))
-               graph->state = GRAPH_PADDING;
+               graph_update_state(graph, GRAPH_PADDING);
        else
-               graph->state = GRAPH_COLLAPSING;
+               graph_update_state(graph, GRAPH_COLLAPSING);
 }
 
 void graph_output_collapsing_line(struct git_graph *graph, struct strbuf *sb)
@@ -801,7 +875,7 @@ void graph_output_collapsing_line(struct git_graph *graph, struct strbuf *sb)
         * Otherwise, we need to collapse some branch lines together.
         */
        if (graph_is_mapping_correct(graph))
-               graph->state = GRAPH_PADDING;
+               graph_update_state(graph, GRAPH_PADDING);
 }
 
 int graph_next_line(struct git_graph *graph, struct strbuf *sb)
@@ -865,6 +939,11 @@ void graph_padding_line(struct git_graph *graph, struct strbuf *sb)
        }
 
        graph_pad_horizontally(graph, sb);
+
+       /*
+        * Update graph->prev_state since we have output a padding line
+        */
+       graph->prev_state = GRAPH_PADDING;
 }
 
 int graph_is_commit_finished(struct git_graph const *graph)
index f173dcd64f73bddc891808c96c43407533aac1f5..c93e781c3b503bae6ee7c6735fa058aa0a98e026 100644 (file)
@@ -2277,6 +2277,7 @@ int main(int argc, char **argv)
        signal(SIGINT, remove_locks_on_signal);
        signal(SIGHUP, remove_locks_on_signal);
        signal(SIGQUIT, remove_locks_on_signal);
+       signal(SIGTERM, remove_locks_on_signal);
 
        /* Check whether the remote has server info files */
        remote->can_update_info_refs = 0;
index cfc7335347c4875537d1c45c909921908f3d4f10..4023797b00fe21ecbabe3407ef8a12fca0690607 100644 (file)
@@ -135,6 +135,9 @@ static int lock_file(struct lock_file *lk, const char *path)
        if (0 <= lk->fd) {
                if (!lock_file_list) {
                        signal(SIGINT, remove_lock_file_on_signal);
+                       signal(SIGHUP, remove_lock_file_on_signal);
+                       signal(SIGTERM, remove_lock_file_on_signal);
+                       signal(SIGQUIT, remove_lock_file_on_signal);
                        atexit(remove_lock_file);
                }
                lk->owner = getpid();
index d05b633b64ac6440f8c86405beb13df281bde989..97e61efaff240a60ecd25ba68d391e75ed7ce958 100644 (file)
@@ -565,7 +565,7 @@ sub config {
                my $E = shift;
                if ($E->value() == 1) {
                        # Key not found.
-                       return undef;
+                       return;
                } else {
                        throw $E;
                }
@@ -719,9 +719,8 @@ sub ident_person {
 
 =item hash_object ( TYPE, FILENAME )
 
-Compute the SHA1 object id of the given C<FILENAME> (or data waiting in
-C<FILEHANDLE>) considering it is of the C<TYPE> object type (C<blob>,
-C<commit>, C<tree>).
+Compute the SHA1 object id of the given C<FILENAME> considering it is
+of the C<TYPE> object type (C<blob>, C<commit>, C<tree>).
 
 The method can be called without any instance or on a specified Git repository,
 it makes zero difference.
index ac9a8e7e323bb7b0728b2b199ab4f4a9bc5ce22f..8e5fbb619295fe3e4d950e8926d8034d6f825e41 100644 (file)
@@ -893,6 +893,15 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
        if (ce_uptodate(ce))
                return ce;
 
+       /*
+        * CE_VALID means the user promised us that the change to
+        * the work tree does not matter and told us not to worry.
+        */
+       if (!ignore_valid && (ce->ce_flags & CE_VALID)) {
+               ce_mark_uptodate(ce);
+               return ce;
+       }
+
        if (lstat(ce->name, &st) < 0) {
                if (err)
                        *err = errno;
index b0289e397ab683c8c5a02ce649d7790d6a876d16..d31887f9bf35a7fa9e31b1eb859a9cf21c918d6c 100755 (executable)
@@ -79,6 +79,17 @@ test_expect_success 'GIT_DIR bare' '
        check_config git-dir-bare.git true unset
 '
 
+test_expect_success 'init --bare' '
+
+       (
+               unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
+               mkdir git-init-bare.git &&
+               cd git-init-bare.git &&
+               git init --bare
+       ) &&
+       check_config git-init-bare.git true unset
+'
+
 test_expect_success 'GIT_DIR non-bare' '
 
        (
index 3531a992a9a50e25a1585435e024097c7028af27..46ec1ce8aaa0305f6b4569664de041137db137d7 100755 (executable)
@@ -212,4 +212,18 @@ test_expect_success 'do not fire editor in the presence of conflicts' '
        test "`cat .git/result`" = "editor not started"
 '
 
+pwd=`pwd`
+cat > .git/FAKE_EDITOR << EOF
+#! /bin/sh
+# kill -TERM command added below.
+EOF
+
+test_expect_success 'a SIGTERM should break locks' '
+       echo >>negative &&
+       sh -c '\''
+         echo kill -TERM $$ >> .git/FAKE_EDITOR
+         GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1  # should fail
+       ! test -f .git/index.lock
+'
+
 test_done