diff options
153 files changed, 2937 insertions, 555 deletions
diff --git a/Documentation/RelNotes-1.5.4.5.txt b/Documentation/RelNotes-1.5.4.5.txt index fe768d497f..0282341398 100644 --- a/Documentation/RelNotes-1.5.4.5.txt +++ b/Documentation/RelNotes-1.5.4.5.txt @@ -4,6 +4,13 @@ GIT v1.5.4.5 Release Notes Fixes since v1.5.4.4 -------------------- + * "git fetch there" when the URL information came from the Cogito style + branches/there file did not update refs/heads/there (regression in + 1.5.4). + + * Bogus refspec configuration such as "remote.there.fetch = =" were not + detected as errors (regressionin 1.5.4). + * You couldn't specify a custom editor whose path contains a whitespace via GIT_EDITOR (and core.editor). @@ -46,8 +53,4 @@ Fixes since v1.5.4.4 * "git rebase -m" triggered pre-commit verification, which made "rebase --continue" impossible. --- -exec >/var/tmp/1 -echo O=$(git describe maint) -O=v1.5.4.4-25-ga6f7728 -git shortlog --no-merges $O..maint +As usual, it also comes with many documentation fixes and clarifications. diff --git a/Documentation/RelNotes-1.5.5.txt b/Documentation/RelNotes-1.5.5.txt index e31ae6a293..2932212488 100644 --- a/Documentation/RelNotes-1.5.5.txt +++ b/Documentation/RelNotes-1.5.5.txt @@ -6,7 +6,7 @@ Updates since v1.5.4 (subsystems) - * Comes with git-gui 0.9.3. + * Comes with git-gui 0.10.1 (portability) @@ -79,8 +79,9 @@ Updates since v1.5.4 * "git branch" (and "git checkout -b") to branch from a local branch can optionally set "branch.<name>.merge" to mark the new branch to build on the other local branch, when "branch.autosetupmerge" is set to - "always". By default, this does not happen when branching from a local - branch. + "always", or when passing the command line option "--track" (this option + was ignored when branching from local branches). By default, this does + not happen when branching from a local branch. * "git checkout" to switch to a branch that has "branch.<name>.merge" set (i.e. marked to build on another branch) reports how much the branch @@ -124,6 +125,9 @@ Updates since v1.5.4 * "git gc" now automatically prunes unreachable objects that are two weeks old or older. + * "git gc --auto" can be disabled more easily by just setting gc.auto + to zero. It also tolerates more packfiles by default. + * "git grep" now knows "--name-only" is a synonym for the "-l" option. * "git help <alias>" now reports "'git <alias>' is alias to <what>", @@ -162,8 +166,8 @@ Updates since v1.5.4 symmetric difference between the HEAD version and the work tree version of the submodule commits. - * Various "git cvsimport", "git cvsexportcommit", "git svn" and - "git p4" improvements. + * Various "git cvsimport", "git cvsexportcommit", "git cvsserver", + "git svn" and "git p4" improvements. (internal) @@ -199,8 +203,5 @@ this release, unless otherwise noted. * "git-rebase --abort" did not go back to the right location if "git-reset" was run during the "git-rebase" session. ---- -exec >/var/tmp/1 -O=v1.5.4.4-620-gc817faa -echo O=`git describe refs/heads/master` -git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint + * "git imap-send" without setting imap.host did not error out but + segfaulted. diff --git a/Documentation/config.txt b/Documentation/config.txt index 0865f4e01a..04c01c5fdc 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -582,7 +582,7 @@ 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. The - default value is 20. Setting this to 0 disables it. + default value is 50. Setting this to 0 disables it. gc.packrefs:: `git gc` does not run `git pack-refs` in a bare repository by @@ -661,6 +661,13 @@ gitcvs.dbuser, gitcvs.dbpass:: 'gitcvs.dbuser' supports variable substitution (see linkgit:git-cvsserver[1] for details). +gitcvs.dbTableNamePrefix:: + Database table name prefix. Prepended to the names of any + database tables used, allowing a single database to be used + for several repositories. Supports variable substitution (see + linkgit:git-cvsserver[1] for details). Any non-alphabetic + characters will be replaced with underscores. + All gitcvs variables except for 'gitcvs.allbinary' can also be specified as 'gitcvs.<access_method>.<varname>' (where 'access_method' is one of "ext" and "pserver") to make them apply only for the given diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index c751a17d07..35e67a06e4 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -226,6 +226,12 @@ diff:: This lets you review what will be committed (i.e. between HEAD and index). +Bugs +---- +The interactive mode does not work with files whose names contain +characters that need C-quoting. `core.quotepath` configuration can be +used to work this limitation around to some degree, but backslash, +double-quote and control characters will still have problems. See Also -------- diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 4014e7256d..e11cddbfc9 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -3,7 +3,7 @@ git-checkout(1) NAME ---- -git-checkout - Checkout and switch to a branch +git-checkout - Checkout a branch or paths to the working tree SYNOPSIS -------- diff --git a/Documentation/git-cvsserver.txt b/Documentation/git-cvsserver.txt index d3e99931d7..9cec8021b8 100644 --- a/Documentation/git-cvsserver.txt +++ b/Documentation/git-cvsserver.txt @@ -227,6 +227,11 @@ gitcvs.dbpass:: Database password. Only useful if setting `dbdriver`, since SQLite has no concept of database passwords. +gitcvs.dbTableNamePrefix:: + Database table name prefix. Supports variable substitution + (see below). Any non-alphabetic characters will be replaced + with underscores. + All variables can also be set per access method, see <<configaccessmethod,above>>. Variable substitution diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 96f6767075..c29a4f8126 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -385,6 +385,9 @@ new commit. Omitting the `from` command in the first commit of a new branch will cause fast-import to create that commit with no ancestor. This tends to be desired only for the initial commit of a project. +If the frontend creates all files from scratch when making a new +branch, a `merge` command may be used instead of `from` to start +the commit with an empty tree. Omitting the `from` command on existing branches is usually desired, as the current commit on that branch is automatically assumed to be the first ancestor of the new commit. @@ -427,13 +430,15 @@ existing value of the branch. `merge` ^^^^^^^ -Includes one additional ancestor commit, and makes the current -commit a merge commit. An unlimited number of `merge` commands per +Includes one additional ancestor commit. If the `from` command is +omitted when creating a new branch, the first `merge` commit will be +the first ancestor of the current commit, and the branch will start +out with no files. An unlimited number of `merge` commands per commit are permitted by fast-import, thereby establishing an n-way merge. However Git's other tools never create commits with more than 15 additional ancestors (forming a 16-way merge). For this reason it is suggested that frontends do not use more than 15 `merge` -commands per commit. +commands per commit; 16, if starting a new, empty branch. Here `<committish>` is any of the commit specification expressions also accepted by `from` (see above). diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 543a1cf105..2a78549be5 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -25,7 +25,7 @@ Otherwise, all information (including original commit times or merge information) will be preserved. The command will only rewrite the _positive_ refs mentioned in the -command line (i.e. if you pass 'a..b', only 'b' will be rewritten). +command line (e.g. if you pass 'a..b', only 'b' will be rewritten). If you specify no filters, the commits will be recommitted without any changes, which would normally have no effect. Nevertheless, this may be useful in the future for compensating for some git bugs or such, @@ -42,7 +42,7 @@ Always verify that the rewritten version is correct: The original refs, if different from the rewritten ones, will be stored in the namespace 'refs/original/'. -Note that since this operation is extensively I/O expensive, it might +Note that since this operation is very I/O expensive, it might be a good idea to redirect the temporary directory off-disk with the '-d' option, e.g. on tmpfs. Reportedly the speedup is very noticeable. @@ -51,14 +51,15 @@ Filters ~~~~~~~ The filters are applied in the order as listed below. The <command> -argument is always evaluated in shell using the 'eval' command (with the -notable exception of the commit filter, for technical reasons). +argument is always evaluated in the shell context using the 'eval' command +(with the notable exception of the commit filter, for technical reasons). Prior to that, the $GIT_COMMIT environment variable will be set to contain the id of the commit being rewritten. Also, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_AUTHOR_DATE, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, -and GIT_COMMITTER_DATE are set according to the current commit. If any -evaluation of <command> returns a non-zero exit status, the whole operation -will be aborted. +and GIT_COMMITTER_DATE are set according to the current commit. The values +of these variables after the filters have run, are used for the new commit. +If any evaluation of <command> returns a non-zero exit status, the whole +operation will be aborted. A 'map' function is available that takes an "original sha1 id" argument and outputs a "rewritten sha1 id" if the commit has been already @@ -71,9 +72,9 @@ OPTIONS ------- --env-filter <command>:: - This is the filter for modifying the environment in which - the commit will be performed. Specifically, you might want - to rewrite the author/committer name/email/time environment + This filter may be used if you only need to modify the environment + in which the commit will be performed. Specifically, you might + want to rewrite the author/committer name/email/time environment variables (see linkgit:git-commit[1] for details). Do not forget to re-export the variables. @@ -149,7 +150,7 @@ definition impossible to preserve signatures at any rate.) -d <directory>:: Use this option to set the path to the temporary directory used for rewriting. When applying a tree filter, the command needs to - temporary checkout the tree to some directory, which may consume + temporarily check out the tree to some directory, which may consume considerable space in case of large projects. By default it does this in the '.git-rewrite/' directory but you can override that choice by this parameter. diff --git a/Documentation/git-gc.txt b/Documentation/git-gc.txt index 229a7c9b30..d424a4ecbe 100644 --- a/Documentation/git-gc.txt +++ b/Documentation/git-gc.txt @@ -19,8 +19,15 @@ created from prior invocations of linkgit:git-add[1]. Users are encouraged to run this task on a regular basis within each repository to maintain good disk space utilization and good -operating performance. Some git commands may automatically run -`git-gc`; see the `--auto` flag below for details. +operating performance. + +Some git commands may automatically run `git-gc`; see the `--auto` flag +below for details. If you know what you're doing and all you want is to +disable this behavior permanently without further considerations, just do: + +---------------------- +$ git config --global gc.auto 0 +---------------------- OPTIONS ------- diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt index eed0a94c6e..3a1be08186 100644 --- a/Documentation/git-pack-objects.txt +++ b/Documentation/git-pack-objects.txt @@ -22,8 +22,9 @@ archive with specified base-name, or to the standard output. A packed archive is an efficient way to transfer set of objects between two repositories, and also is an archival format which is efficient to access. The packed archive format (.pack) is -designed to be unpackable without having anything else, but for -random access, accompanied with the pack index file (.idx). +designed to be self contained so that it can be unpacked without +any further information, but for fast, random access to the objects +in the pack, a pack index file (.idx) will be generated. Placing both in the pack/ subdirectory of $GIT_OBJECT_DIRECTORY (or any of the directories on $GIT_ALTERNATE_OBJECT_DIRECTORIES) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 336d797e80..9d0a10c562 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -216,6 +216,9 @@ sendemail.chainreplyto:: sendemail.smtpserver:: Default SMTP server to use. +sendemail.smtpserverport:: + Default SMTP server port to use. + sendemail.smtpuser:: Default SMTP-AUTH username. diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index b62a3d1c58..c22fb71176 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -26,6 +26,9 @@ creates a 'tag' object, and requires the tag message. Unless `-m <msg>` or `-F <file>` is given, an editor is started for the user to type in the tag message. +If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <key-id>` +are absent, `-a` is implied. + Otherwise just the SHA1 object name of the commit object is written (i.e. a lightweight tag). @@ -68,10 +71,14 @@ OPTIONS Use the given tag message (instead of prompting). If multiple `-m` options are given, there values are concatenated as separate paragraphs. + Implies `-a` if none of `-a`, `-s`, or `-u <key-id>` + is given. -F <file>:: Take the tag message from the given file. Use '-' to read the message from the standard input. + Implies `-a` if none of `-a`, `-s`, or `-u <key-id>` + is given. CONFIGURATION ------------- diff --git a/Documentation/git.txt b/Documentation/git.txt index 3ed24d449a..336fe99cc7 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,15 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.5.4.4/git.html[documentation for release 1.5.4.4] +* link:v1.5.5/git.html[documentation for release 1.5.5] * release notes for + link:RelNotes-1.5.5.txt[1.5.5]. + +* link:v1.5.4.5/git.html[documentation for release 1.5.4.5] + +* release notes for + link:RelNotes-1.5.4.5.txt[1.5.4.5], link:RelNotes-1.5.4.4.txt[1.5.4.4], link:RelNotes-1.5.4.3.txt[1.5.4.3], link:RelNotes-1.5.4.2.txt[1.5.4.2], diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 84ec9623a2..04ca63ca3d 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -63,6 +63,13 @@ path in question, and its parent directories (the further the directory that contains `.gitattributes` is from the path in question, the lower its precedence). +If you wish to affect only a single repository (i.e., to assign +attributes to files that are particular to one user's workflow), then +attributes should be placed in the `$GIT_DIR/info/attributes` file. +Attributes which should be version-controlled and distributed to other +repositories (i.e., attributes of interest to all users) should go into +`.gitattributes` files. + Sometimes you would need to override an setting of an attribute for a path to `unspecified` state. This can be done by listing the name of the attribute prefixed with an exclamation point `!`. diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index e847b3ba63..613dca006f 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -38,6 +38,18 @@ precedence, the last matching pattern decides the outcome): * Patterns read from the file specified by the configuration variable 'core.excludesfile'. +Which file to place a pattern in depends on how the pattern is meant to +be used. Patterns which should be version-controlled and distributed to +other repositories via clone (i.e., files that all developers will want +to ignore) should go into a `.gitignore` file. Patterns which are +specific to a particular repository but which do not need to be shared +with other related repositories (e.g., auxiliary files that live inside +the repository but are specific to one user's workflow) should go into +the `$GIT_DIR/info/exclude` file. Patterns which a user wants git to +ignore in all situations (e.g., backup or temporary files generated by +the user's editor of choice) generally go into a file specified by +`core.excludesfile` in the user's `~/.gitconfig`. + The underlying git plumbing tools, such as linkgit:git-ls-files[1] and linkgit:git-read-tree[1], read `gitignore` patterns specified by command-line options, or from diff --git a/Documentation/glossary.txt b/Documentation/glossary.txt index ab4caf4e26..51b63532b6 100644 --- a/Documentation/glossary.txt +++ b/Documentation/glossary.txt @@ -45,9 +45,12 @@ GIT Glossary "changesets" with git. [[def_checkout]]checkout:: - The action of updating the <<def_working_tree,working tree>> to a - <<def_revision,revision>> which was stored in the - <<def_object_database,object database>>. + The action of updating all or part of the + <<def_working_tree,working tree>> with a <<def_tree_object,tree object>> + or <<def_blob_object,blob>> from the + <<def_object_database,object database>>, and updating the + <<def_index,index>> and <<def_HEAD,HEAD>> if the whole working tree has + been pointed at a new <<def_branch,branch>>. [[def_cherry-picking]]cherry-picking:: In <<def_SCM,SCM>> jargon, "cherry pick" means to choose a subset of diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt index 7df0266ba8..1276f858ad 100644 --- a/Documentation/merge-strategies.txt +++ b/Documentation/merge-strategies.txt @@ -33,3 +33,10 @@ ours:: merge is always the current branch head. It is meant to be used to supersede old development history of side branches. + +subtree:: + This is a modified recursive strategy. When merging trees A and + B, if B corresponds to a subtree of A, B is first adjusted to + match the tree structure of A, instead of reading the trees at + the same level. This adjustment is also done to the common + ancestor tree. diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 0193c3ce58..e8bea3e18e 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -123,3 +123,4 @@ The placeholders are: - '%Creset': reset color - '%m': left, right or boundary mark - '%n': newline +- '%x00': print a byte from a hex code diff --git a/Documentation/technical/pack-format.txt b/Documentation/technical/pack-format.txt index aa87756a55..1803e64e46 100644 --- a/Documentation/technical/pack-format.txt +++ b/Documentation/technical/pack-format.txt @@ -103,10 +103,24 @@ Pack file entry: <+ packed object data: If it is not DELTA, then deflated bytes (the size above is the size before compression). - If it is DELTA, then + If it is REF_DELTA, then 20-byte base object name SHA1 (the size above is the size of the delta data that follows). delta data, deflated. + If it is OFS_DELTA, then + n-byte offset (see below) interpreted as a negative + offset from the type-byte of the header of the + ofs-delta entry (the size above is the size of + the delta data that follows). + delta data, deflated. + + offset encoding: + n bytes with MSB set in all but the last one. + The offset is then the number constructed by + concatenating the lower 7 bit of each byte, and + for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1)) + to the result. + = Version 2 pack-*.idx files support packs larger than 4 GiB, and diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 40b0de0877..565aeb9804 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -4144,7 +4144,7 @@ commits one by one with the function `get_revision()`. If you are interested in more details of the revision walking process, just have a look at the first implementation of `cmd_log()`; call -`git-show v1.3.0~155^2~4` and scroll down to that function (note that you +`git-show v1.3.0{tilde}155^2{tilde}4` and scroll down to that function (note that you no longer need to call `setup_pager()` directly). Nowadays, `git log` is a builtin, which means that it is _contained_ in the diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 6ddf04d216..f60bab896b 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.5.4.GIT +DEF_VER=v1.5.5.GIT LF=' ' @@ -232,59 +232,84 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__ BASIC_CFLAGS = BASIC_LDFLAGS = -SCRIPT_SH = \ - git-bisect.sh \ - git-clone.sh \ - git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \ - git-pull.sh git-rebase.sh git-rebase--interactive.sh \ - git-repack.sh git-request-pull.sh \ - git-sh-setup.sh \ - git-am.sh \ - git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ - git-merge-resolve.sh \ - git-lost-found.sh git-quiltimport.sh git-submodule.sh \ - git-filter-branch.sh \ - git-stash.sh \ - git-web--browse.sh - -SCRIPT_PERL = \ - git-add--interactive.perl \ - git-archimport.perl git-cvsimport.perl git-relink.perl \ - git-cvsserver.perl git-cvsexportcommit.perl \ - git-send-email.perl git-svn.perl +SCRIPT_SH += git-am.sh +SCRIPT_SH += git-bisect.sh +SCRIPT_SH += git-clone.sh +SCRIPT_SH += git-filter-branch.sh +SCRIPT_SH += git-lost-found.sh +SCRIPT_SH += git-merge-octopus.sh +SCRIPT_SH += git-merge-one-file.sh +SCRIPT_SH += git-merge-resolve.sh +SCRIPT_SH += git-merge.sh +SCRIPT_SH += git-merge-stupid.sh +SCRIPT_SH += git-mergetool.sh +SCRIPT_SH += git-parse-remote.sh +SCRIPT_SH += git-pull.sh +SCRIPT_SH += git-quiltimport.sh +SCRIPT_SH += git-rebase--interactive.sh +SCRIPT_SH += git-rebase.sh +SCRIPT_SH += git-repack.sh +SCRIPT_SH += git-request-pull.sh +SCRIPT_SH += git-sh-setup.sh +SCRIPT_SH += git-stash.sh +SCRIPT_SH += git-submodule.sh +SCRIPT_SH += git-web--browse.sh + +SCRIPT_PERL += git-add--interactive.perl +SCRIPT_PERL += git-archimport.perl +SCRIPT_PERL += git-cvsexportcommit.perl +SCRIPT_PERL += git-cvsimport.perl +SCRIPT_PERL += git-cvsserver.perl +SCRIPT_PERL += git-relink.perl +SCRIPT_PERL += git-send-email.perl +SCRIPT_PERL += git-svn.perl SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ $(patsubst %.perl,%,$(SCRIPT_PERL)) \ git-instaweb -# ... and all the rest that could be moved out of bindir to gitexecdir -PROGRAMS = \ - git-fetch-pack$X \ - git-hash-object$X git-index-pack$X \ - git-fast-import$X \ - git-daemon$X \ - git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \ - git-receive-pack$X \ - git-send-pack$X git-shell$X \ - git-show-index$X \ - git-unpack-file$X \ - git-update-server-info$X \ - git-upload-pack$X \ - git-pack-redundant$X git-var$X \ - git-merge-tree$X git-imap-send$X \ - $(EXTRA_PROGRAMS) - # Empty... EXTRA_PROGRAMS = +# ... and all the rest that could be moved out of bindir to gitexecdir +PROGRAMS += $(EXTRA_PROGRAMS) +PROGRAMS += git-daemon$X +PROGRAMS += git-fast-import$X +PROGRAMS += git-fetch-pack$X +PROGRAMS += git-hash-object$X +PROGRAMS += git-imap-send$X +PROGRAMS += git-index-pack$X +PROGRAMS += git-merge-index$X +PROGRAMS += git-merge-tree$X +PROGRAMS += git-mktag$X +PROGRAMS += git-mktree$X +PROGRAMS += git-pack-redundant$X +PROGRAMS += git-patch-id$X +PROGRAMS += git-receive-pack$X +PROGRAMS += git-send-pack$X +PROGRAMS += git-shell$X +PROGRAMS += git-show-index$X +PROGRAMS += git-unpack-file$X +PROGRAMS += git-update-server-info$X +PROGRAMS += git-upload-pack$X +PROGRAMS += git-var$X + # List built-in command $C whose implementation cmd_$C() is not in # builtin-$C.o but is linked in as part of some other command. -BUILT_INS = \ - git-format-patch$X git-show$X git-whatchanged$X git-cherry$X \ - git-get-tar-commit-id$X git-init$X git-repo-config$X \ - git-fsck-objects$X git-cherry-pick$X git-peek-remote$X git-status$X \ - git-merge-subtree$X \ - $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) +BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS)) + +BUILT_INS += git-cherry-pick$X +BUILT_INS += git-cherry$X +BUILT_INS += git-format-patch$X +BUILT_INS += git-fsck-objects$X +BUILT_INS += git-get-tar-commit-id$X +BUILT_INS += git-init$X +BUILT_INS += git-merge-subtree$X +BUILT_INS += git-peek-remote$X +BUILT_INS += git-repo-config$X +BUILT_INS += git-show$X +BUILT_INS += git-status$X +BUILT_INS += git-whatchanged$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS) @@ -305,113 +330,214 @@ export PERL_PATH LIB_FILE=libgit.a XDIFF_LIB=xdiff/lib.a -LIB_H = \ - archive.h blob.h cache.h cache-tree.h commit.h csum-file.h delta.h grep.h \ - diff.h object.h pack.h pkt-line.h quote.h refs.h list-objects.h sideband.h \ - run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \ - tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \ - utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \ - mailmap.h remote.h parse-options.h transport.h diffcore.h hash.h ll-merge.h fsck.h \ - pack-revindex.h - -DIFF_OBJS = \ - diff.o diff-lib.o diffcore-break.o diffcore-order.o \ - diffcore-pickaxe.o diffcore-rename.o tree-diff.o combine-diff.o \ - diffcore-delta.o log-tree.o - -LIB_OBJS = \ - blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \ - date.o diff-delta.o entry.o exec_cmd.o ident.o \ - pretty.o interpolate.o hash.o \ - lockfile.o \ - patch-ids.o \ - object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \ - sideband.o reachable.o reflog-walk.o \ - quote.o read-cache.o refs.o run-command.o dir.o \ - server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \ - tag.o tree.o usage.o config.o environment.o ctype.o copy.o \ - revision.o pager.o tree-walk.o xdiff-interface.o \ - write_or_die.o trace.o list-objects.o grep.o match-trees.o \ - alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ - color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ - convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \ - transport.o bundle.o walker.o parse-options.o ws.o archive.o branch.o \ - ll-merge.o alias.o fsck.o pack-revindex.o - -BUILTIN_OBJS = \ - builtin-add.o \ - builtin-annotate.o \ - builtin-apply.o \ - builtin-archive.o \ - builtin-blame.o \ - builtin-branch.o \ - builtin-bundle.o \ - builtin-cat-file.o \ - builtin-check-attr.o \ - builtin-checkout.o \ - builtin-checkout-index.o \ - builtin-check-ref-format.o \ - builtin-clean.o \ - builtin-commit.o \ - builtin-commit-tree.o \ - builtin-count-objects.o \ - builtin-describe.o \ - builtin-diff.o \ - builtin-diff-files.o \ - builtin-diff-index.o \ - builtin-diff-tree.o \ - builtin-fast-export.o \ - builtin-fetch.o \ - builtin-fetch-pack.o \ - builtin-fetch--tool.o \ - builtin-fmt-merge-msg.o \ - builtin-for-each-ref.o \ - builtin-fsck.o \ - builtin-gc.o \ - builtin-grep.o \ - builtin-init-db.o \ - builtin-log.o \ - builtin-ls-files.o \ - builtin-ls-tree.o \ - builtin-ls-remote.o \ - builtin-mailinfo.o \ - builtin-mailsplit.o \ - builtin-merge-base.o \ - builtin-merge-file.o \ - builtin-merge-ours.o \ - builtin-merge-recursive.o \ - builtin-mv.o \ - builtin-name-rev.o \ - builtin-pack-objects.o \ - builtin-prune.o \ - builtin-prune-packed.o \ - builtin-push.o \ - builtin-read-tree.o \ - builtin-reflog.o \ - builtin-remote.o \ - builtin-send-pack.o \ - builtin-config.o \ - builtin-rerere.o \ - builtin-reset.o \ - builtin-rev-list.o \ - builtin-rev-parse.o \ - builtin-revert.o \ - builtin-rm.o \ - builtin-shortlog.o \ - builtin-show-branch.o \ - builtin-stripspace.o \ - builtin-symbolic-ref.o \ - builtin-tag.o \ - builtin-tar-tree.o \ - builtin-unpack-objects.o \ - builtin-update-index.o \ - builtin-update-ref.o \ - builtin-upload-archive.o \ - builtin-verify-pack.o \ - builtin-verify-tag.o \ - builtin-write-tree.o \ - builtin-show-ref.o \ - builtin-pack-refs.o +LIB_H += archive.h +LIB_H += attr.h +LIB_H += blob.h +LIB_H += builtin.h +LIB_H += cache.h +LIB_H += cache-tree.h +LIB_H += commit.h +LIB_H += csum-file.h +LIB_H += decorate.h +LIB_H += delta.h +LIB_H += diffcore.h +LIB_H += diff.h +LIB_H += dir.h +LIB_H += fsck.h +LIB_H += git-compat-util.h +LIB_H += grep.h +LIB_H += hash.h +LIB_H += list-objects.h +LIB_H += ll-merge.h +LIB_H += log-tree.h +LIB_H += mailmap.h +LIB_H += object.h +LIB_H += pack.h +LIB_H += pack-revindex.h +LIB_H += parse-options.h +LIB_H += patch-ids.h +LIB_H += path-list.h +LIB_H += pkt-line.h +LIB_H += progress.h +LIB_H += quote.h +LIB_H += reflog-walk.h +LIB_H += refs.h +LIB_H += remote.h +LIB_H += revision.h +LIB_H += run-command.h +LIB_H += sideband.h +LIB_H += strbuf.h +LIB_H += tag.h +LIB_H += transport.h +LIB_H += tree.h +LIB_H += tree-walk.h +LIB_H += unpack-trees.h +LIB_H += utf8.h + +LIB_OBJS += alias.o +LIB_OBJS += alloc.o +LIB_OBJS += archive.o +LIB_OBJS += archive-tar.o +LIB_OBJS += archive-zip.o +LIB_OBJS += attr.o +LIB_OBJS += base85.o +LIB_OBJS += blob.o +LIB_OBJS += branch.o +LIB_OBJS += bundle.o +LIB_OBJS += cache-tree.o +LIB_OBJS += color.o +LIB_OBJS += combine-diff.o +LIB_OBJS += commit.o +LIB_OBJS += config.o +LIB_OBJS += connect.o +LIB_OBJS += convert.o +LIB_OBJS += copy.o +LIB_OBJS += csum-file.o +LIB_OBJS += ctype.o +LIB_OBJS += date.o +LIB_OBJS += decorate.o +LIB_OBJS += diffcore-break.o +LIB_OBJS += diffcore-delta.o +LIB_OBJS += diffcore-order.o +LIB_OBJS += diffcore-pickaxe.o +LIB_OBJS += diffcore-rename.o +LIB_OBJS += diff-delta.o +LIB_OBJS += diff-lib.o +LIB_OBJS += diff.o +LIB_OBJS += dir.o +LIB_OBJS += entry.o +LIB_OBJS += environment.o +LIB_OBJS += exec_cmd.o +LIB_OBJS += fsck.o +LIB_OBJS += grep.o +LIB_OBJS += hash.o +LIB_OBJS += help.o +LIB_OBJS += ident.o +LIB_OBJS += interpolate.o +LIB_OBJS += list-objects.o +LIB_OBJS += ll-merge.o +LIB_OBJS += lockfile.o +LIB_OBJS += log-tree.o +LIB_OBJS += mailmap.o +LIB_OBJS += match-trees.o +LIB_OBJS += merge-file.o +LIB_OBJS += object.o +LIB_OBJS += pack-check.o +LIB_OBJS += pack-revindex.o +LIB_OBJS += pack-write.o +LIB_OBJS += pager.o +LIB_OBJS += parse-options.o +LIB_OBJS += patch-delta.o +LIB_OBJS += patch-ids.o +LIB_OBJS += path-list.o +LIB_OBJS += path.o +LIB_OBJS += pkt-line.o +LIB_OBJS += pretty.o +LIB_OBJS += progress.o +LIB_OBJS += quote.o +LIB_OBJS += reachable.o +LIB_OBJS += read-cache.o +LIB_OBJS += reflog-walk.o +LIB_OBJS += refs.o +LIB_OBJS += remote.o +LIB_OBJS += revision.o +LIB_OBJS += run-command.o +LIB_OBJS += server-info.o +LIB_OBJS += setup.o +LIB_OBJS += sha1_file.o +LIB_OBJS += sha1_name.o +LIB_OBJS += shallow.o +LIB_OBJS += sideband.o +LIB_OBJS += strbuf.o +LIB_OBJS += symlinks.o +LIB_OBJS += tag.o +LIB_OBJS += trace.o +LIB_OBJS += transport.o +LIB_OBJS += tree-diff.o +LIB_OBJS += tree.o +LIB_OBJS += tree-walk.o +LIB_OBJS += unpack-trees.o +LIB_OBJS += usage.o +LIB_OBJS += utf8.o +LIB_OBJS += walker.o +LIB_OBJS += write_or_die.o +LIB_OBJS += ws.o +LIB_OBJS += wt-status.o +LIB_OBJS += xdiff-interface.o + +BUILTIN_OBJS += builtin-add.o +BUILTIN_OBJS += builtin-annotate.o +BUILTIN_OBJS += builtin-apply.o +BUILTIN_OBJS += builtin-archive.o +BUILTIN_OBJS += builtin-blame.o +BUILTIN_OBJS += builtin-branch.o +BUILTIN_OBJS += builtin-bundle.o +BUILTIN_OBJS += builtin-cat-file.o +BUILTIN_OBJS += builtin-check-attr.o +BUILTIN_OBJS += builtin-check-ref-format.o +BUILTIN_OBJS += builtin-checkout-index.o +BUILTIN_OBJS += builtin-checkout.o +BUILTIN_OBJS += builtin-clean.o +BUILTIN_OBJS += builtin-commit-tree.o +BUILTIN_OBJS += builtin-commit.o +BUILTIN_OBJS += builtin-config.o +BUILTIN_OBJS += builtin-count-objects.o +BUILTIN_OBJS += builtin-describe.o +BUILTIN_OBJS += builtin-diff-files.o +BUILTIN_OBJS += builtin-diff-index.o +BUILTIN_OBJS += builtin-diff-tree.o +BUILTIN_OBJS += builtin-diff.o +BUILTIN_OBJS += builtin-fast-export.o +BUILTIN_OBJS += builtin-fetch--tool.o +BUILTIN_OBJS += builtin-fetch-pack.o +BUILTIN_OBJS += builtin-fetch.o +BUILTIN_OBJS += builtin-fmt-merge-msg.o +BUILTIN_OBJS += builtin-for-each-ref.o +BUILTIN_OBJS += builtin-fsck.o +BUILTIN_OBJS += builtin-gc.o +BUILTIN_OBJS += builtin-grep.o +BUILTIN_OBJS += builtin-init-db.o +BUILTIN_OBJS += builtin-log.o +BUILTIN_OBJS += builtin-ls-files.o +BUILTIN_OBJS += builtin-ls-remote.o +BUILTIN_OBJS += builtin-ls-tree.o +BUILTIN_OBJS += builtin-mailinfo.o +BUILTIN_OBJS += builtin-mailsplit.o +BUILTIN_OBJS += builtin-merge-base.o +BUILTIN_OBJS += builtin-merge-file.o +BUILTIN_OBJS += builtin-merge-ours.o +BUILTIN_OBJS += builtin-merge-recursive.o +BUILTIN_OBJS += builtin-mv.o +BUILTIN_OBJS += builtin-name-rev.o +BUILTIN_OBJS += builtin-pack-objects.o +BUILTIN_OBJS += builtin-pack-refs.o +BUILTIN_OBJS += builtin-prune-packed.o +BUILTIN_OBJS += builtin-prune.o +BUILTIN_OBJS += builtin-push.o +BUILTIN_OBJS += builtin-read-tree.o +BUILTIN_OBJS += builtin-reflog.o +BUILTIN_OBJS += builtin-remote.o +BUILTIN_OBJS += builtin-rerere.o +BUILTIN_OBJS += builtin-reset.o +BUILTIN_OBJS += builtin-rev-list.o +BUILTIN_OBJS += builtin-rev-parse.o +BUILTIN_OBJS += builtin-revert.o +BUILTIN_OBJS += builtin-rm.o +BUILTIN_OBJS += builtin-send-pack.o +BUILTIN_OBJS += builtin-shortlog.o +BUILTIN_OBJS += builtin-show-branch.o +BUILTIN_OBJS += builtin-show-ref.o +BUILTIN_OBJS += builtin-stripspace.o +BUILTIN_OBJS += builtin-symbolic-ref.o +BUILTIN_OBJS += builtin-tag.o +BUILTIN_OBJS += builtin-tar-tree.o +BUILTIN_OBJS += builtin-unpack-objects.o +BUILTIN_OBJS += builtin-update-index.o +BUILTIN_OBJS += builtin-update-ref.o +BUILTIN_OBJS += builtin-upload-archive.o +BUILTIN_OBJS += builtin-verify-pack.o +BUILTIN_OBJS += builtin-verify-tag.o +BUILTIN_OBJS += builtin-write-tree.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) EXTLIBS = diff --git a/builtin-apply.c b/builtin-apply.c index a3f075df4b..abe73a0f81 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -1937,21 +1937,24 @@ static int apply_one_fragment(struct image *img, struct fragment *frag, trailing = frag->trailing; /* - * If we don't have any leading/trailing data in the patch, - * we want it to match at the beginning/end of the file. + * A hunk to change lines at the beginning would begin with + * @@ -1,L +N,M @@ * - * But that would break if the patch is generated with - * --unified=0; sane people wouldn't do that to cause us - * trouble, but we try to please not so sane ones as well. + * And a hunk to add to an empty file would begin with + * @@ -0,0 +N,M @@ + * + * In other words, a hunk that is (frag->oldpos <= 1) with or + * without leading context must match at the beginning. */ - if (unidiff_zero) { - match_beginning = (!leading && !frag->oldpos); - match_end = 0; - } - else { - match_beginning = !leading && (frag->oldpos == 1); - match_end = !trailing; - } + match_beginning = frag->oldpos <= 1; + + /* + * A hunk without trailing lines must match at the end. + * However, we simply cannot tell if a hunk must match end + * from the lack of trailing lines if the patch was generated + * with unidiff without any context. + */ + match_end = !unidiff_zero && !trailing; pos = frag->newpos ? (frag->newpos - 1) : 0; preimage.buf = oldlines; @@ -2994,7 +2997,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix) int read_stdin = 1; int inaccurate_eof = 0; int errs = 0; - int is_not_gitdir = 0; + int is_not_gitdir; const char *whitespace_option = NULL; diff --git a/builtin-bundle.c b/builtin-bundle.c index 9f38e2176a..ac476e7a4b 100644 --- a/builtin-bundle.c +++ b/builtin-bundle.c @@ -14,7 +14,7 @@ static const char *bundle_usage="git-bundle (create <bundle> <git-rev-list args> int cmd_bundle(int argc, const char **argv, const char *prefix) { struct bundle_header header; - int nongit = 0; + int nongit; const char *cmd, *bundle_file; int bundle_fd = -1; char buffer[PATH_MAX]; diff --git a/builtin-config.c b/builtin-config.c index 2b9a4261d4..c34bc8b6a6 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -264,7 +264,7 @@ static int get_colorbool(int argc, const char **argv) int cmd_config(int argc, const char **argv, const char *prefix) { - int nongit = 0; + int nongit; char* value; const char *file = setup_git_directory_gently(&nongit); diff --git a/builtin-diff-files.c b/builtin-diff-files.c index 4abe3c28fb..e2306c162a 100644 --- a/builtin-diff-files.c +++ b/builtin-diff-files.c @@ -16,7 +16,7 @@ COMMON_DIFF_OPTIONS_HELP; int cmd_diff_files(int argc, const char **argv, const char *prefix) { struct rev_info rev; - int nongit = 0; + int nongit; int result; prefix = setup_git_directory_gently(&nongit); diff --git a/builtin-diff.c b/builtin-diff.c index 444ff2fd92..7c2a8412fa 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -210,7 +210,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) int ents = 0, blobs = 0, paths = 0; const char *path = NULL; struct blobinfo blob[2]; - int nongit = 0; + int nongit; int result = 0; /* diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index 7b28024224..65350ca522 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -26,6 +26,8 @@ static const char fetch_pack_usage[] = #define SEEN (1U << 3) #define POPPED (1U << 4) +static int marked; + /* * After sending this many "have"s if we do not get any new ACK , we * give up traversing our history. @@ -61,6 +63,16 @@ static int rev_list_insert_ref(const char *path, const unsigned char *sha1, int return 0; } +static int clear_marks(const char *path, const unsigned char *sha1, int flag, void *cb_data) +{ + struct object *o = deref_tag(parse_object(sha1), path, 0); + + if (o && o->type == OBJ_COMMIT) + clear_commit_marks((struct commit *)o, + COMMON | COMMON_REF | SEEN | POPPED); + return 0; +} + /* This function marks a rev and its ancestors as common. In some cases, it is desirable to mark only the ancestors (for example @@ -153,6 +165,10 @@ static int find_common(int fd[2], unsigned char *result_sha1, unsigned in_vain = 0; int got_continue = 0; + if (marked) + for_each_ref(clear_marks, NULL); + marked = 1; + for_each_ref(rev_list_insert_ref, NULL); fetching = 0; diff --git a/builtin-fetch.c b/builtin-fetch.c index b2b9935ed6..5841b3e51a 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -637,6 +637,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) if (!strcmp(argv[i], "tag")) { char *ref; i++; + if (i >= argc) + die("You need to specify a tag name."); ref = xmalloc(strlen(argv[i]) * 2 + 22); strcpy(ref, "refs/tags/"); strcat(ref, argv[i]); @@ -652,5 +654,6 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) signal(SIGINT, unlock_pack_on_signal); atexit(unlock_pack); - return do_fetch(transport, parse_ref_spec(ref_nr, refs), ref_nr); + return do_fetch(transport, + parse_fetch_refspec(ref_nr, refs), ref_nr); } diff --git a/builtin-gc.c b/builtin-gc.c index 95917d74a8..8cef36f6a4 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -25,7 +25,7 @@ static const char * const builtin_gc_usage[] = { static int pack_refs = 1; static int aggressive_window = -1; static int gc_auto_threshold = 6700; -static int gc_auto_pack_limit = 20; +static int gc_auto_pack_limit = 50; static char *prune_expire = "2.weeks.ago"; #define MAX_ADD 10 @@ -160,10 +160,10 @@ static int too_many_packs(void) static int need_to_gc(void) { /* - * Setting gc.auto and gc.autopacklimit to 0 or negative can - * disable the automatic gc. + * Setting gc.auto to 0 or negative can disable the + * automatic gc. */ - if (gc_auto_threshold <= 0 && gc_auto_pack_limit <= 0) + if (gc_auto_threshold <= 0) return 0; /* diff --git a/builtin-init-db.c b/builtin-init-db.c index 79eaf8d6ed..2854868b4e 100644 --- a/builtin-init-db.c +++ b/builtin-init-db.c @@ -167,9 +167,9 @@ static int create_default_files(const char *git_dir, const char *template_path) { unsigned len = strlen(git_dir); static char path[PATH_MAX]; - unsigned char sha1[20]; struct stat st1; char repo_version_string[10]; + char junk[2]; int reinit; int filemode; @@ -219,7 +219,8 @@ static int create_default_files(const char *git_dir, const char *template_path) * branch, if it does not exist yet. */ strcpy(path + len, "HEAD"); - reinit = !read_ref("HEAD", sha1); + reinit = (!access(path, R_OK) + || readlink(path, junk, sizeof(junk)-1) != -1); if (!reinit) { if (create_symref("HEAD", "refs/heads/master", NULL) < 0) exit(1); diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c index 8907a89d6c..06ab8da1fb 100644 --- a/builtin-ls-remote.c +++ b/builtin-ls-remote.c @@ -31,7 +31,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) { int i; const char *dest = NULL; - int nongit = 0; + int nongit; unsigned flags = 0; const char *uploadpack = NULL; const char **pattern = NULL; diff --git a/builtin-prune.c b/builtin-prune.c index bb8ead92cf..25f9304b82 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -4,8 +4,12 @@ #include "revision.h" #include "builtin.h" #include "reachable.h" +#include "parse-options.h" -static const char prune_usage[] = "git-prune [-n]"; +static const char * const prune_usage[] = { + "git-prune [-n] [--expire <time>] [--] [<head>...]", + NULL +}; static int show_only; static unsigned long expire; @@ -123,32 +127,33 @@ static void remove_temporary_files(void) int cmd_prune(int argc, const char **argv, const char *prefix) { - int i; struct rev_info revs; - - for (i = 1; i < argc; i++) { - const char *arg = argv[i]; - if (!strcmp(arg, "-n")) { - show_only = 1; - continue; - } - if (!strcmp(arg, "--expire")) { - if (++i < argc) { - expire = approxidate(argv[i]); - continue; - } - } - else if (!prefixcmp(arg, "--expire=")) { - expire = approxidate(arg + 9); - continue; - } - usage(prune_usage); - } + const struct option options[] = { + OPT_BOOLEAN('n', NULL, &show_only, + "do not remove, show only"), + OPT_DATE(0, "expire", &expire, + "expire objects older than <time>"), + OPT_END() + }; save_commit_buffer = 0; init_revisions(&revs, prefix); - mark_reachable_objects(&revs, 1); + argc = parse_options(argc, argv, options, prune_usage, 0); + while (argc--) { + unsigned char sha1[20]; + const char *name = *argv++; + + if (!get_sha1(name, sha1)) { + struct object *object = parse_object(sha1); + if (!object) + die("bad object: %s", name); + add_pending_object(&revs, object, ""); + } + else + die("unrecognized argument: %s", name); + } + mark_reachable_objects(&revs, 1); prune_object_dir(get_object_directory()); sync(); diff --git a/builtin-remote.c b/builtin-remote.c index 24e692953b..d77f10a0ea 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -207,7 +207,10 @@ static int handle_one_branch(const char *refname, if (!remote_find_tracking(states->remote, &refspec)) { struct path_list_item *item; const char *name = skip_prefix(refspec.src, "refs/heads/"); - if (unsorted_path_list_has_path(&states->tracked, name) || + /* symbolic refs pointing nowhere were handled already */ + if ((flags & REF_ISSYMREF) || + unsorted_path_list_has_path(&states->tracked, + name) || unsorted_path_list_has_path(&states->new, name)) return 0; @@ -469,6 +472,7 @@ static int show_or_prune(int argc, const char **argv, int prune) spec->dst ? ":" : "", skip_prefix(spec->dst, "refs/heads/")); } + printf("\n"); } cleanup_states: /* NEEDSWORK: free remote */ diff --git a/builtin-rev-list.c b/builtin-rev-list.c index d0a1416921..edc0bd35bb 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -33,6 +33,7 @@ static const char rev_list_usage[] = " ordering output:\n" " --topo-order\n" " --date-order\n" +" --reverse\n" " formatting output:\n" " --parents\n" " --objects | --objects-edge\n" diff --git a/builtin-send-pack.c b/builtin-send-pack.c index 930e0fb3fd..bb9c33a650 100644 --- a/builtin-send-pack.c +++ b/builtin-send-pack.c @@ -537,7 +537,7 @@ static void verify_remote_names(int nr_heads, const char **heads) int i; for (i = 0; i < nr_heads; i++) { - const char *remote = strchr(heads[i], ':'); + const char *remote = strrchr(heads[i], ':'); remote = remote ? (remote + 1) : heads[i]; switch (check_ref_format(remote)) { diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c index f3ef11fa2d..db81496b46 100644 --- a/builtin-verify-tag.c +++ b/builtin-verify-tag.c @@ -46,8 +46,10 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) gpg.argv = args_gpg; gpg.in = -1; args_gpg[2] = path; - if (start_command(&gpg)) + if (start_command(&gpg)) { + unlink(path); return error("could not run gpg."); + } write_in_full(gpg.in, buf, len); close(gpg.in); diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5046f69934..4d81963b1d 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -639,7 +639,9 @@ _git_diff () --find-copies-harder --pickaxe-all --pickaxe-regex --text --ignore-space-at-eol --ignore-space-change --ignore-all-space --exit-code --quiet --ext-diff - --no-ext-diff" + --no-ext-diff + --no-prefix --src-prefix= --dst-prefix= + " return ;; esac @@ -696,6 +698,7 @@ _git_format_patch () --full-index --binary --not --all --cover-letter + --no-prefix --src-prefix= --dst-prefix= " return ;; @@ -865,7 +868,7 @@ _git_rebase () return ;; --*) - __gitcomp "--onto --merge --strategy" + __gitcomp "--onto --merge --strategy --interactive" return esac __gitcomp "$(__git_refs)" @@ -999,7 +1002,8 @@ _git_config () gitcvs.enabled gitcvs.logfile gitcvs.allbinary - gitcvs.dbname gitcvs.dbdriver gitcvs.dbuser gitcvs.dvpass + gitcvs.dbname gitcvs.dbdriver gitcvs.dbuser gitcvs.dbpass + gitcvs.dbtablenameprefix gc.packrefs gc.reflogexpire gc.reflogexpireunreachable diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 650ea34176..d8de9f6c25 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -90,11 +90,11 @@ def getP4OpenedType(file): # Returns the perforce file type for the given file. result = read_pipe("p4 opened %s" % file) - match = re.match(".*\((.+)\)$", result) + match = re.match(".*\((.+)\)\r?$", result) if match: return match.group(1) else: - die("Could not determine file type for %s" % file) + die("Could not determine file type for %s (result: '%s')" % (file, result)) def diffTreePattern(): # This is a simple generator for the diff tree regex pattern. This could be @@ -513,6 +513,8 @@ class P4Submit(Command): template = "" inFilesSection = False for line in read_pipe_lines("p4 change -o"): + if line.endswith("\r\n"): + line = line[:-2] + "\n" if inFilesSection: if line.startswith("\t"): # path starts and ends with a tab @@ -619,38 +621,43 @@ class P4Submit(Command): setP4ExecBit(f, mode) logMessage = extractLogMessageFromGitCommit(id) - if self.isWindows: - logMessage = logMessage.replace("\n", "\r\n") logMessage = logMessage.strip() template = self.prepareSubmitTemplate() if self.interactive: submitTemplate = self.prepareLogMessage(template, logMessage) + if os.environ.has_key("P4DIFF"): + del(os.environ["P4DIFF"]) diff = read_pipe("p4 diff -du ...") + newdiff = "" for newFile in filesToAdd: - diff += "==== new file ====\n" - diff += "--- /dev/null\n" - diff += "+++ %s\n" % newFile + newdiff += "==== new file ====\n" + newdiff += "--- /dev/null\n" + newdiff += "+++ %s\n" % newFile f = open(newFile, "r") for line in f.readlines(): - diff += "+" + line + newdiff += "+" + line f.close() - separatorLine = "######## everything below this line is just the diff #######" - if platform.system() == "Windows": - separatorLine += "\r" - separatorLine += "\n" + separatorLine = "######## everything below this line is just the diff #######\n" [handle, fileName] = tempfile.mkstemp() tmpFile = os.fdopen(handle, "w+") - tmpFile.write(submitTemplate + separatorLine + diff) + if self.isWindows: + submitTemplate = submitTemplate.replace("\n", "\r\n") + separatorLine = separatorLine.replace("\n", "\r\n") + newdiff = newdiff.replace("\n", "\r\n") + tmpFile.write(submitTemplate + separatorLine + diff + newdiff) tmpFile.close() defaultEditor = "vi" if platform.system() == "Windows": defaultEditor = "notepad" - editor = os.environ.get("EDITOR", defaultEditor); + if os.environ.has_key("P4EDITOR"): + editor = os.environ.get("P4EDITOR") + else: + editor = os.environ.get("EDITOR", defaultEditor); system(editor + " " + fileName) tmpFile = open(fileName, "rb") message = tmpFile.read() @@ -882,21 +889,21 @@ class P4Sync(Command): while j < len(filedata): stat = filedata[j] j += 1 - text = '' + text = []; while j < len(filedata) and filedata[j]['code'] in ('text', 'unicode', 'binary'): - tmp = filedata[j]['data'] - if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'): - tmp = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', tmp) - elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'): - tmp = re.sub(r'(?i)\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', tmp) - text += tmp + text.append(filedata[j]['data']) j += 1 - + text = ''.join(text) if not stat.has_key('depotFile'): sys.stderr.write("p4 print fails with: %s\n" % repr(stat)) continue + if stat['type'] in ('text+ko', 'unicode+ko', 'binary+ko'): + text = re.sub(r'(?i)\$(Id|Header):[^$]*\$',r'$\1$', text) + elif stat['type'] in ('text+k', 'ktext', 'kxtext', 'unicode+k', 'binary+k'): + text = re.sub(r'(?i)\$(Id|Header|Author|Date|DateTime|Change|File|Revision):[^$]*\$',r'$\1$', text) + contents[stat['depotFile']] = text for f in filesForCommit: diff --git a/diff-lib.c b/diff-lib.c index 52dbac34a4..069e4507ae 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -10,6 +10,7 @@ #include "cache-tree.h" #include "path-list.h" #include "unpack-trees.h" +#include "refs.h" /* * diff-files @@ -333,6 +334,26 @@ int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv) } return run_diff_files(revs, options); } +/* + * See if work tree has an entity that can be staged. Return 0 if so, + * return 1 if not and return -1 if error. + */ +static int check_work_tree_entity(const struct cache_entry *ce, struct stat *st, char *symcache) +{ + if (lstat(ce->name, st) < 0) { + if (errno != ENOENT && errno != ENOTDIR) + return -1; + return 1; + } + if (has_symlink_leading_path(ce->name, symcache)) + return 1; + if (S_ISDIR(st->st_mode)) { + unsigned char sub[20]; + if (resolve_gitlink_ref(ce->name, "HEAD", sub)) + return 1; + } + return 0; +} int run_diff_files(struct rev_info *revs, unsigned int option) { @@ -341,10 +362,12 @@ int run_diff_files(struct rev_info *revs, unsigned int option) int silent_on_removed = option & DIFF_SILENT_ON_REMOVED; unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED) ? CE_MATCH_RACY_IS_DIRTY : 0); + char symcache[PATH_MAX]; if (diff_unmerged_stage < 0) diff_unmerged_stage = 2; entries = active_nr; + symcache[0] = '\0'; for (i = 0; i < entries; i++) { struct stat st; unsigned int oldmode, newmode; @@ -376,16 +399,17 @@ int run_diff_files(struct rev_info *revs, unsigned int option) memset(&(dpath->parent[0]), 0, sizeof(struct combine_diff_parent)*5); - if (lstat(ce->name, &st) < 0) { - if (errno != ENOENT && errno != ENOTDIR) { + changed = check_work_tree_entity(ce, &st, symcache); + if (!changed) + dpath->mode = ce_mode_from_stat(ce, st.st_mode); + else { + if (changed < 0) { perror(ce->name); continue; } if (silent_on_removed) continue; } - else - dpath->mode = ce_mode_from_stat(ce, st.st_mode); while (i < entries) { struct cache_entry *nce = active_cache[i]; @@ -438,8 +462,10 @@ int run_diff_files(struct rev_info *revs, unsigned int option) if (ce_uptodate(ce)) continue; - if (lstat(ce->name, &st) < 0) { - if (errno != ENOENT && errno != ENOTDIR) { + + changed = check_work_tree_entity(ce, &st, symcache); + if (changed) { + if (changed < 0) { perror(ce->name); continue; } @@ -468,6 +494,11 @@ int run_diff_files(struct rev_info *revs, unsigned int option) * diff-index */ +struct oneway_unpack_data { + struct rev_info *revs; + char symcache[PATH_MAX]; +}; + /* A file entry went away or appeared */ static void diff_index_show_file(struct rev_info *revs, const char *prefix, @@ -481,7 +512,8 @@ static void diff_index_show_file(struct rev_info *revs, static int get_stat_data(struct cache_entry *ce, const unsigned char **sha1p, unsigned int *modep, - int cached, int match_missing) + int cached, int match_missing, + struct oneway_unpack_data *cbdata) { const unsigned char *sha1 = ce->sha1; unsigned int mode = ce->ce_mode; @@ -489,8 +521,11 @@ static int get_stat_data(struct cache_entry *ce, if (!cached) { int changed; struct stat st; - if (lstat(ce->name, &st) < 0) { - if (errno == ENOENT && match_missing) { + changed = check_work_tree_entity(ce, &st, cbdata->symcache); + if (changed < 0) + return -1; + else if (changed) { + if (match_missing) { *sha1p = sha1; *modep = mode; return 0; @@ -509,23 +544,25 @@ static int get_stat_data(struct cache_entry *ce, return 0; } -static void show_new_file(struct rev_info *revs, +static void show_new_file(struct oneway_unpack_data *cbdata, struct cache_entry *new, int cached, int match_missing) { const unsigned char *sha1; unsigned int mode; + struct rev_info *revs = cbdata->revs; - /* New file in the index: it might actually be different in + /* + * New file in the index: it might actually be different in * the working copy. */ - if (get_stat_data(new, &sha1, &mode, cached, match_missing) < 0) + if (get_stat_data(new, &sha1, &mode, cached, match_missing, cbdata) < 0) return; diff_index_show_file(revs, "+", new, sha1, mode); } -static int show_modified(struct rev_info *revs, +static int show_modified(struct oneway_unpack_data *cbdata, struct cache_entry *old, struct cache_entry *new, int report_missing, @@ -533,8 +570,9 @@ static int show_modified(struct rev_info *revs, { unsigned int mode, oldmode; const unsigned char *sha1; + struct rev_info *revs = cbdata->revs; - if (get_stat_data(new, &sha1, &mode, cached, match_missing) < 0) { + if (get_stat_data(new, &sha1, &mode, cached, match_missing, cbdata) < 0) { if (report_missing) diff_index_show_file(revs, "-", old, old->sha1, old->ce_mode); @@ -602,7 +640,8 @@ static void do_oneway_diff(struct unpack_trees_options *o, struct cache_entry *idx, struct cache_entry *tree) { - struct rev_info *revs = o->unpack_data; + struct oneway_unpack_data *cbdata = o->unpack_data; + struct rev_info *revs = cbdata->revs; int match_missing, cached; /* @@ -625,7 +664,7 @@ static void do_oneway_diff(struct unpack_trees_options *o, * Something added to the tree? */ if (!tree) { - show_new_file(revs, idx, cached, match_missing); + show_new_file(cbdata, idx, cached, match_missing); return; } @@ -638,7 +677,7 @@ static void do_oneway_diff(struct unpack_trees_options *o, } /* Show difference between old and new */ - show_modified(revs, tree, idx, 1, cached, match_missing); + show_modified(cbdata, tree, idx, 1, cached, match_missing); } static inline void skip_same_name(struct cache_entry *ce, struct unpack_trees_options *o) @@ -675,7 +714,8 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o) { struct cache_entry *idx = src[0]; struct cache_entry *tree = src[1]; - struct rev_info *revs = o->unpack_data; + struct oneway_unpack_data *cbdata = o->unpack_data; + struct rev_info *revs = cbdata->revs; if (idx && ce_stage(idx)) skip_same_name(idx, o); @@ -702,6 +742,7 @@ int run_diff_index(struct rev_info *revs, int cached) const char *tree_name; struct unpack_trees_options opts; struct tree_desc t; + struct oneway_unpack_data unpack_cb; mark_merge_entries(); @@ -711,12 +752,14 @@ int run_diff_index(struct rev_info *revs, int cached) if (!tree) return error("bad tree object %s", tree_name); + unpack_cb.revs = revs; + unpack_cb.symcache[0] = '\0'; memset(&opts, 0, sizeof(opts)); opts.head_idx = 1; opts.index_only = cached; opts.merge = 1; opts.fn = oneway_diff; - opts.unpack_data = revs; + opts.unpack_data = &unpack_cb; opts.src_index = &the_index; opts.dst_index = NULL; @@ -738,6 +781,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt) struct cache_entry *last = NULL; struct unpack_trees_options opts; struct tree_desc t; + struct oneway_unpack_data unpack_cb; /* * This is used by git-blame to run diff-cache internally; @@ -766,12 +810,14 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt) if (!tree) die("bad tree object %s", sha1_to_hex(tree_sha1)); + unpack_cb.revs = &revs; + unpack_cb.symcache[0] = '\0'; memset(&opts, 0, sizeof(opts)); opts.head_idx = 1; opts.index_only = 1; opts.merge = 1; opts.fn = oneway_diff; - opts.unpack_data = &revs; + opts.unpack_data = &unpack_cb; opts.src_index = &the_index; opts.dst_index = &the_index; @@ -218,7 +218,6 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t * to emulate by hand - much easier to let the system * just do the right thing) */ - unlink(path); if (S_ISDIR(st.st_mode)) { /* If it is a gitlink, leave it alone! */ if (S_ISGITLINK(ce->ce_mode)) @@ -226,7 +225,8 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *t if (!state->force) return error("%s is a directory", path); remove_subtree(path); - } + } else if (unlink(path)) + return error("unable to unlink old '%s' (%s)", path, strerror(errno)); } else if (state->not_new) return 0; create_directories(path, state); diff --git a/fast-import.c b/fast-import.c index 655913ddb2..73e5439d97 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1516,6 +1516,8 @@ static int update_branch(struct branch *b) struct ref_lock *lock; unsigned char old_sha1[20]; + if (is_null_sha1(b->sha1)) + return 0; if (read_ref(b->name, old_sha1)) hashclr(old_sha1); lock = lock_any_ref_for_update(b->name, old_sha1, 0); diff --git a/git-add--interactive.perl b/git-add--interactive.perl index a0a81f134a..903953e68e 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -550,6 +550,21 @@ sub parse_diff { return @hunk; } +sub parse_diff_header { + my $src = shift; + + my $head = { TEXT => [], DISPLAY => [] }; + my $mode = { TEXT => [], DISPLAY => [] }; + + for (my $i = 0; $i < @{$src->{TEXT}}; $i++) { + my $dest = $src->{TEXT}->[$i] =~ /^(old|new) mode (\d+)$/ ? + $mode : $head; + push @{$dest->{TEXT}}, $src->{TEXT}->[$i]; + push @{$dest->{DISPLAY}}, $src->{DISPLAY}->[$i]; + } + return ($head, $mode); +} + sub hunk_splittable { my ($text) = @_; @@ -795,9 +810,40 @@ sub patch_update_file { my ($ix, $num); my $path = shift; my ($head, @hunk) = parse_diff($path); + ($head, my $mode) = parse_diff_header($head); for (@{$head->{DISPLAY}}) { print; } + + if (@{$mode->{TEXT}}) { + while (1) { + print @{$mode->{DISPLAY}}; + print colored $prompt_color, + "Stage mode change [y/n/a/d/?]? "; + my $line = <STDIN>; + if ($line =~ /^y/i) { + $mode->{USE} = 1; + last; + } + elsif ($line =~ /^n/i) { + $mode->{USE} = 0; + last; + } + elsif ($line =~ /^a/i) { + $_->{USE} = 1 foreach ($mode, @hunk); + last; + } + elsif ($line =~ /^d/i) { + $_->{USE} = 0 foreach ($mode, @hunk); + last; + } + else { + help_patch_cmd(''); + next; + } + } + } + $num = scalar @hunk; $ix = 0; @@ -920,6 +966,9 @@ sub patch_update_file { my $n_lofs = 0; my @result = (); + if ($mode->{USE}) { + push @result, @{$mode->{TEXT}}; + } for (@hunk) { my $text = $_->{TEXT}; my ($o_ofs, $o_cnt, $n_ofs, $n_cnt) = diff --git a/git-clone.sh b/git-clone.sh index e981122778..2636159aaa 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -310,6 +310,9 @@ yes) mkdir -p "$GIT_DIR/objects/info" echo "$repo/objects" >>"$GIT_DIR/objects/info/alternates" else + cpio_quiet_flag="" + cpio --help 2>&1 | grep -- --quiet >/dev/null && \ + cpio_quiet_flag=--quiet l= && if test "$use_local_hardlink" = yes then @@ -330,7 +333,8 @@ yes) fi fi && cd "$repo" && - find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1 + find objects -depth -print | cpio $cpio_quiet_flag -pumd$l "$GIT_DIR/" || \ + exit 1 fi git-ls-remote "$repo" >"$GIT_DIR/CLONE_HEAD" || exit 1 ;; diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 7f632af20d..29dbfc940b 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -73,8 +73,8 @@ my $methods = { 'status' => \&req_status, 'admin' => \&req_CATCHALL, 'history' => \&req_CATCHALL, - 'watchers' => \&req_CATCHALL, - 'editors' => \&req_CATCHALL, + 'watchers' => \&req_EMPTY, + 'editors' => \&req_EMPTY, 'annotate' => \&req_annotate, 'Global_option' => \&req_Globaloption, #'annotate' => \&req_CATCHALL, @@ -199,6 +199,11 @@ sub req_CATCHALL $log->warn("Unhandled command : req_$cmd : $data"); } +# This method invariably succeeds with an empty response. +sub req_EMPTY +{ + print "ok\n"; +} # Root pathname \n # Response expected: no. Tell the server which CVSROOT to use. Note that @@ -958,6 +963,17 @@ sub req_update $meta = $updater->getmeta($filename); } + # If -p was given, "print" the contents of the requested revision. + if ( exists ( $state->{opt}{p} ) ) { + if ( defined ( $meta->{revision} ) ) { + $log->info("Printing '$filename' revision " . $meta->{revision}); + + transmitfile($meta->{filehash}, { print => 1 }); + } + + next; + } + if ( ! defined $meta ) { $meta = { @@ -1091,9 +1107,9 @@ sub req_update my $file_local = $filepart . ".mine"; system("ln","-s",$state->{entries}{$filename}{modified_filename}, $file_local); my $file_old = $filepart . "." . $oldmeta->{revision}; - transmitfile($oldmeta->{filehash}, $file_old); + transmitfile($oldmeta->{filehash}, { targetfile => $file_old }); my $file_new = $filepart . "." . $meta->{revision}; - transmitfile($meta->{filehash}, $file_new); + transmitfile($meta->{filehash}, { targetfile => $file_new }); # we need to merge with the local changes ( M=successful merge, C=conflict merge ) $log->info("Merging $file_local, $file_old, $file_new"); @@ -1423,6 +1439,8 @@ sub req_status { $filename = filecleanup($filename); + next if exists($state->{opt}{l}) && index($filename, '/', length($state->{prependdir})) >= 0; + my $meta = $updater->getmeta($filename); my $oldmeta = $meta; @@ -1466,8 +1484,10 @@ sub req_status $status ||= "Unknown"; + my ($filepart) = filenamesplit($filename); + print "M ===================================================================\n"; - print "M File: $filename\tStatus: $status\n"; + print "M File: $filepart\tStatus: $status\n"; if ( defined($state->{entries}{$filename}{revision}) ) { print "M Working revision:\t" . $state->{entries}{$filename}{revision} . "\n"; @@ -1541,14 +1561,14 @@ sub req_diff print "E File $filename at revision 1.$revision1 doesn't exist\n"; next; } - transmitfile($meta1->{filehash}, $file1); + transmitfile($meta1->{filehash}, { targetfile => $file1 }); } # otherwise we just use the working copy revision else { ( undef, $file1 ) = tempfile( DIR => $TEMP_DIR, OPEN => 0 ); $meta1 = $updater->getmeta($filename, $wrev); - transmitfile($meta1->{filehash}, $file1); + transmitfile($meta1->{filehash}, { targetfile => $file1 }); } # if we have a second -r switch, use it too @@ -1563,7 +1583,7 @@ sub req_diff next; } - transmitfile($meta2->{filehash}, $file2); + transmitfile($meta2->{filehash}, { targetfile => $file2 }); } # otherwise we just use the working copy else @@ -1576,7 +1596,7 @@ sub req_diff { ( undef, $file2 ) = tempfile( DIR => $TEMP_DIR, OPEN => 0 ); $meta2 = $updater->getmeta($filename, $wrev); - transmitfile($meta2->{filehash}, $file2); + transmitfile($meta2->{filehash}, { targetfile => $file2 }); } # We need to have retrieved something useful @@ -1708,8 +1728,7 @@ sub req_log print "M revision 1.$revision->{revision}\n"; # reformat the date for log output $revision->{modified} = sprintf('%04d/%02d/%02d %s', $3, $DATE_LIST->{$2}, $1, $4 ) if ( $revision->{modified} =~ /(\d+)\s+(\w+)\s+(\d+)\s+(\S+)/ and defined($DATE_LIST->{$2}) ); - $revision->{author} =~ s/\s+.*//; - $revision->{author} =~ s/^(.{8}).*/$1/; + $revision->{author} = cvs_author($revision->{author}); print "M date: $revision->{modified}; author: $revision->{author}; state: " . ( $revision->{filehash} eq "deleted" ? "dead" : "Exp" ) . "; lines: +2 -3\n"; my $commitmessage = $updater->commitmessage($revision->{commithash}); $commitmessage =~ s/^/M /mg; @@ -1824,8 +1843,7 @@ sub req_annotate unless ( defined ( $metadata->{$commithash} ) ) { $metadata->{$commithash} = $updater->getmeta($filename, $commithash); - $metadata->{$commithash}{author} =~ s/\s+.*//; - $metadata->{$commithash}{author} =~ s/^(.{8}).*/$1/; + $metadata->{$commithash}{author} = cvs_author($metadata->{$commithash}{author}); $metadata->{$commithash}{modified} = sprintf("%02d-%s-%02d", $1, $2, $3) if ( $metadata->{$commithash}{modified} =~ /^(\d+)\s(\w+)\s\d\d(\d\d)/ ); } printf("M 1.%-5d (%-8s %10s): %s\n", @@ -2005,14 +2023,17 @@ sub revparse return undef; } -# This method takes a file hash and does a CVS "file transfer" which transmits the -# size of the file, and then the file contents. -# If a second argument $targetfile is given, the file is instead written out to -# a file by the name of $targetfile +# This method takes a file hash and does a CVS "file transfer". Its +# exact behaviour depends on a second, optional hash table argument: +# - If $options->{targetfile}, dump the contents to that file; +# - If $options->{print}, use M/MT to transmit the contents one line +# at a time; +# - Otherwise, transmit the size of the file, followed by the file +# contents. sub transmitfile { my $filehash = shift; - my $targetfile = shift; + my $options = shift; if ( defined ( $filehash ) and $filehash eq "deleted" ) { @@ -2034,11 +2055,20 @@ sub transmitfile if ( open my $fh, '-|', "git-cat-file", "blob", $filehash ) { - if ( defined ( $targetfile ) ) + if ( defined ( $options->{targetfile} ) ) { + my $targetfile = $options->{targetfile}; open NEWFILE, ">", $targetfile or die("Couldn't open '$targetfile' for writing : $!"); print NEWFILE $_ while ( <$fh> ); close NEWFILE or die("Failed to write '$targetfile': $!"); + } elsif ( defined ( $options->{print} ) && $options->{print} ) { + while ( <$fh> ) { + if( /\n\z/ ) { + print 'M ', $_; + } else { + print 'MT text ', $_, "\n"; + } + } } else { print "$size\n"; print while ( <$fh> ); @@ -2107,6 +2137,16 @@ sub kopts_from_path } } +# Generate a CVS author name from Git author information, by taking +# the first eight characters of the user part of the email address. +sub cvs_author +{ + my $author_line = shift; + (my $author) = $author_line =~ /<([^>@]{1,8})/; + + $author; +} + package GITCVS::log; #### @@ -2311,6 +2351,14 @@ sub new bless $self, $class; + $self->{valid_tables} = {'revision' => 1, + 'revision_ix1' => 1, + 'revision_ix2' => 1, + 'head' => 1, + 'head_ix1' => 1, + 'properties' => 1, + 'commitmsgs' => 1}; + $self->{module} = $module; $self->{git_path} = $config . "/"; @@ -2326,6 +2374,8 @@ sub new $cfg->{gitcvs}{dbuser} || ""; $self->{dbpass} = $cfg->{gitcvs}{$state->{method}}{dbpass} || $cfg->{gitcvs}{dbpass} || ""; + $self->{dbtablenameprefix} = $cfg->{gitcvs}{$state->{method}}{dbtablenameprefix} || + $cfg->{gitcvs}{dbtablenameprefix} || ""; my %mapping = ( m => $module, a => $state->{method}, u => getlogin || getpwuid($<) || $<, @@ -2334,6 +2384,8 @@ sub new ); $self->{dbname} =~ s/%([mauGg])/$mapping{$1}/eg; $self->{dbuser} =~ s/%([mauGg])/$mapping{$1}/eg; + $self->{dbtablenameprefix} =~ s/%([mauGg])/$mapping{$1}/eg; + $self->{dbtablenameprefix} = mangle_tablename($self->{dbtablenameprefix}); die "Invalid char ':' in dbdriver" if $self->{dbdriver} =~ /:/; die "Invalid char ';' in dbname" if $self->{dbname} =~ /;/; @@ -2349,10 +2401,13 @@ sub new } # Construct the revision table if required - unless ( $self->{tables}{revision} ) + unless ( $self->{tables}{$self->tablename("revision")} ) { + my $tablename = $self->tablename("revision"); + my $ix1name = $self->tablename("revision_ix1"); + my $ix2name = $self->tablename("revision_ix2"); $self->{dbh}->do(" - CREATE TABLE revision ( + CREATE TABLE $tablename ( name TEXT NOT NULL, revision INTEGER NOT NULL, filehash TEXT NOT NULL, @@ -2363,20 +2418,22 @@ sub new ) "); $self->{dbh}->do(" - CREATE INDEX revision_ix1 - ON revision (name,revision) + CREATE INDEX $ix1name + ON $tablename (name,revision) "); $self->{dbh}->do(" - CREATE INDEX revision_ix2 - ON revision (name,commithash) + CREATE INDEX $ix2name + ON $tablename (name,commithash) "); } # Construct the head table if required - unless ( $self->{tables}{head} ) + unless ( $self->{tables}{$self->tablename("head")} ) { + my $tablename = $self->tablename("head"); + my $ix1name = $self->tablename("head_ix1"); $self->{dbh}->do(" - CREATE TABLE head ( + CREATE TABLE $tablename ( name TEXT NOT NULL, revision INTEGER NOT NULL, filehash TEXT NOT NULL, @@ -2387,16 +2444,17 @@ sub new ) "); $self->{dbh}->do(" - CREATE INDEX head_ix1 - ON head (name) + CREATE INDEX $ix1name + ON $tablename (name) "); } # Construct the properties table if required - unless ( $self->{tables}{properties} ) + unless ( $self->{tables}{$self->tablename("properties")} ) { + my $tablename = $self->tablename("properties"); $self->{dbh}->do(" - CREATE TABLE properties ( + CREATE TABLE $tablename ( key TEXT NOT NULL PRIMARY KEY, value TEXT ) @@ -2404,10 +2462,11 @@ sub new } # Construct the commitmsgs table if required - unless ( $self->{tables}{commitmsgs} ) + unless ( $self->{tables}{$self->tablename("commitmsgs")} ) { + my $tablename = $self->tablename("commitmsgs"); $self->{dbh}->do(" - CREATE TABLE commitmsgs ( + CREATE TABLE $tablename ( key TEXT NOT NULL PRIMARY KEY, value TEXT ) @@ -2417,6 +2476,21 @@ sub new return $self; } +=head2 tablename + +=cut +sub tablename +{ + my $self = shift; + my $name = shift; + + if (exists $self->{valid_tables}{$name}) { + return $self->{dbtablenameprefix} . $name; + } else { + return undef; + } +} + =head2 update =cut @@ -2633,7 +2707,7 @@ sub update }; $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms); } - elsif ( $change eq "M" ) + elsif ( $change eq "M" || $change eq "T" ) { #$log->debug("MODIFIED $name"); $head->{$name} = { @@ -2782,8 +2856,9 @@ sub insert_rev my $modified = shift; my $author = shift; my $mode = shift; + my $tablename = $self->tablename("revision"); - my $insert_rev = $self->{dbh}->prepare_cached("INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); + my $insert_rev = $self->{dbh}->prepare_cached("INSERT INTO $tablename (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); $insert_rev->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode); } @@ -2792,16 +2867,18 @@ sub insert_mergelog my $self = shift; my $key = shift; my $value = shift; + my $tablename = $self->tablename("commitmsgs"); - my $insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO commitmsgs (key, value) VALUES (?,?)",{},1); + my $insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO $tablename (key, value) VALUES (?,?)",{},1); $insert_mergelog->execute($key, $value); } sub delete_head { my $self = shift; + my $tablename = $self->tablename("head"); - my $delete_head = $self->{dbh}->prepare_cached("DELETE FROM head",{},1); + my $delete_head = $self->{dbh}->prepare_cached("DELETE FROM $tablename",{},1); $delete_head->execute(); } @@ -2815,8 +2892,9 @@ sub insert_head my $modified = shift; my $author = shift; my $mode = shift; + my $tablename = $self->tablename("head"); - my $insert_head = $self->{dbh}->prepare_cached("INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); + my $insert_head = $self->{dbh}->prepare_cached("INSERT INTO $tablename (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1); $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode); } @@ -2824,8 +2902,9 @@ sub _headrev { my $self = shift; my $filename = shift; + my $tablename = $self->tablename("head"); - my $db_query = $self->{dbh}->prepare_cached("SELECT filehash, revision, mode FROM head WHERE name=?",{},1); + my $db_query = $self->{dbh}->prepare_cached("SELECT filehash, revision, mode FROM $tablename WHERE name=?",{},1); $db_query->execute($filename); my ( $hash, $revision, $mode ) = $db_query->fetchrow_array; @@ -2836,8 +2915,9 @@ sub _get_prop { my $self = shift; my $key = shift; + my $tablename = $self->tablename("properties"); - my $db_query = $self->{dbh}->prepare_cached("SELECT value FROM properties WHERE key=?",{},1); + my $db_query = $self->{dbh}->prepare_cached("SELECT value FROM $tablename WHERE key=?",{},1); $db_query->execute($key); my ( $value ) = $db_query->fetchrow_array; @@ -2849,13 +2929,14 @@ sub _set_prop my $self = shift; my $key = shift; my $value = shift; + my $tablename = $self->tablename("properties"); - my $db_query = $self->{dbh}->prepare_cached("UPDATE properties SET value=? WHERE key=?",{},1); + my $db_query = $self->{dbh}->prepare_cached("UPDATE $tablename SET value=? WHERE key=?",{},1); $db_query->execute($value, $key); unless ( $db_query->rows ) { - $db_query = $self->{dbh}->prepare_cached("INSERT INTO properties (key, value) VALUES (?,?)",{},1); + $db_query = $self->{dbh}->prepare_cached("INSERT INTO $tablename (key, value) VALUES (?,?)",{},1); $db_query->execute($key, $value); } @@ -2869,10 +2950,11 @@ sub _set_prop sub gethead { my $self = shift; + my $tablename = $self->tablename("head"); return $self->{gethead_cache} if ( defined ( $self->{gethead_cache} ) ); - my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, mode, revision, modified, commithash, author FROM head ORDER BY name ASC",{},1); + my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, mode, revision, modified, commithash, author FROM $tablename ORDER BY name ASC",{},1); $db_query->execute(); my $tree = []; @@ -2894,8 +2976,9 @@ sub getlog { my $self = shift; my $filename = shift; + my $tablename = $self->tablename("revision"); - my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, author, mode, revision, modified, commithash FROM revision WHERE name=? ORDER BY revision DESC",{},1); + my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, author, mode, revision, modified, commithash FROM $tablename WHERE name=? ORDER BY revision DESC",{},1); $db_query->execute($filename); my $tree = []; @@ -2919,19 +3002,21 @@ sub getmeta my $self = shift; my $filename = shift; my $revision = shift; + my $tablename_rev = $self->tablename("revision"); + my $tablename_head = $self->tablename("head"); my $db_query; if ( defined($revision) and $revision =~ /^\d+$/ ) { - $db_query = $self->{dbh}->prepare_cached("SELECT * FROM revision WHERE name=? AND revision=?",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT * FROM $tablename_rev WHERE name=? AND revision=?",{},1); $db_query->execute($filename, $revision); } elsif ( defined($revision) and $revision =~ /^[a-zA-Z0-9]{40}$/ ) { - $db_query = $self->{dbh}->prepare_cached("SELECT * FROM revision WHERE name=? AND commithash=?",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT * FROM $tablename_rev WHERE name=? AND commithash=?",{},1); $db_query->execute($filename, $revision); } else { - $db_query = $self->{dbh}->prepare_cached("SELECT * FROM head WHERE name=?",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT * FROM $tablename_head WHERE name=?",{},1); $db_query->execute($filename); } @@ -2947,11 +3032,12 @@ sub commitmessage { my $self = shift; my $commithash = shift; + my $tablename = $self->tablename("commitmsgs"); die("Need commithash") unless ( defined($commithash) and $commithash =~ /^[a-zA-Z0-9]{40}$/ ); my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT value FROM commitmsgs WHERE key=?",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT value FROM $tablename WHERE key=?",{},1); $db_query->execute($commithash); my ( $message ) = $db_query->fetchrow_array; @@ -2979,9 +3065,10 @@ sub gethistory { my $self = shift; my $filename = shift; + my $tablename = $self->tablename("revision"); my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM revision WHERE name=? ORDER BY revision DESC",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM $tablename WHERE name=? ORDER BY revision DESC",{},1); $db_query->execute($filename); return $db_query->fetchall_arrayref; @@ -3001,9 +3088,10 @@ sub gethistorydense { my $self = shift; my $filename = shift; + my $tablename = $self->tablename("revision"); my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM revision WHERE name=? AND filehash!='deleted' ORDER BY revision DESC",{},1); + $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM $tablename WHERE name=? AND filehash!='deleted' ORDER BY revision DESC",{},1); $db_query->execute($filename); return $db_query->fetchall_arrayref; @@ -3061,4 +3149,19 @@ sub mangle_dirname { return $dirname; } +=head2 mangle_tablename + +create a string from a that is suitable to use as part of an SQL table +name, mainly by converting all chars except \w to _ + +=cut +sub mangle_tablename { + my $tablename = shift; + return unless defined $tablename; + + $tablename =~ s/[^\w_]/_/g; + + return $tablename; +} + 1; diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 22b6ed4a78..ea59015baa 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -281,7 +281,7 @@ while read commit parents; do die "Could not checkout the index" # files that $commit removed are now still in the working tree; # remove them, else they would be added again - git clean -q -f -x + git clean -d -q -f -x eval "$filter_tree" < /dev/null || die "tree filter failed: $filter_tree" diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN index cfe46a857e..0ab478ef90 100755 --- a/git-gui/GIT-VERSION-GEN +++ b/git-gui/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=0.9.GITGUI +DEF_VER=0.10.GITGUI LF=' ' diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 5e97fbf03e..7c25bb9808 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -1846,6 +1846,22 @@ proc add_range_to_selection {w x y} { $w tag add in_sel $begin.0 [expr {$end + 1}].0 } +proc show_more_context {} { + global repo_config + if {$repo_config(gui.diffcontext) < 99} { + incr repo_config(gui.diffcontext) + reshow_diff + } +} + +proc show_less_context {} { + global repo_config + if {$repo_config(gui.diffcontext) >= 1} { + incr repo_config(gui.diffcontext) -1 + reshow_diff + } +} + ###################################################################### ## ## ui construction @@ -2046,6 +2062,16 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} { .mbar.commit add separator + .mbar.commit add command -label [mc "Show Less Context"] \ + -command show_less_context \ + -accelerator $M1T-\- + + .mbar.commit add command -label [mc "Show More Context"] \ + -command show_more_context \ + -accelerator $M1T-= + + .mbar.commit add separator + .mbar.commit add command -label [mc "Sign Off"] \ -command do_signoff \ -accelerator $M1T-S @@ -2593,17 +2619,11 @@ lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state] $ctxm add separator $ctxm add command \ -label [mc "Show Less Context"] \ - -command {if {$repo_config(gui.diffcontext) >= 1} { - incr repo_config(gui.diffcontext) -1 - reshow_diff - }} + -command show_less_context lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] $ctxm add command \ -label [mc "Show More Context"] \ - -command {if {$repo_config(gui.diffcontext) < 99} { - incr repo_config(gui.diffcontext) - reshow_diff - }} + -command show_more_context lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state] $ctxm add separator $ctxm add command \ @@ -2695,6 +2715,11 @@ bind $ui_comm <$M1B-Key-v> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-V> {tk_textPaste %W; %W see insert; break} bind $ui_comm <$M1B-Key-a> {%W tag add sel 0.0 end;break} bind $ui_comm <$M1B-Key-A> {%W tag add sel 0.0 end;break} +bind $ui_comm <$M1B-Key-minus> {show_less_context;break} +bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break} +bind $ui_comm <$M1B-Key-equal> {show_more_context;break} +bind $ui_comm <$M1B-Key-plus> {show_more_context;break} +bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break} bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break} bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break} @@ -2738,6 +2763,11 @@ bind . <$M1B-Key-t> do_add_selection bind . <$M1B-Key-T> do_add_selection bind . <$M1B-Key-i> do_add_all bind . <$M1B-Key-I> do_add_all +bind . <$M1B-Key-minus> {show_less_context;break} +bind . <$M1B-Key-KP_Subtract> {show_less_context;break} +bind . <$M1B-Key-equal> {show_more_context;break} +bind . <$M1B-Key-plus> {show_more_context;break} +bind . <$M1B-Key-KP_Add> {show_more_context;break} bind . <$M1B-Key-Return> do_commit foreach i [list $ui_index $ui_workdir] { bind $i <Button-1> "toggle_or_diff $i %x %y; break" diff --git a/git-gui/po/fr.po b/git-gui/po/fr.po index d281938e33..89b6d51ea0 100644 --- a/git-gui/po/fr.po +++ b/git-gui/po/fr.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-03-14 07:18+0100\n" -"PO-Revision-Date: 2008-01-14 21:08+0100\n" +"PO-Revision-Date: 2008-04-04 22:05+0200\n" "Last-Translator: Christian Couder <chriscool@tuxfamily.org>\n" "Language-Team: French\n" "MIME-Version: 1.0\n" @@ -344,8 +344,7 @@ msgstr "Documentation en ligne" #: git-gui.sh:2238 #, tcl-format msgid "fatal: cannot stat path %s: No such file or directory" -msgstr "" -"fatale : pas d'infos sur le chemin %s : Fichier ou répertoire inexistant" +msgstr "erreur fatale : pas d'infos sur le chemin %s : Fichier ou répertoire inexistant" #: git-gui.sh:2271 msgid "Current Branch:" @@ -630,8 +629,7 @@ msgstr "Merci de choisir une branche de suivi" #: lib/branch_create.tcl:140 #, tcl-format msgid "Tracking branch %s is not a branch in the remote repository." -msgstr "" -"La branche de suivi %s n'est pas une branche dans le référentiel distant." +msgstr "La branche de suivi %s n'est pas une branche dans le référentiel distant." #: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 msgid "Please supply a branch name." @@ -751,7 +749,7 @@ msgstr "Récupération de %s à partir de %s" #: lib/checkout_op.tcl:127 #, tcl-format msgid "fatal: Cannot resolve %s" -msgstr "Erreur fatale : Impossible de résoudre %s" +msgstr "erreur fatale : Impossible de résoudre %s" #: lib/checkout_op.tcl:140 lib/console.tcl:81 lib/database.tcl:31 msgid "Close" @@ -798,12 +796,9 @@ msgid "" "\n" "The rescan will be automatically started now.\n" msgstr "" -"L'état lors de la dernière synchronisation ne correspond plus à l'état du " -"référentiel.\n" +"L'état lors de la dernière synchronisation ne correspond plus à l'état du référentiel.\n" "\n" -"Un autre programme Git a modifié ce référentiel depuis la dernière " -"synchronisation. Une resynchronisation doit être effectuée avant de pouvoir " -"modifier la branche courante.\n" +"Un autre programme Git a modifié ce référentiel depuis la dernière synchronisation. Une resynchronisation doit être effectuée avant de pouvoir modifier la branche courante.\n" "\n" "Cela va être fait tout de suite automatiquement.\n" @@ -814,13 +809,12 @@ msgstr "Mise à jour du répertoire courant avec '%s'..." #: lib/checkout_op.tcl:323 msgid "files checked out" -msgstr "" +msgstr "fichiers empruntés" #: lib/checkout_op.tcl:353 #, tcl-format msgid "Aborted checkout of '%s' (file level merging is required)." -msgstr "" -"Emprunt de '%s' abandonné. (Il est nécessaire de fusionner des fichiers.)" +msgstr "Emprunt de '%s' abandonné. (Il est nécessaire de fusionner des fichiers.)" #: lib/checkout_op.tcl:354 msgid "File level merge required." @@ -1089,8 +1083,7 @@ msgstr "" #: lib/choose_repository.tcl:880 msgid "Cannot determine HEAD. See console output for details." -msgstr "" -"Impossible de déterminer HEAD. Voir la sortie console pour plus de détails." +msgstr "Impossible de déterminer HEAD. Voir la sortie console pour plus de détails." #: lib/choose_repository.tcl:889 #, tcl-format @@ -1292,32 +1285,31 @@ msgstr "attention : Tcl ne supporte pas l'encodage '%s'." #: lib/commit.tcl:221 msgid "Calling pre-commit hook..." -msgstr "" +msgstr "Appel du programme externe d'avant commit..." #: lib/commit.tcl:236 msgid "Commit declined by pre-commit hook." -msgstr "" +msgstr "Commit refusé par le programme externe d'avant commit." #: lib/commit.tcl:259 msgid "Calling commit-msg hook..." -msgstr "" +msgstr "Appel du programme externe de message de commit..." #: lib/commit.tcl:274 msgid "Commit declined by commit-msg hook." -msgstr "" +msgstr "Commit refusé par le programme externe de message de commit." #: lib/commit.tcl:287 msgid "Committing changes..." -msgstr "" +msgstr "Commit des modifications..." #: lib/commit.tcl:303 msgid "write-tree failed:" msgstr "write-tree a échoué :" #: lib/commit.tcl:304 lib/commit.tcl:348 lib/commit.tcl:368 -#, fuzzy msgid "Commit failed." -msgstr "Le clonage a échoué." +msgstr "Le commit a échoué." #: lib/commit.tcl:321 #, tcl-format @@ -1479,8 +1471,7 @@ msgstr "Erreur lors du chargement des différences :" #: lib/diff.tcl:303 msgid "Failed to unstage selected hunk." -msgstr "" -"La suppression dans le pré-commit de la section sélectionnée a échouée." +msgstr "La suppression dans le pré-commit de la section sélectionnée a échouée." #: lib/diff.tcl:310 msgid "Failed to stage selected hunk." @@ -1510,8 +1501,7 @@ msgstr "Erreur de pré-commit" msgid "" "Updating the Git index failed. A rescan will be automatically started to " "resynchronize git-gui." -msgstr "" -"Le pré-commit a échoué. Une resynchronisation va être lancée automatiquement." +msgstr "Le pré-commit a échoué. Une resynchronisation va être lancée automatiquement." #: lib/index.tcl:27 msgid "Continue" @@ -1527,9 +1517,8 @@ msgid "Unstaging %s from commit" msgstr "Supprimer %s du commit" #: lib/index.tcl:313 -#, fuzzy msgid "Ready to commit." -msgstr "Pré-commité" +msgstr "Prêt à être commité." #: lib/index.tcl:326 #, tcl-format @@ -1627,9 +1616,9 @@ msgid "%s of %s" msgstr "%s de %s" #: lib/merge.tcl:119 -#, fuzzy, tcl-format +#, tcl-format msgid "Merging %s and %s..." -msgstr "Fusion de %s et %s" +msgstr "Fusion de %s et %s..." #: lib/merge.tcl:130 msgid "Merge completed successfully." @@ -1693,9 +1682,8 @@ msgid "Aborting" msgstr "Abandon" #: lib/merge.tcl:238 -#, fuzzy msgid "files reset" -msgstr "fichiers" +msgstr "fichiers réinitialisés" #: lib/merge.tcl:265 msgid "Abort failed." @@ -1759,9 +1747,8 @@ msgid "Number of Diff Context Lines" msgstr "Nombre de lignes de contexte dans les diffs" #: lib/option.tcl:127 -#, fuzzy msgid "Commit Message Text Width" -msgstr "Message de commit :" +msgstr "Largeur du texte de message de commit" #: lib/option.tcl:128 msgid "New Branch Name Template" @@ -1769,7 +1756,7 @@ msgstr "Nouveau modèle de nom de branche" #: lib/option.tcl:192 msgid "Spelling Dictionary:" -msgstr "" +msgstr "Dictionnaire d'orthographe :" #: lib/option.tcl:216 msgid "Change Font" @@ -1898,40 +1885,40 @@ msgstr "Impossible d'écrire l'icône :" #: lib/spellcheck.tcl:57 msgid "Unsupported spell checker" -msgstr "" +msgstr "Vérificateur d'orthographe non supporté" #: lib/spellcheck.tcl:65 msgid "Spell checking is unavailable" -msgstr "" +msgstr "La vérification d'orthographe n'est pas disponible" #: lib/spellcheck.tcl:68 msgid "Invalid spell checking configuration" -msgstr "" +msgstr "Configuration de vérification d'orthographe invalide" #: lib/spellcheck.tcl:70 #, tcl-format msgid "Reverting dictionary to %s." -msgstr "" +msgstr "Réinitialisation du dictionnaire à %s." #: lib/spellcheck.tcl:73 msgid "Spell checker silently failed on startup" -msgstr "" +msgstr "La vérification d'orthographe a échouée silentieusement au démarrage" #: lib/spellcheck.tcl:80 msgid "Unrecognized spell checker" -msgstr "" +msgstr "Vérificateur d'orthographe non reconnu" #: lib/spellcheck.tcl:180 msgid "No Suggestions" -msgstr "" +msgstr "Aucune suggestion" #: lib/spellcheck.tcl:381 msgid "Unexpected EOF from spell checker" -msgstr "" +msgstr "Fin de fichier innatendue envoyée par le vérificateur d'orthographe" #: lib/spellcheck.tcl:385 msgid "Spell Checker Failed" -msgstr "" +msgstr "Le vérificateur d'orthographe a échoué" #: lib/status_bar.tcl:83 #, tcl-format @@ -2002,3 +1989,4 @@ msgstr "Utiliser des petits paquets (pour les connexions lentes)" #: lib/transport.tcl:168 msgid "Include tags" msgstr "Inclure les marques" + diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index 9ee3f80452..e1eb963266 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -48,10 +48,11 @@ case "${1:-.}${2:-.}${3:-.}" in ;; "..$3") echo "Adding $4" - test -f "$4" || { + if test -f "$4" + then echo "ERROR: untracked $4 is overwritten by the merge." exit 1 - } + fi git update-index --add --cacheinfo "$7" "$3" "$4" && exec git checkout-index -u -f -- "$4" ;; diff --git a/git-svn.perl b/git-svn.perl index bba22c1321..81afb5cfcd 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1900,7 +1900,7 @@ sub prop_walk { foreach (sort keys %$dirent) { next if $dirent->{$_}->{kind} != $SVN::Node::dir; - $self->prop_walk($path . '/' . $_, $rev, $sub); + $self->prop_walk($p . $_, $rev, $sub); } } @@ -2239,12 +2239,13 @@ sub find_parent_branch { # just grow a tail if we're not unique enough :x $ref_id .= '-' while find_ref($ref_id); print STDERR "Initializing parent: $ref_id\n"; - my ($u, $p) = ($new_url, ''); + my ($u, $p, $repo_id) = ($new_url, '', $ref_id); if ($u =~ s#^\Q$url\E(/|$)##) { $p = $u; $u = $url; + $repo_id = $self->{repo_id}; } - $gs = Git::SVN->init($u, $p, $self->{repo_id}, $ref_id, 1); + $gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1); } my ($r0, $parent) = $gs->find_rev_before($r, 1); if (!defined $r0 || !defined $parent) { @@ -3665,7 +3666,7 @@ sub escape_uri_only { my ($uri) = @_; my @tmp; foreach (split m{/}, $uri) { - s/([^\w.-])/sprintf("%%%02X",ord($1))/eg; + s/([^\w.%-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg; push @tmp, $_; } join('/', @tmp); @@ -142,14 +142,15 @@ static int split_cmdline(char *cmdline, const char ***argv) static int handle_alias(int *argcp, const char ***argv) { - int nongit = 0, envchanged = 0, ret = 0, saved_errno = errno; + int envchanged = 0, ret = 0, saved_errno = errno; const char *subdir; int count, option_count; const char** new_argv; const char *alias_command; char *alias_string; + int unused_nongit; - subdir = setup_git_directory_gently(&nongit); + subdir = setup_git_directory_gently(&unused_nongit); alias_command = (*argv)[0]; alias_string = alias_lookup(alias_command); diff --git a/gitk-git/gitk b/gitk-git/gitk index 84ab02e15f..9a4d9c40cf 100644 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -8045,11 +8045,11 @@ proc doprefs {} { grid $top.cdisp - -sticky w -pady 10 label $top.bg -padx 40 -relief sunk -background $bgcolor button $top.bgbut -text [mc "Background"] -font optionfont \ - -command [list choosecolor bgcolor 0 $top.bg background setbg] + -command [list choosecolor bgcolor {} $top.bg background setbg] grid x $top.bgbut $top.bg -sticky w label $top.fg -padx 40 -relief sunk -background $fgcolor button $top.fgbut -text [mc "Foreground"] -font optionfont \ - -command [list choosecolor fgcolor 0 $top.fg foreground setfg] + -command [list choosecolor fgcolor {} $top.fg foreground setfg] grid x $top.fgbut $top.fg -sticky w label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0] button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \ @@ -8069,7 +8069,7 @@ proc doprefs {} { grid x $top.hunksepbut $top.hunksep -sticky w label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor button $top.selbgbut -text [mc "Select bg"] -font optionfont \ - -command [list choosecolor selectbgcolor 0 $top.selbgsep background setselbg] + -command [list choosecolor selectbgcolor {} $top.selbgsep background setselbg] grid x $top.selbgbut $top.selbgsep -sticky w label $top.cfont -text [mc "Fonts: press to choose"] diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ec73cb1256..73d098a433 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2164,7 +2164,7 @@ sub parse_difftree_raw_line { $res{'to_mode'} = $2; $res{'from_id'} = $3; $res{'to_id'} = $4; - $res{'status'} = $res{'status_str'} = $5; + $res{'status'} = $5; $res{'similarity'} = $6; if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied ($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7); @@ -2180,7 +2180,6 @@ sub parse_difftree_raw_line { $res{'to_mode'} = pop @{$res{'from_mode'}}; $res{'from_id'} = [ split(' ', $3) ]; $res{'to_id'} = pop @{$res{'from_id'}}; - $res{'status_str'} = $4; $res{'status'} = [ split('', $4) ]; $res{'to_file'} = unquote($5); } @@ -3002,7 +3001,7 @@ sub fill_from_file_info { sub is_deleted { my $diffinfo = shift; - return $diffinfo->{'status_str'} =~ /D/; + return $diffinfo->{'to_id'} eq ('0' x 40); } # does patch correspond to [previous] difftree raw line @@ -30,6 +30,7 @@ static struct option builtin_help_options[] = { HELP_FORMAT_WEB), OPT_SET_INT('i', "info", &help_format, "show info page", HELP_FORMAT_INFO), + OPT_END(), }; static const char * const builtin_help_usage[] = { diff --git a/imap-send.c b/imap-send.c index 10cce15a42..04afbc4924 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1302,6 +1302,10 @@ main(int argc, char **argv) fprintf( stderr, "no imap store specified\n" ); return 1; } + if (!server.host) { + fprintf( stderr, "no imap host specified\n" ); + return 1; + } /* read the messages */ if (!read_message( stdin, &all_msgs )) { diff --git a/log-tree.c b/log-tree.c index 5b2963998c..9d54061601 100644 --- a/log-tree.c +++ b/log-tree.c @@ -317,8 +317,10 @@ void show_log(struct rev_info *opt, const char *sep) if (opt->show_log_size) printf("log size %i\n", (int)msgbuf.len); - if (msgbuf.len) - printf("%s%s%s", msgbuf.buf, extra, sep); + if (msgbuf.len) { + fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout); + printf("%s%s", extra, sep); + } strbuf_release(&msgbuf); } @@ -8,10 +8,11 @@ * message and a signature block that git itself doesn't care about, * but that can be verified with gpg or similar. * - * The first three lines are guaranteed to be at least 63 bytes: + * The first four lines are guaranteed to be at least 83 bytes: * "object <sha1>\n" is 48 bytes, "type tag\n" at 9 bytes is the - * shortest possible type-line, and "tag .\n" at 6 bytes is the - * shortest single-character-tag line. + * shortest possible type-line, "tag .\n" at 6 bytes is the shortest + * single-character-tag line, and "tagger . <> 0 +0000\n" at 20 bytes is + * the shortest possible tagger-line. */ /* @@ -43,9 +44,10 @@ static int verify_tag(char *buffer, unsigned long size) int typelen; char type[20]; unsigned char sha1[20]; - const char *object, *type_line, *tag_line, *tagger_line; + const char *object, *type_line, *tag_line, *tagger_line, *lb, *rb; + size_t len; - if (size < 64) + if (size < 84) return error("wanna fool me ? you obviously got the size wrong !"); buffer[size] = 0; @@ -97,11 +99,51 @@ static int verify_tag(char *buffer, unsigned long size) /* Verify the tagger line */ tagger_line = tag_line; - if (memcmp(tagger_line, "tagger", 6) || (tagger_line[6] == '\n')) - return error("char" PD_FMT ": could not find \"tagger\"", tagger_line - buffer); - - /* TODO: check for committer info + blank line? */ - /* Also, the minimum length is probably + "tagger .", or 63+8=71 */ + if (memcmp(tagger_line, "tagger ", 7)) + return error("char" PD_FMT ": could not find \"tagger \"", + tagger_line - buffer); + + /* + * Check for correct form for name and email + * i.e. " <" followed by "> " on _this_ line + * No angle brackets within the name or email address fields. + * No spaces within the email address field. + */ + tagger_line += 7; + if (!(lb = strstr(tagger_line, " <")) || !(rb = strstr(lb+2, "> ")) || + strpbrk(tagger_line, "<>\n") != lb+1 || + strpbrk(lb+2, "><\n ") != rb) + return error("char" PD_FMT ": malformed tagger field", + tagger_line - buffer); + + /* Check for author name, at least one character, space is acceptable */ + if (lb == tagger_line) + return error("char" PD_FMT ": missing tagger name", + tagger_line - buffer); + + /* timestamp, 1 or more digits followed by space */ + tagger_line = rb + 2; + if (!(len = strspn(tagger_line, "0123456789"))) + return error("char" PD_FMT ": missing tag timestamp", + tagger_line - buffer); + tagger_line += len; + if (*tagger_line != ' ') + return error("char" PD_FMT ": malformed tag timestamp", + tagger_line - buffer); + tagger_line++; + + /* timezone, 5 digits [+-]hhmm, max. 1400 */ + if (!((tagger_line[0] == '+' || tagger_line[0] == '-') && + strspn(tagger_line+1, "0123456789") == 4 && + tagger_line[5] == '\n' && atoi(tagger_line+1) <= 1400)) + return error("char" PD_FMT ": malformed tag timezone", + tagger_line - buffer); + tagger_line += 6; + + /* Verify the blank line separating the header from the body */ + if (*tagger_line != '\n') + return error("char" PD_FMT ": trailing garbage in tag header", + tagger_line - buffer); /* The actual stuff afterwards we don't care about.. */ return 0; diff --git a/parse-options.c b/parse-options.c index 8e64316fe0..e87cafbe41 100644 --- a/parse-options.c +++ b/parse-options.c @@ -409,3 +409,10 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset) *(int *)(opt->value) = v; return 0; } + +int parse_opt_approxidate_cb(const struct option *opt, const char *arg, + int unset) +{ + *(unsigned long *)(opt->value) = approxidate(arg); + return 0; +} diff --git a/parse-options.h b/parse-options.h index 1af62b0485..4ee443dafe 100644 --- a/parse-options.h +++ b/parse-options.h @@ -94,6 +94,9 @@ struct option { #define OPT_SET_PTR(s, l, v, h, p) { OPTION_SET_PTR, (s), (l), (v), NULL, (h), 0, NULL, (p) } #define OPT_INTEGER(s, l, v, h) { OPTION_INTEGER, (s), (l), (v), NULL, (h) } #define OPT_STRING(s, l, v, a, h) { OPTION_STRING, (s), (l), (v), (a), (h) } +#define OPT_DATE(s, l, v, h) \ + { OPTION_CALLBACK, (s), (l), (v), "time",(h), 0, \ + parse_opt_approxidate_cb } #define OPT_CALLBACK(s, l, v, a, h, f) \ { OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) } @@ -110,6 +113,7 @@ extern NORETURN void usage_with_options(const char * const *usagestr, /*----- some often used options -----*/ extern int parse_opt_abbrev_cb(const struct option *, const char *, int); +extern int parse_opt_approxidate_cb(const struct option *, const char *, int); #define OPT__VERBOSE(var) OPT_BOOLEAN('v', "verbose", (var), "be verbose") #define OPT__QUIET(var) OPT_BOOLEAN('q', "quiet", (var), "be quiet") @@ -457,6 +457,7 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder, const struct commit *commit = c->commit; const char *msg = commit->buffer; struct commit_list *p; + int h1, h2; /* these are independent of the commit */ switch (placeholder[0]) { @@ -478,6 +479,16 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder, case 'n': /* newline */ strbuf_addch(sb, '\n'); return 1; + case 'x': + /* %x00 == NUL, %x0a == LF, etc. */ + if (0 <= (h1 = hexval_table[0xff & placeholder[1]]) && + h1 <= 16 && + 0 <= (h2 = hexval_table[0xff & placeholder[2]]) && + h2 <= 16) { + strbuf_addch(sb, (h1<<4)|h2); + return 3; + } else + return 0; } /* these depend on the commit */ @@ -232,7 +232,7 @@ static void read_branches_file(struct remote *remote) { const char *slash = strchr(remote->name, '/'); char *frag; - char *branch; + struct strbuf branch; int n = slash ? slash - remote->name : 1000; FILE *f = fopen(git_path("branches/%.*s", n, remote->name), "r"); char *s, *p; @@ -258,17 +258,33 @@ static void read_branches_file(struct remote *remote) strcpy(p, s); if (slash) strcat(p, slash); + + /* + * With "slash", e.g. "git fetch jgarzik/netdev-2.6" when + * reading from $GIT_DIR/branches/jgarzik fetches "HEAD" from + * the partial URL obtained from the branches file plus + * "/netdev-2.6" and does not store it in any tracking ref. + * #branch specifier in the file is ignored. + * + * Otherwise, the branches file would have URL and optionally + * #branch specified. The "master" (or specified) branch is + * fetched and stored in the local branch of the same name. + */ + strbuf_init(&branch, 0); frag = strchr(p, '#'); if (frag) { *(frag++) = '\0'; - branch = xmalloc(strlen(frag) + 12); - strcpy(branch, "refs/heads/"); - strcat(branch, frag); + strbuf_addf(&branch, "refs/heads/%s", frag); + } else + strbuf_addstr(&branch, "refs/heads/master"); + if (!slash) { + strbuf_addf(&branch, ":refs/heads/%s", remote->name); } else { - branch = "refs/heads/master"; + strbuf_reset(&branch); + strbuf_addstr(&branch, "HEAD:"); } add_url_alias(remote, p); - add_fetch_refspec(remote, branch); + add_fetch_refspec(remote, strbuf_detach(&branch, 0)); remote->fetch_tags = 1; /* always auto-follow */ } @@ -393,42 +409,127 @@ static void read_config(void) alias_all_urls(); } -struct refspec *parse_ref_spec(int nr_refspec, const char **refspec) +static struct refspec *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch) { int i; + int st; struct refspec *rs = xcalloc(sizeof(*rs), nr_refspec); + for (i = 0; i < nr_refspec; i++) { - const char *sp, *ep, *gp; - sp = refspec[i]; - if (*sp == '+') { + size_t llen, rlen; + int is_glob; + const char *lhs, *rhs; + + llen = rlen = is_glob = 0; + + lhs = refspec[i]; + if (*lhs == '+') { rs[i].force = 1; - sp++; + lhs++; } - gp = strchr(sp, '*'); - ep = strchr(sp, ':'); - if (gp && ep && gp > ep) - gp = NULL; - if (ep) { - if (ep[1]) { - const char *glob = strchr(ep + 1, '*'); - if (!glob) - gp = NULL; - if (gp) - rs[i].dst = xstrndup(ep + 1, - glob - ep - 1); - else - rs[i].dst = xstrdup(ep + 1); + + rhs = strrchr(lhs, ':'); + if (rhs) { + rhs++; + rlen = strlen(rhs); + is_glob = (2 <= rlen && !strcmp(rhs + rlen - 2, "/*")); + if (is_glob) + rlen -= 2; + rs[i].dst = xstrndup(rhs, rlen); + } + + llen = (rhs ? (rhs - lhs - 1) : strlen(lhs)); + if (2 <= llen && !memcmp(lhs + llen - 2, "/*", 2)) { + if ((rhs && !is_glob) || (!rhs && fetch)) + goto invalid; + is_glob = 1; + llen -= 2; + } else if (rhs && is_glob) { + goto invalid; + } + + rs[i].pattern = is_glob; + rs[i].src = xstrndup(lhs, llen); + + if (fetch) { + /* + * LHS + * - empty is allowed; it means HEAD. + * - otherwise it must be a valid looking ref. + */ + if (!*rs[i].src) + ; /* empty is ok */ + else { + st = check_ref_format(rs[i].src); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) + goto invalid; + } + /* + * RHS + * - missing is ok, and is same as empty. + * - empty is ok; it means not to store. + * - otherwise it must be a valid looking ref. + */ + if (!rs[i].dst) { + ; /* ok */ + } else if (!*rs[i].dst) { + ; /* ok */ + } else { + st = check_ref_format(rs[i].dst); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) + goto invalid; } } else { - ep = sp + strlen(sp); - } - if (gp) { - rs[i].pattern = 1; - ep = gp; + /* + * LHS + * - empty is allowed; it means delete. + * - when wildcarded, it must be a valid looking ref. + * - otherwise, it must be an extended SHA-1, but + * there is no existing way to validate this. + */ + if (!*rs[i].src) + ; /* empty is ok */ + else if (is_glob) { + st = check_ref_format(rs[i].src); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) + goto invalid; + } + else + ; /* anything goes, for now */ + /* + * RHS + * - missing is allowed, but LHS then must be a + * valid looking ref. + * - empty is not allowed. + * - otherwise it must be a valid looking ref. + */ + if (!rs[i].dst) { + st = check_ref_format(rs[i].src); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) + goto invalid; + } else if (!*rs[i].dst) { + goto invalid; + } else { + st = check_ref_format(rs[i].dst); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) + goto invalid; + } } - rs[i].src = xstrndup(sp, ep - sp); } return rs; + + invalid: + die("Invalid refspec '%s'", refspec[i]); +} + +struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec) +{ + return parse_refspec_internal(nr_refspec, refspec, 1); +} + +struct refspec *parse_push_refspec(int nr_refspec, const char **refspec) +{ + return parse_refspec_internal(nr_refspec, refspec, 0); } static int valid_remote_nick(const char *name) @@ -459,8 +560,8 @@ struct remote *remote_get(const char *name) add_url_alias(ret, name); if (!ret->url) return NULL; - ret->fetch = parse_ref_spec(ret->fetch_refspec_nr, ret->fetch_refspec); - ret->push = parse_ref_spec(ret->push_refspec_nr, ret->push_refspec); + ret->fetch = parse_fetch_refspec(ret->fetch_refspec_nr, ret->fetch_refspec); + ret->push = parse_push_refspec(ret->push_refspec_nr, ret->push_refspec); return ret; } @@ -473,11 +574,11 @@ int for_each_remote(each_remote_fn fn, void *priv) if (!r) continue; if (!r->fetch) - r->fetch = parse_ref_spec(r->fetch_refspec_nr, - r->fetch_refspec); + r->fetch = parse_fetch_refspec(r->fetch_refspec_nr, + r->fetch_refspec); if (!r->push) - r->push = parse_ref_spec(r->push_refspec_nr, - r->push_refspec); + r->push = parse_push_refspec(r->push_refspec_nr, + r->push_refspec); result = fn(r, priv); } return result; @@ -543,7 +644,8 @@ int remote_find_tracking(struct remote *remote, struct refspec *refspec) if (!fetch->dst) continue; if (fetch->pattern) { - if (!prefixcmp(needle, key)) { + if (!prefixcmp(needle, key) && + needle[strlen(key)] == '/') { *result = xmalloc(strlen(value) + strlen(needle) - strlen(key) + 1); @@ -790,7 +892,9 @@ static const struct refspec *check_pattern_match(const struct refspec *rs, { int i; for (i = 0; i < rs_nr; i++) { - if (rs[i].pattern && !prefixcmp(src->name, rs[i].src)) + if (rs[i].pattern && + !prefixcmp(src->name, rs[i].src) && + src->name[strlen(rs[i].src)] == '/') return rs + i; } return NULL; @@ -805,7 +909,7 @@ int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail, int nr_refspec, const char **refspec, int flags) { struct refspec *rs = - parse_ref_spec(nr_refspec, (const char **) refspec); + parse_push_refspec(nr_refspec, (const char **) refspec); int send_all = flags & MATCH_REFS_ALL; int send_mirror = flags & MATCH_REFS_MIRROR; @@ -989,7 +1093,7 @@ int get_fetch_map(const struct ref *remote_refs, struct ref ***tail, int missing_ok) { - struct ref *ref_map, *rm; + struct ref *ref_map, **rmp; if (refspec->pattern) { ref_map = get_expanded_map(remote_refs, refspec); @@ -1006,10 +1110,20 @@ int get_fetch_map(const struct ref *remote_refs, } } - for (rm = ref_map; rm; rm = rm->next) { - if (rm->peer_ref && check_ref_format(rm->peer_ref->name + 5)) - die("* refusing to create funny ref '%s' locally", - rm->peer_ref->name); + for (rmp = &ref_map; *rmp; ) { + if ((*rmp)->peer_ref) { + int st = check_ref_format((*rmp)->peer_ref->name + 5); + if (st && st != CHECK_REF_FORMAT_ONELEVEL) { + struct ref *ignore = *rmp; + error("* Ignoring funny ref '%s' locally", + (*rmp)->peer_ref->name); + *rmp = (*rmp)->next; + free(ignore->peer_ref); + free(ignore); + continue; + } + } + rmp = &((*rmp)->next); } if (ref_map) @@ -67,7 +67,8 @@ void free_refs(struct ref *ref); */ void ref_remove_duplicates(struct ref *ref_map); -struct refspec *parse_ref_spec(int nr_refspec, const char **refspec); +struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec); +struct refspec *parse_push_refspec(int nr_refspec, const char **refspec); int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail, int nr_refspec, const char **refspec, int all); diff --git a/revision.c b/revision.c index 63bf2c5c2d..196fedc9d1 100644 --- a/revision.c +++ b/revision.c @@ -564,14 +564,39 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs) free_patch_ids(&ids); } -static void add_to_list(struct commit_list **p, struct commit *commit, struct commit_list *n) +/* How many extra uninteresting commits we want to see.. */ +#define SLOP 5 + +static int still_interesting(struct commit_list *src, unsigned long date, int slop) { - p = &commit_list_insert(commit, p)->next; - *p = n; + /* + * No source list at all? We're definitely done.. + */ + if (!src) + return 0; + + /* + * Does the destination list contain entries with a date + * before the source list? Definitely _not_ done. + */ + if (date < src->item->date) + return SLOP; + + /* + * Does the source list still have interesting commits in + * it? Definitely not done.. + */ + if (!everybody_uninteresting(src)) + return SLOP; + + /* Ok, we're closing in.. */ + return slop-1; } static int limit_list(struct rev_info *revs) { + int slop = SLOP; + unsigned long date = ~0ul; struct commit_list *list = revs->commits; struct commit_list *newlist = NULL; struct commit_list **p = &newlist; @@ -591,16 +616,19 @@ static int limit_list(struct rev_info *revs) return -1; if (obj->flags & UNINTERESTING) { mark_parents_uninteresting(commit); - if (everybody_uninteresting(list)) { - if (revs->show_all) - add_to_list(p, commit, list); - break; - } - if (!revs->show_all) - continue; + if (revs->show_all) + p = &commit_list_insert(commit, p)->next; + slop = still_interesting(list, date, slop); + if (slop) + continue; + /* If showing all, add the whole pending list to the end */ + if (revs->show_all) + *p = list; + break; } if (revs->min_age != -1 && (commit->date > revs->min_age)) continue; + date = commit->date; p = &commit_list_insert(commit, p)->next; show = show_early_output; @@ -326,6 +326,14 @@ const char *setup_git_directory_gently(int *nongit_ok) int len, offset; /* + * Let's assume that we are in a git repository. + * If it turns out later that we are somewhere else, the value will be + * updated accordingly. + */ + if (nongit_ok) + *nongit_ok = 0; + + /* * If GIT_DIR is set explicitly, we're not going * to do any discovery, but we still do repository * validation. diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index 9ee35e7901..9decd2e1e8 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -49,8 +49,28 @@ poke() { test-chmtime +1 "$1" } -SVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'} -SVN_HTTPD_PATH=${SVN_HTTPD_PATH-'/usr/sbin/apache2'} +for d in \ + "$SVN_HTTPD_PATH" \ + /usr/sbin/apache2 \ + /usr/sbin/httpd \ +; do + if test -f "$d" + then + SVN_HTTPD_PATH="$d" + break + fi +done +for d in \ + "$SVN_HTTPD_MODULE_PATH" \ + /usr/lib/apache2/modules \ + /usr/libexec/apache2 \ +; do + if test -d "$d" + then + SVN_HTTPD_MODULE_PATH="$d" + break + fi +done start_httpd () { if test -z "$SVN_HTTPD_PORT" @@ -66,6 +86,7 @@ ServerName "git-svn test" ServerRoot "$GIT_DIR" DocumentRoot "$GIT_DIR" PidFile "$GIT_DIR/httpd.pid" +LockFile logs/accept.lock Listen 127.0.0.1:$SVN_HTTPD_PORT LoadModule dav_module $SVN_HTTPD_MODULE_PATH/mod_dav.so LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so diff --git a/t/t0001-init.sh b/t/t0001-init.sh index c015405f12..b0289e397a 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -113,4 +113,21 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' ' fi ' +test_expect_success 'reinit' ' + + ( + unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG + + mkdir again && + cd again && + git init >out1 2>err1 && + git init >out2 2>err2 + ) && + grep "Initialized empty" again/out1 && + grep "Reinitialized existing" again/out2 && + >again/empty && + test_cmp again/empty again/err1 && + test_cmp again/empty again/err2 +' + test_done diff --git a/t/t1000-read-tree-m-3way.sh b/t/t1000-read-tree-m-3way.sh index 6c065bfa21..17f519f547 100755 --- a/t/t1000-read-tree-m-3way.sh +++ b/t/t1000-read-tree-m-3way.sh @@ -214,7 +214,7 @@ test_expect_success '1 - must not have an entry not in A.' " rm -f .git/index XX && echo XX >XX && git update-index --add XX && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -254,7 +254,7 @@ test_expect_success \ cp .orig-A/AN AN && echo extra >>AN && git update-index --add AN && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -271,7 +271,7 @@ test_expect_success \ cp .orig-A/AA AA && git update-index --add AA && echo extra >>AA && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -280,7 +280,7 @@ test_expect_success \ cp .orig-A/AA AA && echo extra >>AA && git update-index --add AA && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -306,7 +306,7 @@ test_expect_success \ cp .orig-A/LL LL && echo extra >>LL && git update-index --add LL && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -314,7 +314,7 @@ test_expect_success \ rm -f .git/index DD && echo DD >DD git update-index --add DD && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -322,7 +322,7 @@ test_expect_success \ rm -f .git/index DM && cp .orig-B/DM DM && git update-index --add DM && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -330,7 +330,7 @@ test_expect_success \ rm -f .git/index DN && cp .orig-B/DN DN && git update-index --add DN && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -347,7 +347,7 @@ test_expect_success \ cp .orig-A/MD MD && git update-index --add MD && echo extra >>MD && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -356,7 +356,7 @@ test_expect_success \ cp .orig-A/MD MD && echo extra >>MD && git update-index --add MD && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -373,7 +373,7 @@ test_expect_success \ cp .orig-A/ND ND && git update-index --add ND && echo extra >>ND && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -382,7 +382,7 @@ test_expect_success \ cp .orig-A/ND ND && echo extra >>ND && git update-index --add ND && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -399,7 +399,7 @@ test_expect_success \ cp .orig-A/MM MM && git update-index --add MM && echo extra >>MM && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -408,7 +408,7 @@ test_expect_success \ cp .orig-A/MM MM && echo extra >>MM && git update-index --add MM && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -434,7 +434,7 @@ test_expect_success \ cp .orig-A/SS SS && echo extra >>SS && git update-index --add SS && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -477,7 +477,7 @@ test_expect_success \ cp .orig-A/NM NM && git update-index --add NM && echo extra >>NM && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -486,7 +486,7 @@ test_expect_success \ cp .orig-A/NM NM && echo extra >>NM && git update-index --add NM && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " test_expect_success \ @@ -512,7 +512,7 @@ test_expect_success \ cp .orig-A/NN NN && echo extra >>NN && git update-index --add NN && - ! git read-tree -m $tree_O $tree_A $tree_B + test_must_fail git read-tree -m $tree_O $tree_A $tree_B " # #16 diff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh index d609a551ae..570d3729bd 100755 --- a/t/t1004-read-tree-m-u-wf.sh +++ b/t/t1004-read-tree-m-u-wf.sh @@ -116,4 +116,126 @@ test_expect_success 'three-way not complaining on an untracked file' ' git read-tree -m -u --exclude-per-directory=.gitignore branch-point master side ' +test_expect_success '3-way not overwriting local changes (setup)' ' + + git reset --hard && + git checkout -b side-a branch-point && + echo >>file1 "new line to be kept in the merge result" && + git commit -a -m "side-a changes file1" && + git checkout -b side-b branch-point && + echo >>file2 "new line to be kept in the merge result" && + git commit -a -m "side-b changes file2" && + git checkout side-a + +' + +test_expect_success '3-way not overwriting local changes (our side)' ' + + # At this point, file1 from side-a should be kept as side-b + # did not touch it. + + git reset --hard && + + echo >>file1 "local changes" && + git read-tree -m -u branch-point side-a side-b && + grep "new line to be kept" file1 && + grep "local changes" file1 + +' + +test_expect_success '3-way not overwriting local changes (their side)' ' + + # At this point, file2 from side-b should be taken as side-a + # did not touch it. + + git reset --hard && + + echo >>file2 "local changes" && + test_must_fail git read-tree -m -u branch-point side-a side-b && + ! grep "new line to be kept" file2 && + grep "local changes" file2 + +' + +test_expect_success 'funny symlink in work tree' ' + + git reset --hard && + git checkout -b sym-b side-b && + mkdir -p a && + >a/b && + git add a/b && + git commit -m "side adds a/b" && + + rm -fr a && + git checkout -b sym-a side-a && + mkdir -p a && + ln -s ../b a/b && + git add a/b && + git commit -m "we add a/b" && + + git read-tree -m -u sym-a sym-a sym-b + +' + +test_expect_success 'funny symlink in work tree, un-unlink-able' ' + + rm -fr a b && + git reset --hard && + + git checkout sym-a && + chmod a-w a && + test_must_fail git read-tree -m -u sym-a sym-a sym-b + +' + +# clean-up from the above test +chmod a+w a +rm -fr a b + +test_expect_success 'D/F setup' ' + + git reset --hard && + + git checkout side-a && + rm -f subdir/file2 && + mkdir subdir/file2 && + echo qfwfq >subdir/file2/another && + git add subdir/file2/another && + test_tick && + git commit -m "side-a changes file2 to directory" + +' + +test_expect_success 'D/F' ' + + git checkout side-b && + git read-tree -m -u branch-point side-b side-a && + git ls-files -u >actual && + ( + a=$(git rev-parse branch-point:subdir/file2) + b=$(git rev-parse side-a:subdir/file2/another) + echo "100644 $a 1 subdir/file2" + echo "100644 $a 2 subdir/file2" + echo "100644 $b 3 subdir/file2/another" + ) >expect && + test_cmp actual expect + +' + +test_expect_success 'D/F resolve' ' + + git reset --hard && + git checkout side-b && + git merge-resolve branch-point -- side-b side-a + +' + +test_expect_success 'D/F recursive' ' + + git reset --hard && + git checkout side-b && + git merge-recursive branch-point -- side-b side-a + +' + test_done diff --git a/t/t2201-add-update-typechange.sh b/t/t2201-add-update-typechange.sh new file mode 100755 index 0000000000..e15e3eb81b --- /dev/null +++ b/t/t2201-add-update-typechange.sh @@ -0,0 +1,140 @@ +#!/bin/sh + +test_description='more git add -u' + +. ./test-lib.sh + +_z40=0000000000000000000000000000000000000000 + +test_expect_success setup ' + >xyzzy && + _empty=$(git hash-object --stdin <xyzzy) && + >yomin && + >caskly && + ln -s frotz nitfol && + mkdir rezrov && + >rezrov/bozbar && + git add caskly xyzzy yomin nitfol rezrov/bozbar && + + test_tick && + git commit -m initial + +' + +test_expect_success modify ' + rm -f xyzzy yomin nitfol caskly && + # caskly disappears (not a submodule) + mkdir caskly && + # nitfol changes from symlink to regular + >nitfol && + # rezrov/bozbar disappears + rm -fr rezrov && + ln -s xyzzy rezrov && + # xyzzy disappears (not a submodule) + mkdir xyzzy && + echo gnusto >xyzzy/bozbar && + # yomin gets replaced with a submodule + mkdir yomin && + >yomin/yomin && + ( + cd yomin && + git init && + git add yomin && + git commit -m "sub initial" + ) && + yomin=$(GIT_DIR=yomin/.git git rev-parse HEAD) && + # yonk is added and then turned into a submodule + # this should appear as T in diff-files and as A in diff-index + >yonk && + git add yonk && + rm -f yonk && + mkdir yonk && + >yonk/yonk && + ( + cd yonk && + git init && + git add yonk && + git commit -m "sub initial" + ) && + yonk=$(GIT_DIR=yonk/.git git rev-parse HEAD) && + # zifmia is added and then removed + # this should appear in diff-files but not in diff-index. + >zifmia && + git add zifmia && + rm -f zifmia && + mkdir zifmia && + { + git ls-tree -r HEAD | + sed -e "s/^/:/" -e " + / caskly/{ + s/ caskly/ $_z40 D&/ + s/blob/000000/ + } + / nitfol/{ + s/ nitfol/ $_z40 T&/ + s/blob/100644/ + } + / rezrov.bozbar/{ + s/ rezrov.bozbar/ $_z40 D&/ + s/blob/000000/ + } + / xyzzy/{ + s/ xyzzy/ $_z40 D&/ + s/blob/000000/ + } + / yomin/{ + s/ yomin/ $_z40 T&/ + s/blob/160000/ + } + " + } >expect && + { + cat expect + echo ":100644 160000 $_empty $_z40 T yonk" + echo ":100644 000000 $_empty $_z40 D zifmia" + } >expect-files && + { + cat expect + echo ":000000 160000 $_z40 $_z40 A yonk" + } >expect-index && + { + echo "100644 $_empty 0 nitfol" + echo "160000 $yomin 0 yomin" + echo "160000 $yonk 0 yonk" + } >expect-final +' + +test_expect_success diff-files ' + git diff-files --raw >actual && + diff -u expect-files actual +' + +test_expect_success diff-index ' + git diff-index --raw HEAD -- >actual && + diff -u expect-index actual +' + +test_expect_success 'add -u' ' + rm -f ".git/saved-index" && + cp -p ".git/index" ".git/saved-index" && + git add -u && + git ls-files -s >actual && + diff -u expect-final actual +' + +test_expect_success 'commit -a' ' + if test -f ".git/saved-index" + then + rm -f ".git/index" && + mv ".git/saved-index" ".git/index" + fi && + git commit -m "second" -a && + git ls-files -s >actual && + diff -u expect-final actual && + rm -f .git/index && + git read-tree HEAD && + git ls-files -s >actual && + diff -u expect-final actual +' + +test_done diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 38a90adad6..cb5f7a4441 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -153,16 +153,6 @@ test_expect_success 'test tracking setup via config' \ test $(git config branch.my3.remote) = local && test $(git config branch.my3.merge) = refs/heads/master' -test_expect_success 'avoid ambiguous track' ' - git config branch.autosetupmerge true && - git config remote.ambi1.url = lalala && - git config remote.ambi1.fetch = refs/heads/lalala:refs/heads/master && - git config remote.ambi2.url = lilili && - git config remote.ambi2.fetch = refs/heads/lilili:refs/heads/master && - git branch all1 master && - test -z "$(git config branch.all1.merge)" -' - test_expect_success 'test overriding tracking setup via --no-track' \ 'git config branch.autosetupmerge true && git config remote.local.url . && @@ -224,4 +214,14 @@ test_expect_success \ test -f .git/logs/refs/heads/g/h/i && diff expect .git/logs/refs/heads/g/h/i' +test_expect_success 'avoid ambiguous track' ' + git config branch.autosetupmerge true && + git config remote.ambi1.url lalala && + git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master && + git config remote.ambi2.url lilili && + git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master && + git branch all1 master && + test -z "$(git config branch.all1.merge)" +' + test_done diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index 77c90f6fa0..f15be93e77 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -66,4 +66,23 @@ test_expect_success 'revert works (commit)' ' grep "unchanged *+3/-0 file" output ' +test_expect_success 'patch does not affect mode' ' + git reset --hard && + echo content >>file && + chmod +x file && + printf "n\\ny\\n" | git add -p && + git show :file | grep content && + git diff file | grep "new mode" +' + +test_expect_success 'stage mode but not hunk' ' + git reset --hard && + echo content >>file && + chmod +x file && + printf "y\\nn\\n" | git add -p && + git diff --cached file | grep "new mode" && + git diff file | grep "+content" +' + + test_done diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 278075823b..df1fd6f86f 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -14,7 +14,7 @@ test_description='git-mktag: tag object verify test' check_verify_failure () { expect="$2" test_expect_success "$1" ' - ( ! git-mktag <tag.sig 2>message ) && + ( test_must_fail git-mktag <tag.sig 2>message ) && grep "$expect" message ' } @@ -44,6 +44,8 @@ cat >tag.sig <<EOF xxxxxx 139e9b33986b1c2670fff52c5067603117b3e895 type tag tag mytag +tagger . <> 0 +0000 + EOF check_verify_failure '"object" line label check' '^error: char0: .*"object "$' @@ -55,6 +57,8 @@ cat >tag.sig <<EOF object zz9e9b33986b1c2670fff52c5067603117b3e895 type tag tag mytag +tagger . <> 0 +0000 + EOF check_verify_failure '"object" line SHA1 check' '^error: char7: .*SHA1 hash$' @@ -66,6 +70,8 @@ cat >tag.sig <<EOF object 779e9b33986b1c2670fff52c5067603117b3e895 xxxx tag tag mytag +tagger . <> 0 +0000 + EOF check_verify_failure '"type" line label check' '^error: char47: .*"\\ntype "$' @@ -85,6 +91,8 @@ cat >tag.sig <<EOF object 779e9b33986b1c2670fff52c5067603117b3e895 type tag xxx mytag +tagger . <> 0 +0000 + EOF check_verify_failure '"tag" line label check #1' \ @@ -121,6 +129,8 @@ cat >tag.sig <<EOF object 779e9b33986b1c2670fff52c5067603117b3e895 type tagggg tag mytag +tagger . <> 0 +0000 + EOF check_verify_failure 'verify object (SHA1/type) check' \ @@ -133,6 +143,8 @@ cat >tag.sig <<EOF object $head type commit tag my tag +tagger . <> 0 +0000 + EOF check_verify_failure 'verify tag-name check' \ @@ -145,10 +157,12 @@ cat >tag.sig <<EOF object $head type commit tag mytag + +This is filler EOF check_verify_failure '"tagger" line label check #1' \ - '^error: char70: could not find "tagger"$' + '^error: char70: could not find "tagger "$' ############################################################ # 12. tagger line label check #2 @@ -158,19 +172,180 @@ object $head type commit tag mytag tagger + +This is filler EOF check_verify_failure '"tagger" line label check #2' \ - '^error: char70: could not find "tagger"$' + '^error: char70: could not find "tagger "$' ############################################################ -# 13. create valid tag +# 13. disallow missing tag author name cat >tag.sig <<EOF object $head type commit tag mytag -tagger another@example.com +tagger <> 0 +0000 + +This is filler +EOF + +check_verify_failure 'disallow missing tag author name' \ + '^error: char77: missing tagger name$' + +############################################################ +# 14. disallow missing tag author name + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger < + > 0 +0000 + +EOF + +check_verify_failure 'disallow malformed tagger' \ + '^error: char77: malformed tagger field$' + +############################################################ +# 15. allow empty tag email + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <> 0 +0000 + +EOF + +test_expect_success \ + 'allow empty tag email' \ + 'git-mktag <tag.sig >.git/refs/tags/mytag 2>message' + +############################################################ +# 16. disallow spaces in tag email + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tag ger@example.com> 0 +0000 + +EOF + +check_verify_failure 'disallow spaces in tag email' \ + '^error: char77: malformed tagger field$' + +############################################################ +# 17. disallow missing tag timestamp + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> + +EOF + +check_verify_failure 'disallow missing tag timestamp' \ + '^error: char107: missing tag timestamp$' + +############################################################ +# 18. detect invalid tag timestamp1 + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> Tue Mar 25 15:47:44 2008 + +EOF + +check_verify_failure 'detect invalid tag timestamp1' \ + '^error: char107: missing tag timestamp$' + +############################################################ +# 19. detect invalid tag timestamp2 + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 2008-03-31T12:20:15-0500 + +EOF + +check_verify_failure 'detect invalid tag timestamp2' \ + '^error: char111: malformed tag timestamp$' + +############################################################ +# 20. detect invalid tag timezone1 + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 1206478233 GMT + +EOF + +check_verify_failure 'detect invalid tag timezone1' \ + '^error: char118: malformed tag timezone$' + +############################################################ +# 21. detect invalid tag timezone2 + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 1206478233 + 30 + +EOF + +check_verify_failure 'detect invalid tag timezone2' \ + '^error: char118: malformed tag timezone$' + +############################################################ +# 22. detect invalid tag timezone3 + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 1206478233 -1430 + +EOF + +check_verify_failure 'detect invalid tag timezone3' \ + '^error: char118: malformed tag timezone$' + +############################################################ +# 23. detect invalid header entry + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 1206478233 -0500 +this line should not be here + +EOF + +check_verify_failure 'detect invalid header entry' \ + '^error: char124: trailing garbage in tag header$' + +############################################################ +# 24. create valid tag + +cat >tag.sig <<EOF +object $head +type commit +tag mytag +tagger T A Gger <tagger@example.com> 1206478233 -0500 + EOF test_expect_success \ @@ -178,7 +353,7 @@ test_expect_success \ 'git-mktag <tag.sig >.git/refs/tags/mytag 2>message' ############################################################ -# 14. check mytag +# 25. check mytag test_expect_success \ 'check mytag' \ diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh index 64f34e3298..43943ab8ca 100755 --- a/t/t4104-apply-boundary.sh +++ b/t/t4104-apply-boundary.sh @@ -112,4 +112,17 @@ do ' done +test_expect_success 'two lines' ' + + >file && + git add file && + echo aaa >file && + git diff >patch && + git add file && + echo bbb >file && + git add file && + test_must_fail git apply --check patch + +' + test_done diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh index 47090c4cf5..9fd9d07000 100644 --- a/t/t5304-prune.sh +++ b/t/t5304-prune.sh @@ -78,4 +78,38 @@ test_expect_success 'gc: start with ok gc.pruneExpire' ' ' +test_expect_success 'prune: prune nonsense parameters' ' + + test_must_fail git prune garbage && + test_must_fail git prune --- && + test_must_fail git prune --no-such-option + +' + +test_expect_success 'prune: prune unreachable heads' ' + + git config core.logAllRefUpdates false && + mv .git/logs .git/logs.old && + : > file2 && + git add file2 && + git commit -m temporary && + tmp_head=$(git rev-list -1 HEAD) && + git reset HEAD^ && + git prune && + test_must_fail git reset $tmp_head -- + +' + +test_expect_success 'prune: do not prune heads listed as an argument' ' + + : > file2 && + git add file2 && + git commit -m temporary && + tmp_head=$(git rev-list -1 HEAD) && + git reset HEAD^ && + git prune -- $tmp_head && + git reset $tmp_head -- + +' + test_done diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index ecfc999aaa..0a7fea865d 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -106,6 +106,8 @@ cat > test/expect << EOF master Tracked remote branches side master + Local branches pushed with 'git push' + master:upstream +refs/tags/lastbackup EOF test_expect_success 'show' ' @@ -118,6 +120,10 @@ test_expect_success 'show' ' echo 1 > file && test_tick && git commit -m update file) && + git config remote.origin.push \ + refs/heads/master:refs/heads/upstream && + git config --add remote.origin.push \ + +refs/tags/lastbackup && git remote show origin > output && git diff expect output) ' @@ -237,4 +243,14 @@ test_expect_success 'update default (overridden, with funny whitespace)' ' ' +test_expect_success '"remote show" does not show symbolic refs' ' + + git clone one three && + (cd three && + git remote show origin > output && + ! grep HEAD < output && + ! grep -i stale < output) + +' + test_done diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh new file mode 100755 index 0000000000..670a8f1c99 --- /dev/null +++ b/t/t5511-refspec.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +test_description='refspec parsing' + +. ./test-lib.sh + +test_refspec () { + + kind=$1 refspec=$2 expect=$3 + git config remote.frotz.url "." && + git config --remove-section remote.frotz && + git config remote.frotz.url "." && + git config "remote.frotz.$kind" "$refspec" && + if test "$expect" != invalid + then + title="$kind $refspec" + test='git ls-remote frotz' + else + title="$kind $refspec (invalid)" + test='test_must_fail git ls-remote frotz' + fi + test_expect_success "$title" "$test" +} + +test_refspec push '' invalid +test_refspec push ':' invalid + +test_refspec fetch '' +test_refspec fetch ':' + +test_refspec push 'refs/heads/*:refs/remotes/frotz/*' +test_refspec push 'refs/heads/*:refs/remotes/frotz' invalid +test_refspec push 'refs/heads:refs/remotes/frotz/*' invalid +test_refspec push 'refs/heads/master:refs/remotes/frotz/xyzzy' + + +# These have invalid LHS, but we do not have a formal "valid sha-1 +# expression syntax checker" so they are not checked with the current +# code. They will be caught downstream anyway, but we may want to +# have tighter check later... + +: test_refspec push 'refs/heads/master::refs/remotes/frotz/xyzzy' invalid +: test_refspec push 'refs/heads/maste :refs/remotes/frotz/xyzzy' invalid + +test_refspec fetch 'refs/heads/*:refs/remotes/frotz/*' +test_refspec fetch 'refs/heads/*:refs/remotes/frotz' invalid +test_refspec fetch 'refs/heads:refs/remotes/frotz/*' invalid +test_refspec fetch 'refs/heads/master:refs/remotes/frotz/xyzzy' +test_refspec fetch 'refs/heads/master::refs/remotes/frotz/xyzzy' invalid +test_refspec fetch 'refs/heads/maste :refs/remotes/frotz/xyzzy' invalid + +test_refspec push 'master~1:refs/remotes/frotz/backup' +test_refspec fetch 'master~1:refs/remotes/frotz/backup' invalid +test_refspec push 'HEAD~4:refs/remotes/frotz/new' +test_refspec fetch 'HEAD~4:refs/remotes/frotz/new' invalid + +test_refspec push 'HEAD' +test_refspec fetch 'HEAD' +test_refspec push 'refs/heads/ nitfol' invalid +test_refspec fetch 'refs/heads/ nitfol' invalid + +test_refspec push 'HEAD:' invalid +test_refspec fetch 'HEAD:' +test_refspec push 'refs/heads/ nitfol:' invalid +test_refspec fetch 'refs/heads/ nitfol:' invalid + +test_refspec push ':refs/remotes/frotz/deleteme' +test_refspec fetch ':refs/remotes/frotz/HEAD-to-me' +test_refspec push ':refs/remotes/frotz/delete me' invalid +test_refspec fetch ':refs/remotes/frotz/HEAD to me' invalid + +test_done diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 31c1081617..65c37744aa 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -131,8 +131,10 @@ do test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'` cnt=`expr $test_count + 1` pfx=`printf "%04d" $cnt` - expect="../../t5515/fetch.$test" - actual="$pfx-fetch.$test" + expect_f="../../t5515/fetch.$test" + actual_f="$pfx-fetch.$test" + expect_r="../../t5515/refs.$test" + actual_r="$pfx-refs.$test" test_expect_success "$cmd" ' { @@ -145,14 +147,24 @@ do rm -f .git/refs/tags/* git fetch "$@" >/dev/null cat .git/FETCH_HEAD - } >"$actual" && - if test -f "$expect" + } >"$actual_f" && + git show-ref >"$actual_r" && + if test -f "$expect_f" then - git diff -u "$expect" "$actual" && - rm -f "$actual" + git diff -u "$expect_f" "$actual_f" && + rm -f "$actual_f" else # this is to help developing new tests. - cp "$actual" "$expect" + cp "$actual_f" "$expect_f" + false + fi && + if test -f "$expect_r" + then + git diff -u "$expect_r" "$actual_r" && + rm -f "$actual_r" + else + # this is to help developing new tests. + cp "$actual_r" "$expect_r" false fi ' diff --git a/t/t5515/refs.br-branches-default b/t/t5515/refs.br-branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-default-merge b/t/t5515/refs.br-branches-default-merge new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default-merge @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-default-merge_branches-default b/t/t5515/refs.br-branches-default-merge_branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default-merge_branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-default-octopus b/t/t5515/refs.br-branches-default-octopus new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default-octopus @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-default-octopus_branches-default b/t/t5515/refs.br-branches-default-octopus_branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default-octopus_branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-default_branches-default b/t/t5515/refs.br-branches-default_branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-branches-default_branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one b/t/t5515/refs.br-branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one-merge b/t/t5515/refs.br-branches-one-merge new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one-merge @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one-merge_branches-one b/t/t5515/refs.br-branches-one-merge_branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one-merge_branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one-octopus b/t/t5515/refs.br-branches-one-octopus new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one-octopus @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one-octopus_branches-one b/t/t5515/refs.br-branches-one-octopus_branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one-octopus_branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-branches-one_branches-one b/t/t5515/refs.br-branches-one_branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-branches-one_branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit b/t/t5515/refs.br-config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit-merge b/t/t5515/refs.br-config-explicit-merge new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit-merge @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit-merge_config-explicit b/t/t5515/refs.br-config-explicit-merge_config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit-merge_config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit-octopus b/t/t5515/refs.br-config-explicit-octopus new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit-octopus @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit-octopus_config-explicit b/t/t5515/refs.br-config-explicit-octopus_config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit-octopus_config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-explicit_config-explicit b/t/t5515/refs.br-config-explicit_config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-explicit_config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob b/t/t5515/refs.br-config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob-merge b/t/t5515/refs.br-config-glob-merge new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob-merge @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob-merge_config-glob b/t/t5515/refs.br-config-glob-merge_config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob-merge_config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob-octopus b/t/t5515/refs.br-config-glob-octopus new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob-octopus @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob-octopus_config-glob b/t/t5515/refs.br-config-glob-octopus_config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob-octopus_config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-config-glob_config-glob b/t/t5515/refs.br-config-glob_config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-config-glob_config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit b/t/t5515/refs.br-remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit-merge b/t/t5515/refs.br-remote-explicit-merge new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit-merge @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit-merge_remote-explicit b/t/t5515/refs.br-remote-explicit-merge_remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit-merge_remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit-octopus b/t/t5515/refs.br-remote-explicit-octopus new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit-octopus @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit-octopus_remote-explicit b/t/t5515/refs.br-remote-explicit-octopus_remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit-octopus_remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-explicit_remote-explicit b/t/t5515/refs.br-remote-explicit_remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-explicit_remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob b/t/t5515/refs.br-remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob-merge b/t/t5515/refs.br-remote-glob-merge new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob-merge @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob-merge_remote-glob b/t/t5515/refs.br-remote-glob-merge_remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob-merge_remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob-octopus b/t/t5515/refs.br-remote-glob-octopus new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob-octopus @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob-octopus_remote-glob b/t/t5515/refs.br-remote-glob-octopus_remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob-octopus_remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-remote-glob_remote-glob b/t/t5515/refs.br-remote-glob_remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-remote-glob_remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig b/t/t5515/refs.br-unconfig new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.br-unconfig @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_--tags_.._.git b/t/t5515/refs.br-unconfig_--tags_.._.git new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.br-unconfig_--tags_.._.git @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_.._.git b/t/t5515/refs.br-unconfig_.._.git new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.br-unconfig_.._.git_one b/t/t5515/refs.br-unconfig_.._.git_one new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git_one @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_.._.git_one_two b/t/t5515/refs.br-unconfig_.._.git_one_two new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git_one_two @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.br-unconfig_.._.git_tag_tag-one_tag_tag-three @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_branches-default b/t/t5515/refs.br-unconfig_branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.br-unconfig_branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_branches-one b/t/t5515/refs.br-unconfig_branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.br-unconfig_branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_config-explicit b/t/t5515/refs.br-unconfig_config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-unconfig_config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_config-glob b/t/t5515/refs.br-unconfig_config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-unconfig_config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_remote-explicit b/t/t5515/refs.br-unconfig_remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-unconfig_remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.br-unconfig_remote-glob b/t/t5515/refs.br-unconfig_remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.br-unconfig_remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master b/t/t5515/refs.master new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.master @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_--tags_.._.git b/t/t5515/refs.master_--tags_.._.git new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.master_--tags_.._.git @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_.._.git b/t/t5515/refs.master_.._.git new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.master_.._.git @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.master_.._.git_one b/t/t5515/refs.master_.._.git_one new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.master_.._.git_one @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.master_.._.git_one_tag_tag-one_tag_tag-three-file @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_.._.git_one_two b/t/t5515/refs.master_.._.git_one_two new file mode 100644 index 0000000000..70962eaac1 --- /dev/null +++ b/t/t5515/refs.master_.._.git_one_two @@ -0,0 +1,5 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two diff --git a/t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.master_.._.git_tag_tag-one-tree_tag_tag-three-file @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three new file mode 100644 index 0000000000..13e4ad2e46 --- /dev/null +++ b/t/t5515/refs.master_.._.git_tag_tag-one_tag_tag-three @@ -0,0 +1,11 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_branches-default b/t/t5515/refs.master_branches-default new file mode 100644 index 0000000000..21917c1e5d --- /dev/null +++ b/t/t5515/refs.master_branches-default @@ -0,0 +1,12 @@ +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/heads/branches-default +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_branches-one b/t/t5515/refs.master_branches-one new file mode 100644 index 0000000000..8a705a5df2 --- /dev/null +++ b/t/t5515/refs.master_branches-one @@ -0,0 +1,12 @@ +8e32a6d901327a23ef831511badce7bf3bf46689 refs/heads/branches-one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_config-explicit b/t/t5515/refs.master_config-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.master_config-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_config-glob b/t/t5515/refs.master_config-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.master_config-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_remote-explicit b/t/t5515/refs.master_remote-explicit new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.master_remote-explicit @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t5515/refs.master_remote-glob b/t/t5515/refs.master_remote-glob new file mode 100644 index 0000000000..9bbbfd9fc5 --- /dev/null +++ b/t/t5515/refs.master_remote-glob @@ -0,0 +1,15 @@ +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/HEAD +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/origin/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/origin/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/origin/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/origin/two +754b754407bf032e9a2f9d5a9ad05ca79a6b228f refs/remotes/rem/master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/remotes/rem/one +0567da4d5edd2ff4bb292a465ba9e64dcad9536b refs/remotes/rem/three +6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 refs/remotes/rem/two +6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 refs/tags/tag-master +8e32a6d901327a23ef831511badce7bf3bf46689 refs/tags/tag-one +22feea448b023a2d864ef94b013735af34d238ba refs/tags/tag-one-tree +c61a82b60967180544e3c19f819ddbd0c9f89899 refs/tags/tag-three +0e3b14047d3ee365f4f2a1b673db059c3972589c refs/tags/tag-three-file +525b7fb068d59950d185a8779dc957c77eed73ba refs/tags/tag-two diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh index f248a3293c..c8a96a9a99 100755 --- a/t/t6009-rev-list-parent.sh +++ b/t/t6009-rev-list-parent.sh @@ -27,7 +27,7 @@ test_expect_success setup ' git log --pretty=oneline --abbrev-commit ' -test_expect_failure 'one is ancestor of others and should not be shown' ' +test_expect_success 'one is ancestor of others and should not be shown' ' git rev-list one --not four >result && >expect && diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 553131fcf4..efd658adb6 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -17,6 +17,8 @@ test_expect_success 'setup' ' make_commit B git checkout -b branch B make_commit D + mkdir dir + make_commit dir/D make_commit E git checkout master make_commit C @@ -41,9 +43,23 @@ test_expect_success 'rewrite, renaming a specific file' ' ' test_expect_success 'test that the file was renamed' ' - test d = $(git show HEAD:doh) && + test d = "$(git show HEAD:doh --)" && + ! test -f d && test -f doh && - test d = $(cat doh) + test d = "$(cat doh)" +' + +test_expect_success 'rewrite, renaming a specific directory' ' + git-filter-branch -f --tree-filter "mv dir diroh || :" HEAD +' + +test_expect_success 'test that the directory was renamed' ' + test dir/d = "$(git show HEAD:diroh/d --)" && + ! test -d dir && + test -d diroh && + ! test -d diroh/dir && + test -f diroh/d && + test dir/d = "$(cat diroh/d)" ' git tag oldD HEAD~4 @@ -78,7 +94,7 @@ test_expect_success 'filter subdirectory only' ' test_expect_success 'subdirectory filter result looks okay' ' test 2 = $(git rev-list sub | wc -l) && git show sub:new && - ! git show sub:subdir + test_must_fail git show sub:subdir ' test_expect_success 'setup and filter history that requires --full-history' ' @@ -100,7 +116,7 @@ test_expect_success 'subdirectory filter result looks okay' ' test 3 = $(git rev-list -1 --parents sub-master | wc -w) && git show sub-master^:new && git show sub-master^2:new && - ! git show sub:subdir + test_must_fail git show sub:subdir ' test_expect_success 'use index-filter to move into a subdirectory' ' @@ -114,7 +130,7 @@ test_expect_success 'use index-filter to move into a subdirectory' ' test_expect_success 'stops when msg filter fails' ' old=$(git rev-parse HEAD) && - ! git-filter-branch -f --msg-filter false HEAD && + test_must_fail git-filter-branch -f --msg-filter false HEAD && test $old = $(git rev-parse HEAD) && rm -rf .git-rewrite ' @@ -151,8 +167,8 @@ test_expect_success "remove a certain author's commits" ' ' test_expect_success 'barf on invalid name' ' - ! git filter-branch -f master xy-problem && - ! git filter-branch -f HEAD^ + test_must_fail git filter-branch -f master xy-problem && + test_must_fail git filter-branch -f HEAD^ ' test_expect_success '"map" works in commit filter' ' @@ -174,7 +190,7 @@ test_expect_success 'Name needing quotes' ' git add foo && git commit -m "Adding a file" && git filter-branch --tree-filter "rm -fr foo" && - ! git ls-files --error-unmatch "foo/$name" && + test_must_fail git ls-files --error-unmatch "foo/$name" && test $(git rev-parse --verify rerere) != $(git rev-parse --verify A) ' diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 75cd33bde8..1a7141ecd7 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -578,6 +578,14 @@ test_expect_success \ git diff expect actual ' +# subsequent tests require gpg; check if it is available +gpg --version >/dev/null +if [ $? -eq 127 ]; then + echo "gpg not found - skipping tag signing and verification tests" + test_done + exit +fi + # trying to verify annotated non-signed tags: test_expect_success \ @@ -600,13 +608,6 @@ test_expect_success \ # creating and verifying signed tags: -gpg --version >/dev/null -if [ $? -eq 127 ]; then - echo "Skipping signed tags tests, because gpg was not found" - test_done - exit -fi - # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19 # the gpg version 1.0.6 didn't parse trust packets correctly, so for # that version, creation of signed tags using the generated key fails. diff --git a/t/t7005-editor.sh b/t/t7005-editor.sh index 6a74b3acfd..2d919d69ef 100755 --- a/t/t7005-editor.sh +++ b/t/t7005-editor.sh @@ -4,8 +4,6 @@ test_description='GIT_EDITOR, core.editor, and stuff' . ./test-lib.sh -OLD_TERM="$TERM" - for i in GIT_EDITOR core_editor EDITOR VISUAL vi do cat >e-$i.sh <<-EOF @@ -116,6 +114,4 @@ test_expect_success 'core.editor with a space' ' ' -TERM="$OLD_TERM" - test_done diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh new file mode 100755 index 0000000000..9a4eabe523 --- /dev/null +++ b/t/t9120-git-svn-clone-with-percent-escapes.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Copyright (c) 2008 Kevin Ballard +# + +test_description='git-svn clone with percent escapes' +. ./lib-git-svn.sh + +test_expect_success 'setup svnrepo' " + mkdir project project/trunk project/branches project/tags && + echo foo > project/trunk/foo && + svn import -m '$test_description' project '$svnrepo/pr ject' && + rm -rf project && + start_httpd +" + +if test "$SVN_HTTPD_PORT" = "" +then + test_expect_failure 'test clone with percent escapes - needs SVN_HTTPD_PORT set' 'false' +else + test_expect_success 'test clone with percent escapes' ' + git svn clone "$svnrepo/pr%20ject" clone && + cd clone && + git rev-parse refs/remotes/git-svn && + cd .. + ' +fi + +stop_httpd + +test_done diff --git a/t/t9121-git-svn-fetch-renamed-dir.sh b/t/t9121-git-svn-fetch-renamed-dir.sh new file mode 100755 index 0000000000..5143ed6066 --- /dev/null +++ b/t/t9121-git-svn-fetch-renamed-dir.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (c) 2008 Santhosh Kumar Mani + + +test_description='git-svn can fetch renamed directories' + +. ./lib-git-svn.sh + +test_expect_success 'load repository with renamed directory' " + svnadmin load -q $rawsvnrepo < ../t9121/renamed-dir.dump + " + +test_expect_success 'init and fetch repository' " + git svn init $svnrepo/newname && + git svn fetch + " + +test_done + diff --git a/t/t9121/renamed-dir.dump b/t/t9121/renamed-dir.dump new file mode 100644 index 0000000000..5f9127be92 --- /dev/null +++ b/t/t9121/renamed-dir.dump @@ -0,0 +1,90 @@ +SVN-fs-dump-format-version: 2 + +UUID: 06b9b3ad-f546-4fbe-8328-fcb4e6ef5c3f + +Revision-number: 0 +Prop-content-length: 56 +Content-length: 56 + +K 8 +svn:date +V 27 +2008-04-02T09:11:59.778557Z +PROPS-END + +Revision-number: 1 +Prop-content-length: 117 +Content-length: 117 + +K 7 +svn:log +V 14 +initial import +K 10 +svn:author +V 8 +santhosh +K 8 +svn:date +V 27 +2008-04-02T09:13:03.170863Z +PROPS-END + +Node-path: name +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: name/a.txt +Node-kind: file +Node-action: add +Prop-content-length: 71 +Text-content-length: 6 +Text-content-md5: b1946ac92492d2347c6235b4d2611184 +Content-length: 77 + +K 13 +svn:mime-type +V 10 +text/plain +K 13 +svn:eol-style +V 2 +LF +PROPS-END +hello + + +Revision-number: 2 +Prop-content-length: 109 +Content-length: 109 + +K 7 +svn:log +V 7 +renamed +K 10 +svn:author +V 8 +santhosh +K 8 +svn:date +V 27 +2008-04-02T09:14:22.952186Z +PROPS-END + +Node-path: newname +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: name + + +Node-path: name +Node-action: delete + + diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh index b91b151417..166b43f783 100755 --- a/t/t9400-git-cvsserver-server.sh +++ b/t/t9400-git-cvsserver-server.sh @@ -420,4 +420,54 @@ test_expect_success 'cvs update (merge no-op)' \ GIT_CONFIG="$git_config" cvs -Q update && diff -q merge ../merge' +cd "$WORKDIR" +test_expect_success 'cvs update (-p)' ' + touch really-empty && + echo Line 1 > no-lf && + echo -n Line 2 >> no-lf && + git add really-empty no-lf && + git commit -q -m "Update -p test" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs update && + rm -f failures && + for i in merge no-lf empty really-empty; do + GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out + diff $i.out ../$i >>failures 2>&1 + done && + test -z "$(cat failures)" +' + +#------------ +# CVS STATUS +#------------ + +cd "$WORKDIR" +test_expect_success 'cvs status' ' + mkdir status.dir && + echo Line > status.dir/status.file && + echo Line > status.file && + git add status.dir status.file && + git commit -q -m "Status test" && + git push gitcvs.git >/dev/null && + cd cvswork && + GIT_CONFIG="$git_config" cvs update && + GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out && + test $(wc -l <../out) = 2 +' + +cd "$WORKDIR" +test_expect_success 'cvs status (nonrecursive)' ' + cd cvswork && + GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out && + test $(wc -l <../out) = 1 +' + +cd "$WORKDIR" +test_expect_success 'cvs status (no subdirs in header)' ' + cd cvswork && + GIT_CONFIG="$git_config" cvs status | grep ^File: >../out && + ! grep / <../out +' + test_done diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 7706430d81..00a74ee738 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -3,6 +3,12 @@ test_description='git-cvsimport basic tests' . ./test-lib.sh +CVSROOT=$(pwd)/cvsroot +export CVSROOT +# for clean cvsps cache +HOME=$(pwd) +export HOME + if ! type cvs >/dev/null 2>&1 then say 'skipping cvsimport tests, cvs not found' @@ -26,12 +32,6 @@ case "$cvsps_version" in ;; esac -CVSROOT=$(pwd)/cvsroot -export CVSROOT -# for clean cvsps cache -HOME=$(pwd) -export HOME - test_expect_success 'setup cvsroot' 'cvs init' test_expect_success 'setup a cvs module' ' diff --git a/t/test-lib.sh b/t/test-lib.sh index 268b26c959..7c2a8ba77d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -300,7 +300,7 @@ test_expect_code () { test_must_fail () { "$@" - test $? -gt 0 -a $? -le 128 + test $? -gt 0 -a $? -le 129 } # test_cmp is a helper function to compare actual and expected output. @@ -396,7 +396,12 @@ fi # Test repository test=trash -rm -fr "$test" +rm -fr "$test" || { + trap - exit + echo >&5 "FATAL: Cannot prepare test area" + exit 1 +} + test_create_repo $test cd "$test" diff --git a/unpack-trees.c b/unpack-trees.c index 93019abdc1..a59f47557a 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -54,13 +54,14 @@ static void unlink_entry(char *name, char *last_symlink) } static struct checkout state; -static void check_updates(struct unpack_trees_options *o) +static int check_updates(struct unpack_trees_options *o) { unsigned cnt = 0, total = 0; struct progress *progress = NULL; char last_symlink[PATH_MAX]; struct index_state *index = &o->result; int i; + int errs = 0; if (o->update && o->verbose_update) { for (total = cnt = 0; cnt < index->cache_nr; cnt++) { @@ -90,12 +91,13 @@ static void check_updates(struct unpack_trees_options *o) if (ce->ce_flags & CE_UPDATE) { ce->ce_flags &= ~CE_UPDATE; if (o->update) { - checkout_entry(ce, &state, NULL); + errs |= checkout_entry(ce, &state, NULL); *last_symlink = '\0'; } } } stop_progress(&progress); + return errs != 0; } static inline int call_unpack_fn(struct cache_entry **src, struct unpack_trees_options *o) @@ -369,7 +371,8 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options return unpack_failed(o, "Merge requires file-level merging"); o->src_index = NULL; - check_updates(o); + if (check_updates(o)) + return -1; if (o->dst_index) *o->dst_index = o->result; return 0; @@ -595,16 +598,19 @@ static int verify_absent(struct cache_entry *ce, const char *action, static int merged_entry(struct cache_entry *merge, struct cache_entry *old, struct unpack_trees_options *o) { + int update = CE_UPDATE; + if (old) { /* * See if we can re-use the old CE directly? * That way we get the uptodate stat info. * - * This also removes the UPDATE flag on - * a match. + * This also removes the UPDATE flag on a match; otherwise + * we will end up overwriting local changes in the work tree. */ if (same(old, merge)) { copy_cache_entry(merge, old); + update = 0; } else { if (verify_uptodate(old, o)) return -1; @@ -617,7 +623,7 @@ static int merged_entry(struct cache_entry *merge, struct cache_entry *old, invalidate_ce_path(merge, o); } - add_entry(o, merge, CE_UPDATE, CE_STAGEMASK); + add_entry(o, merge, update, CE_STAGEMASK); return 1; } |
