diff options
113 files changed, 2183 insertions, 1210 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index b8bf618a30..8346c1972b 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -43,6 +43,10 @@ For shell scripts specifically (not exhaustive): - We use Arithmetic Expansion $(( ... )). + - Inside Arithmetic Expansion, spell shell variables with $ in front + of them, as some shells do not grok $((x)) while accepting $(($x)) + just fine (e.g. dash older than 0.5.4). + - No "Substring Expansion" ${parameter:offset:length}. - No shell arrays. diff --git a/Documentation/RelNotes/1.7.3.1.txt b/Documentation/RelNotes/1.7.3.1.txt new file mode 100644 index 0000000000..002c93b961 --- /dev/null +++ b/Documentation/RelNotes/1.7.3.1.txt @@ -0,0 +1,14 @@ +Git v1.7.3.1 Release Notes +========================== + +Fixes since v1.7.3 +------------------ + + * "git stash show stash@{$n}" was accidentally broken in 1.7.3 ("git + stash show" without any argument still worked, though). + + * "git stash branch $branch stash@{$n}" was accidentally broken in + 1.7.3 and started dropping the named stash even when branch creation + failed. + +And other minor fixes and documentation updates. diff --git a/Documentation/RelNotes/1.7.3.txt b/Documentation/RelNotes/1.7.3.txt index f1243ff112..309c33181f 100644 --- a/Documentation/RelNotes/1.7.3.txt +++ b/Documentation/RelNotes/1.7.3.txt @@ -1,10 +1,11 @@ -Git v1.7.3 Release Notes (draft) -================================ +Git v1.7.3 Release Notes +======================== Updates since v1.7.2 -------------------- - * git-gui got various updates and a new maintainer, Pat Thoyts. + * git-gui, now at version 0.13.0, got various updates and a new + maintainer, Pat Thoyts. * Gitweb allows its configuration to change per each request; it used to read the configuration once upon startup. @@ -63,19 +64,13 @@ release, unless otherwise noted. * "git fetch $url" (i.e. without refspecs) was broken for quite some time, if the current branch happen to be tracking some remote. + * "git ls-tree dir dirgarbage", when "dir" was a directory, + incorrectly recursed into "dir". + * "git note remove" created unnecessary extra commit when named object did not have any note to begin with. + * "git rebase" did not work well if you had diff.noprefix configured. + * "git -c foo=bar subcmd" did not work well for subcmd that is not implemented as a built-in command. - ---- -exec >/var/tmp/1 -echo O=$(git describe master) -O=v1.7.3-rc0 -git shortlog --no-merges $O..master ^maint -exit 0 - -What did we want to do with... - -1e3d411 (Enable custom schemes for column colors in the graph API, 2010-07-13) diff --git a/Documentation/config.txt b/Documentation/config.txt index d82c0da2cf..e6d74e6ade 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -459,6 +459,12 @@ core.askpass:: prompt. The external program shall be given a suitable prompt as command line argument and write the password on its STDOUT. +core.attributesfile:: + In addition to '.gitattributes' (per-directory) and + '.git/info/attributes', git looks into this file for attributes + (see linkgit:gitattributes[5]). Path expansions are made the same + way as for `core.excludesfile`. + core.editor:: Commands such as `commit` and `tag` that lets you edit messages by launching an editor uses the value of this diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 4656a97e60..f77a0f8749 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -284,8 +284,12 @@ ifndef::git-format-patch[] appearing in diff output; see the 'pickaxe' entry in linkgit:gitdiffcore[7] for more details. +-G<regex>:: + Look for differences whose added or removed line matches + the given <regex>. + --pickaxe-all:: - When `-S` finds a change, show all the changes in that + When `-S` or `-G` finds a change, show all the changes in that changeset, not just the files that contain the change in <string>. diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index f88e9977d1..22d36114df 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -45,14 +45,14 @@ successful. 'git checkout' [--patch] [<tree-ish>] [--] <pathspec>...:: - When <paths> or `--patch` are given, 'git checkout' *not* switch - branches. It updates the named paths in the working tree from - the index file or from a named <tree-ish> (most often a commit). In - this case, the `-b` and `--track` options are meaningless and giving - either of them results in an error. The <tree-ish> argument can be - used to specify a specific tree-ish (i.e. commit, tag or tree) - to update the index for the given paths before updating the - working tree. + When <paths> or `--patch` are given, 'git checkout' does *not* + switch branches. It updates the named paths in the working tree + from the index file or from a named <tree-ish> (most often a + commit). In this case, the `-b` and `--track` options are + meaningless and giving either of them results in an error. The + <tree-ish> argument can be used to specify a specific tree-ish + (i.e. commit, tag or tree) to update the index for the given + paths before updating the working tree. + The index may contain unmerged entries because of a previous failed merge. By default, if you try to check out such an entry from the index, the diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 020028cf9a..f51860de26 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -81,7 +81,7 @@ OPTIONS 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 + variables (see linkgit:git-commit-tree[1] for details). Do not forget to re-export the variables. --tree-filter <command>:: @@ -159,18 +159,7 @@ to other tags will be rewritten to point to the underlying commit. --subdirectory-filter <directory>:: Only look at the history which touches the given subdirectory. The result will contain that directory (and only that) as its - project root. Implies --remap-to-ancestor. - ---remap-to-ancestor:: - Rewrite refs to the nearest rewritten ancestor instead of - ignoring them. -+ -Normally, positive refs on the command line are only changed if the -commit they point to was rewritten. However, you can limit the extent -of this rewriting by using linkgit:rev-list[1] arguments, e.g., path -limiters. Refs pointing to such excluded commits would then normally -be ignored. With this option, they are instead rewritten to point at -the nearest ancestor that was not excluded. + project root. Implies <<Remap_to_ancestor>>. --prune-empty:: Some kind of filters will generate empty commits, that left the tree @@ -204,7 +193,18 @@ the nearest ancestor that was not excluded. Arguments for 'git rev-list'. All positive refs included by these options are rewritten. You may also specify options such as '--all', but you must use '--' to separate them from - the 'git filter-branch' options. + the 'git filter-branch' options. Implies <<Remap_to_ancestor>>. + + +[[Remap_to_ancestor]] +Remap to ancestor +~~~~~~~~~~~~~~~~~ + +By using linkgit:rev-list[1] arguments, e.g., path limiters, you can limit the +set of revisions which get rewritten. However, positive refs on the command +line are distinguished: we don't let them be excluded by such limiters. For +this purpose, they are instead rewritten to point at the nearest ancestor that +was not excluded. Examples diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt index 302f56b889..40dba8c0a9 100644 --- a/Documentation/git-fmt-merge-msg.txt +++ b/Documentation/git-fmt-merge-msg.txt @@ -9,8 +9,8 @@ git-fmt-merge-msg - Produce a merge commit message SYNOPSIS -------- [verse] -'git fmt-merge-msg' [-m <message>] [--log | --no-log] <$GIT_DIR/FETCH_HEAD -'git fmt-merge-msg' [-m <message>] [--log | --no-log] -F <file> +'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] <$GIT_DIR/FETCH_HEAD +'git fmt-merge-msg' [-m <message>] [--log[=<n>] | --no-log] -F <file> DESCRIPTION ----------- @@ -24,10 +24,12 @@ automatically invoking 'git merge'. OPTIONS ------- ---log:: +--log[=<n>]:: In addition to branch names, populate the log message with one-line descriptions from the actual commits that are being - merged. + merged. At most <n> commits from each merge parent will be + used (20 if <n> is omitted). This overrides the `merge.log` + configuration variable. --no-log:: Do not list one-line descriptions from the actual commits being @@ -52,8 +54,10 @@ CONFIGURATION ------------- merge.log:: - Whether to include summaries of merged commits in newly - merge commit messages. False by default. + In addition to branch names, populate the log message with at + most the specified number of one-line descriptions from the + actual commits that are being merged. Defaults to false, and + true is a synoym for 20. merge.summary:: Synonym to `merge.log`; this is deprecated and will be removed in diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 4b3f5ba535..df77474c29 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -74,7 +74,7 @@ OPTIONS include::diff-options.txt[] -<n>:: - Limits the number of patches to prepare. + Prepare patches from the topmost <n> commits. -o <dir>:: --output-directory <dir>:: diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index 15aee2f953..347f447986 100644 --- a/Documentation/git-ls-files.txt +++ b/Documentation/git-ls-files.txt @@ -79,15 +79,16 @@ OPTIONS -x <pattern>:: --exclude=<pattern>:: - Skips files matching pattern. - Note that pattern is a shell wildcard pattern. + Skip untracked files matching pattern. + Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS + below for more information. -X <file>:: --exclude-from=<file>:: - exclude patterns are read from <file>; 1 per line. + Read exclude patterns from <file>; 1 per line. --exclude-per-directory=<file>:: - read additional exclude patterns that apply only to the + Read additional exclude patterns that apply only to the directory and its subdirectories in <file>. --exclude-standard:: @@ -192,7 +193,7 @@ These exclude patterns come from these places, in order: file containing a list of patterns. Patterns are ordered in the same order they appear in the file. - 3. command line flag --exclude-per-directory=<name> specifies + 3. The command line flag --exclude-per-directory=<name> specifies a name of the file in each directory 'git ls-files' examines, normally `.gitignore`. Files in deeper directories take precedence. Patterns are ordered in the diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index 2e78da448f..e88e9c2d55 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git read-tree' [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--index-output=<file>] [--no-sparse-checkout] - <tree-ish1> [<tree-ish2> [<tree-ish3>]] + (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]]) DESCRIPTION @@ -114,6 +114,10 @@ OPTIONS Disable sparse checkout support even if `core.sparseCheckout` is true. +--empty:: + Instead of reading tree object(s) into the index, just empty + it. + <tree-ish#>:: The id of the tree object(s) to be read/merged. diff --git a/Documentation/git-shell.txt b/Documentation/git-shell.txt index 0f3ad811cf..6403126a02 100644 --- a/Documentation/git-shell.txt +++ b/Documentation/git-shell.txt @@ -3,24 +3,30 @@ git-shell(1) NAME ---- -git-shell - Restricted login shell for GIT-only SSH access +git-shell - Restricted login shell for Git-only SSH access SYNOPSIS -------- -'$(git --exec-path)/git-shell' -c <command> <argument> +'git shell' [-c <command> <argument>] DESCRIPTION ----------- -This is meant to be used as a login shell for SSH accounts you want -to restrict to GIT pull/push access only. It permits execution only -of server-side GIT commands implementing the pull/push functionality. -The commands can be executed only by the '-c' option; the shell is not -interactive. - -Currently, only four commands are permitted to be called, 'git-receive-pack' -'git-upload-pack' and 'git-upload-archive' with a single required argument, or -'cvs server' (to invoke 'git-cvsserver'). + +A login shell for SSH accounts to provide restricted Git access. When +'-c' is given, the program executes <command> non-interactively; +<command> can be one of 'git receive-pack', 'git upload-pack', 'git +upload-archive', 'cvs server', or a command in COMMAND_DIR. The shell +is started in interactive mode when no arguments are given; in this +case, COMMAND_DIR must exist, and any of the executables in it can be +invoked. + +'cvs server' is a special command which executes git-cvsserver. + +COMMAND_DIR is the path "$HOME/git-shell-commands". The user must have +read and execute permissions to the directory in order to execute the +programs in it. The programs are executed with a cwd of $HOME, and +<argument> is parsed as a command-line string. Author ------ diff --git a/Documentation/git.txt b/Documentation/git.txt index 69ef12e272..dd57bdc436 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -44,6 +44,12 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: +* link:v1.7.3.1/git.html[documentation for release 1.7.3.1] + +* release notes for + link:RelNotes/1.7.3.1.txt[1.7.3.1], + link:RelNotes/1.7.3.txt[1.7.3]. + * link:v1.7.2.3/git.html[documentation for release 1.7.2.3] * release notes for diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index e5a27d875e..c80ca5da43 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -62,14 +62,21 @@ consults `$GIT_DIR/info/attributes` file (which has the highest precedence), `.gitattributes` file in the same directory as the path in question, and its parent directories up to the toplevel of the work tree (the further the directory that contains `.gitattributes` -is from the path in question, the lower its precedence). +is from the path in question, the lower its precedence). Finally +global and system-wide files are considered (they have the lowest +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 to files that are particular to +one user's workflow for that repository), 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. +`.gitattributes` files. Attributes that should affect all repositories +for a single user should be placed in a file specified by the +`core.attributesfile` configuration option (see linkgit:git-config[1]). +Attributes for all users on a system should be placed in the +`$(prefix)/etc/gitattributes` file. Sometimes you would need to override an setting of an attribute for a path to `unspecified` state. This can be done by listing @@ -477,6 +484,8 @@ patterns are available: - `csharp` suitable for source code in the C# language. +- `fortran` suitable for source code in the Fortran language. + - `html` suitable for HTML/XHTML documents. - `java` suitable for source code in the Java language. diff --git a/Documentation/gitdiffcore.txt b/Documentation/gitdiffcore.txt index 5d91a7e5b3..6af29a4603 100644 --- a/Documentation/gitdiffcore.txt +++ b/Documentation/gitdiffcore.txt @@ -227,9 +227,9 @@ changes that touch a specified string, and is controlled by the commands. When diffcore-pickaxe is in use, it checks if there are -filepairs whose "result" side has the specified string and -whose "origin" side does not. Such a filepair represents "the -string appeared in this changeset". It also checks for the +filepairs whose "result" side and whose "origin" side have +different number of specified string. Such a filepair represents +"the string appeared in this changeset". It also checks for the opposite case that loses the specified string. When `\--pickaxe-all` is not in effect, diffcore-pickaxe leaves diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt index b72f533970..92772e7c4e 100644 --- a/Documentation/merge-config.txt +++ b/Documentation/merge-config.txt @@ -7,8 +7,10 @@ merge.conflictstyle:: marker and the original text before the `=======` marker. merge.log:: - Whether to include summaries of merged commits in newly created - merge commit messages. False by default. + In addition to branch names, populate the log message with at + most the specified number of one-line descriptions from the + actual commits that are being merged. Defaults to false, and + true is a synoym for 20. merge.renameLimit:: The number of files to consider when performing rename detection diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 722d704ff2..e33e0f8e11 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -16,11 +16,11 @@ inspect and further tweak the merge result before committing. With --no-ff Generate a merge commit even if the merge resolved as a fast-forward. ---log:: +--log[=<n>]:: --no-log:: In addition to branch names, populate the log message with - one-line descriptions from the actual commits that are being - merged. + one-line descriptions from at most <n> actual commits that are being + merged. See also linkgit:git-fmt-merge-msg[1]. + With --no-log do not list one-line descriptions from the actual commits being merged. diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt index fe846f043c..3d4b79c480 100644 --- a/Documentation/revisions.txt +++ b/Documentation/revisions.txt @@ -107,11 +107,13 @@ the `$GIT_DIR/refs` directory or from the `$GIT_DIR/packed-refs` file. found. * A colon, followed by a slash, followed by a text (e.g. `:/fix nasty bug`): this names - a commit whose commit message starts with the specified text. + a commit whose commit message matches the specified regular expression. This name returns the youngest matching commit which is reachable from any ref. If the commit message starts with a '!', you have to repeat that; the special sequence ':/!', followed by something else than '!' is reserved for now. + The regular expression can match any part of the commit message. To + match messages starting with a string, one can use e.g. `:/^foo`. * A suffix ':' followed by a path (e.g. `HEAD:README`); this names the blob or tree at the given path in the tree-ish object named by the part diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index fecc4eb5b3..ce45bfcc04 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -955,7 +955,7 @@ echo "git diff --stat --summary -M v$last v$new > ../diffstat-$new" and then he just cut-and-pastes the output commands after verifying that they look OK. -[[Finding-comments-With-given-Content]] +[[Finding-commits-With-given-Content]] Finding commits referencing a file with given content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2439,9 +2439,9 @@ You have performed no merges into mywork, so it is just a simple linear sequence of patches on top of "origin": ................................................ - o--o--o <-- origin + o--o--O <-- origin \ - o--o--o <-- mywork + a--b--c <-- mywork ................................................ Some more interesting work has been done in the upstream project, and diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0cbf043731..75b8b3cc69 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.3-rc1 +DEF_VER=v1.7.3.1 LF=' ' @@ -270,6 +270,7 @@ STRIP ?= strip # infodir # htmldir # ETC_GITCONFIG (but not sysconfdir) +# ETC_GITATTRIBUTES # can be specified as a relative path some/where/else; # this is interpreted as relative to $(prefix) and "git" at # runtime figures out where they are based on the path to the executable. @@ -288,9 +289,11 @@ htmldir = share/doc/git-doc ifeq ($(prefix),/usr) sysconfdir = /etc ETC_GITCONFIG = $(sysconfdir)/gitconfig +ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes else sysconfdir = $(prefix)/etc ETC_GITCONFIG = etc/gitconfig +ETC_GITATTRIBUTES = etc/gitattributes endif lib = lib # DESTDIR= @@ -390,6 +393,8 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \ $(patsubst %.py,%,$(SCRIPT_PYTHON)) \ git-instaweb +ETAGS_TARGET = TAGS + # Empty... EXTRA_PROGRAMS = @@ -1122,6 +1127,7 @@ ifneq (,$(findstring MINGW,$(uname_S))) NO_REGEX = YesPlease NO_PYTHON = YesPlease BLK_SHA1 = YesPlease + ETAGS_TARGET = ETAGS COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32 COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \ @@ -1465,7 +1471,7 @@ ifdef NO_REGEX endif ifdef USE_NED_ALLOCATOR - COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc + COMPAT_CFLAGS += -Icompat/nedmalloc COMPAT_OBJS += compat/nedmalloc/nedmalloc.o endif @@ -1520,6 +1526,7 @@ endif SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG)) +ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES)) DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) bindir_SQ = $(subst ','\'',$(bindir)) @@ -1898,6 +1905,8 @@ builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \ config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' +attr.s attr.o: EXTRA_CPPFLAGS = -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"' + http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"' ifdef NO_EXPAT @@ -1908,6 +1917,11 @@ ifdef NO_REGEX compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT endif +ifdef USE_NED_ALLOCATOR +compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \ + -DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR +endif + git-%$X: %.o $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) @@ -1956,11 +1970,11 @@ info: pdf: $(MAKE) -C Documentation pdf -TAGS: - $(RM) TAGS - $(FIND) . -name '*.[hcS]' -print | xargs etags -a +$(ETAGS_TARGET): FORCE + $(RM) $(ETAGS_TARGET) + $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET) -tags: +tags: FORCE $(RM) tags $(FIND) . -name '*.[hcS]' -print | xargs ctags -a @@ -2230,7 +2244,7 @@ clean: $(RM) $(TEST_PROGRAMS) $(RM) -r bin-wrappers $(RM) -r $(dep_dirs) - $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope* + $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope* $(RM) -r autom4te.cache $(RM) config.log config.mak.autogen config.mak.append config.status config.cache $(RM) -r $(GIT_TARNAME) .doc-tmp-dir @@ -2254,7 +2268,7 @@ endif .PHONY: all install clean strip .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell -.PHONY: FORCE TAGS tags cscope +.PHONY: FORCE cscope ### Check documentation # @@ -1 +1 @@ -Documentation/RelNotes/1.7.3.txt
\ No newline at end of file +Documentation/RelNotes/1.7.3.1.txt
\ No newline at end of file @@ -1,5 +1,6 @@ #define NO_THE_INDEX_COMPATIBILITY_MACROS #include "cache.h" +#include "exec_cmd.h" #include "attr.h" const char git_attr__true[] = "(builtin)true"; @@ -10,6 +11,8 @@ static const char git_attr__unknown[] = "(builtin)unknown"; #define ATTR__UNSET NULL #define ATTR__UNKNOWN git_attr__unknown +static const char *attributes_file; + /* * The basic design decision here is that we are not going to have * insanely large number of attributes. @@ -462,6 +465,32 @@ static void drop_attr_stack(void) } } +const char *git_etc_gitattributes(void) +{ + static const char *system_wide; + if (!system_wide) + system_wide = system_path(ETC_GITATTRIBUTES); + return system_wide; +} + +int git_attr_system(void) +{ + return !git_env_bool("GIT_ATTR_NOSYSTEM", 0); +} + +int git_attr_global(void) +{ + return !git_env_bool("GIT_ATTR_NOGLOBAL", 0); +} + +static int git_attr_config(const char *var, const char *value, void *dummy) +{ + if (!strcmp(var, "core.attributesfile")) + return git_config_pathname(&attributes_file, var, value); + + return 0; +} + static void bootstrap_attr_stack(void) { if (!attr_stack) { @@ -472,6 +501,25 @@ static void bootstrap_attr_stack(void) elem->prev = attr_stack; attr_stack = elem; + if (git_attr_system()) { + elem = read_attr_from_file(git_etc_gitattributes(), 1); + if (elem) { + elem->origin = NULL; + elem->prev = attr_stack; + attr_stack = elem; + } + } + + git_config(git_attr_config, NULL); + if (git_attr_global() && attributes_file) { + elem = read_attr_from_file(attributes_file, 1); + if (elem) { + elem->origin = NULL; + elem->prev = attr_stack; + attr_stack = elem; + } + } + if (!is_bare_repository() || direction == GIT_ATTR_INDEX) { elem = read_attr(GITATTRIBUTES_FILE, 1); elem->origin = strdup(""); @@ -499,7 +547,9 @@ static void prepare_attr_stack(const char *path, int dirlen) /* * At the bottom of the attribute stack is the built-in - * set of attribute definitions. Then, contents from + * set of attribute definitions, followed by the contents + * of $(prefix)/etc/gitattributes and a file specified by + * core.attributesfile. Then, contents from * .gitattribute files from directories closer to the * root to the ones in deeper directories are pushed * to the stack. Finally, at the very top of the stack @@ -7,14 +7,15 @@ #include "commit.h" #include "notes.h" +#define DEFAULT_MERGE_LOG_LEN 20 + extern const char git_version_string[]; extern const char git_usage_string[]; extern const char git_more_info_string[]; extern void prune_packed_objects(int); -extern int fmt_merge_msg(int merge_summary, struct strbuf *in, - struct strbuf *out); -extern int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out); +extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out, + int merge_title, int shortlog_len); extern int commit_notes(struct notes_tree *t, const char *msg); struct notes_rewrite_cfg { diff --git a/builtin/checkout.c b/builtin/checkout.c index 560eae1715..a54583b3a4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -691,16 +691,16 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) "create and checkout a new branch"), OPT_STRING('B', NULL, &opts.new_branch_force, "branch", "create/reset and checkout a branch"), - OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "log for new branch"), - OPT_SET_INT('t', "track", &opts.track, "track", + OPT_BOOLEAN('l', NULL, &opts.new_branch_log, "create reflog for new branch"), + OPT_SET_INT('t', "track", &opts.track, "set upstream info for new branch", BRANCH_TRACK_EXPLICIT), OPT_STRING(0, "orphan", &opts.new_orphan_branch, "new branch", "new unparented branch"), - OPT_SET_INT('2', "ours", &opts.writeout_stage, "stage", + OPT_SET_INT('2', "ours", &opts.writeout_stage, "checkout our version for unmerged files", 2), - OPT_SET_INT('3', "theirs", &opts.writeout_stage, "stage", + OPT_SET_INT('3', "theirs", &opts.writeout_stage, "checkout their version for unmerged files", 3), - OPT_BOOLEAN('f', "force", &opts.force, "force"), - OPT_BOOLEAN('m', "merge", &opts.merge, "merge"), + OPT_BOOLEAN('f', "force", &opts.force, "force checkout (throw away local modifications)"), + OPT_BOOLEAN('m', "merge", &opts.merge, "perform a 3-way merge with the new branch"), OPT_STRING(0, "conflict", &conflict_style, "style", "conflict style (merge or diff3)"), OPT_BOOLEAN('p', "patch", &patch_mode, "select hunks interactively"), diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index e7e12eea25..78c77742b6 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -7,21 +7,22 @@ #include "string-list.h" static const char * const fmt_merge_msg_usage[] = { - "git fmt-merge-msg [-m <message>] [--log|--no-log] [--file <file>]", + "git fmt-merge-msg [-m <message>] [--log[=<n>]|--no-log] [--file <file>]", NULL }; -static int merge_summary; +static int shortlog_len; static int fmt_merge_msg_config(const char *key, const char *value, void *cb) { - static int found_merge_log = 0; - if (!strcmp("merge.log", key)) { - found_merge_log = 1; - merge_summary = git_config_bool(key, value); + if (!strcmp(key, "merge.log") || !strcmp(key, "merge.summary")) { + int is_bool; + shortlog_len = git_config_bool_or_int(key, value, &is_bool); + if (!is_bool && shortlog_len < 0) + return error("%s: negative length %s", key, value); + if (is_bool && shortlog_len) + shortlog_len = DEFAULT_MERGE_LOG_LEN; } - if (!found_merge_log && !strcmp("merge.summary", key)) - merge_summary = git_config_bool(key, value); return 0; } @@ -255,9 +256,9 @@ static void do_fmt_merge_msg_title(struct strbuf *out, strbuf_addf(out, " into %s\n", current_branch); } -static int do_fmt_merge_msg(int merge_title, int merge_summary, - struct strbuf *in, struct strbuf *out) { - int limit = 20, i = 0, pos = 0; +static int do_fmt_merge_msg(int merge_title, struct strbuf *in, + struct strbuf *out, int shortlog_len) { + int i = 0, pos = 0; unsigned char head_sha1[20]; const char *current_branch; @@ -288,7 +289,7 @@ static int do_fmt_merge_msg(int merge_title, int merge_summary, if (merge_title) do_fmt_merge_msg_title(out, current_branch); - if (merge_summary) { + if (shortlog_len) { struct commit *head; struct rev_info rev; @@ -303,17 +304,14 @@ static int do_fmt_merge_msg(int merge_title, int merge_summary, for (i = 0; i < origins.nr; i++) shortlog(origins.items[i].string, origins.items[i].util, - head, &rev, limit, out); + head, &rev, shortlog_len, out); } return 0; } -int fmt_merge_msg(int merge_summary, struct strbuf *in, struct strbuf *out) { - return do_fmt_merge_msg(1, merge_summary, in, out); -} - -int fmt_merge_msg_shortlog(struct strbuf *in, struct strbuf *out) { - return do_fmt_merge_msg(0, 1, in, out); +int fmt_merge_msg(struct strbuf *in, struct strbuf *out, + int merge_title, int shortlog_len) { + return do_fmt_merge_msg(merge_title, in, out, shortlog_len); } int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) @@ -321,10 +319,13 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) const char *inpath = NULL; const char *message = NULL; struct option options[] = { - OPT_BOOLEAN(0, "log", &merge_summary, "populate log with the shortlog"), - { OPTION_BOOLEAN, 0, "summary", &merge_summary, NULL, + { OPTION_INTEGER, 0, "log", &shortlog_len, "n", + "populate log with at most <n> entries from shortlog", + PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN }, + { OPTION_INTEGER, 0, "summary", &shortlog_len, "n", "alias for --log (deprecated)", - PARSE_OPT_NOARG | PARSE_OPT_HIDDEN }, + PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, NULL, + DEFAULT_MERGE_LOG_LEN }, OPT_STRING('m', "message", &message, "text", "use <text> as start of message"), OPT_FILENAME('F', "file", &inpath, "file to read from"), @@ -340,12 +341,14 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) 0); if (argc > 0) usage_with_options(fmt_merge_msg_usage, options); - if (message && !merge_summary) { + if (message && !shortlog_len) { char nl = '\n'; write_in_full(STDOUT_FILENO, message, strlen(message)); write_in_full(STDOUT_FILENO, &nl, 1); return 0; } + if (shortlog_len < 0) + die("Negative --log=%d", shortlog_len); if (inpath && strcmp(inpath, "-")) { in = fopen(inpath, "r"); @@ -355,12 +358,13 @@ int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) if (strbuf_read(&input, fileno(in), 0) < 0) die_errno("could not read input file"); - if (message) { + + if (message) strbuf_addstr(&output, message); - ret = fmt_merge_msg_shortlog(&input, &output); - } else { - ret = fmt_merge_msg(merge_summary, &input, &output); - } + ret = fmt_merge_msg(&input, &output, + message ? 0 : 1, + shortlog_len); + if (ret) return ret; write_in_full(STDOUT_FILENO, output.buf, output.len); diff --git a/builtin/log.c b/builtin/log.c index eaa1ee0fa7..22d12903ac 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -1056,8 +1056,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) rev.commit_format = CMIT_FMT_EMAIL; rev.verbose_header = 1; rev.diff = 1; - rev.combine_merges = 0; - rev.ignore_merges = 1; + rev.no_merges = 1; DIFF_OPT_SET(&rev.diffopt, RECURSIVE); rev.subject_prefix = fmt_patch_subject_prefix; memset(&s_r_opt, 0, sizeof(s_r_opt)); @@ -1228,10 +1227,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) continue; } - /* ignore merges */ - if (commit->parents && commit->parents->next) - continue; - if (ignore_if_in_upstream && has_commit_patch_id(commit, &ids)) continue; diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c index dc86b0d9a9..a8187568bf 100644 --- a/builtin/ls-tree.c +++ b/builtin/ls-tree.c @@ -52,6 +52,8 @@ static int show_recursive(const char *base, int baselen, const char *pathname) speclen = strlen(spec); if (speclen <= len) continue; + if (spec[len] && spec[len] != '/') + continue; if (memcmp(pathname, spec, len)) continue; return 1; diff --git a/builtin/merge.c b/builtin/merge.c index 5f65c0c8a6..2dba3b9901 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -42,7 +42,7 @@ static const char * const builtin_merge_usage[] = { NULL }; -static int show_diffstat = 1, option_log, squash; +static int show_diffstat = 1, shortlog_len, squash; static int option_commit = 1, allow_fast_forward = 1; static int fast_forward_only; static int allow_trivial = 1, have_message; @@ -177,8 +177,9 @@ static struct option builtin_merge_options[] = { OPT_BOOLEAN(0, "stat", &show_diffstat, "show a diffstat at the end of the merge"), OPT_BOOLEAN(0, "summary", &show_diffstat, "(synonym to --stat)"), - OPT_BOOLEAN(0, "log", &option_log, - "add list of one-line log to merge commit message"), + { OPTION_INTEGER, 0, "log", &shortlog_len, "n", + "add (at most <n>) entries from shortlog to merge commit message", + PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN }, OPT_BOOLEAN(0, "squash", &squash, "create a single commit instead of doing a merge"), OPT_BOOLEAN(0, "commit", &option_commit, @@ -504,10 +505,17 @@ static int git_merge_config(const char *k, const char *v, void *cb) return git_config_string(&pull_twohead, k, v); else if (!strcmp(k, "pull.octopus")) return git_config_string(&pull_octopus, k, v); - else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) - option_log = git_config_bool(k, v); else if (!strcmp(k, "merge.renormalize")) option_renormalize = git_config_bool(k, v); + else if (!strcmp(k, "merge.log") || !strcmp(k, "merge.summary")) { + int is_bool; + shortlog_len = git_config_bool_or_int(k, v, &is_bool); + if (!is_bool && shortlog_len < 0) + return error("%s: negative length %s", k, v); + if (is_bool && shortlog_len) + shortlog_len = DEFAULT_MERGE_LOG_LEN; + return 0; + } return git_diff_ui_config(k, v, cb); } @@ -1012,14 +1020,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix) for (i = 0; i < argc; i++) merge_name(argv[i], &merge_names); - if (have_message && option_log) - fmt_merge_msg_shortlog(&merge_names, &merge_msg); - else if (!have_message) - fmt_merge_msg(option_log, &merge_names, &merge_msg); - - - if (!(have_message && !option_log) && merge_msg.len) - strbuf_setlen(&merge_msg, merge_msg.len-1); + if (!have_message || shortlog_len) { + fmt_merge_msg(&merge_names, &merge_msg, !have_message, + shortlog_len); + if (merge_msg.len) + strbuf_setlen(&merge_msg, merge_msg.len - 1); + } } if (head_invalid || !argc) diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 9ad1e66916..eb1e3e7467 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -16,6 +16,7 @@ #include "resolve-undo.h" static int nr_trees; +static int read_empty; static struct tree *trees[MAX_UNPACK_TREES]; static int list_tree(unsigned char *sha1) @@ -32,7 +33,7 @@ static int list_tree(unsigned char *sha1) } static const char * const read_tree_usage[] = { - "git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]]", + "git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] (--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])", NULL }; @@ -106,6 +107,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) { OPTION_CALLBACK, 0, "index-output", NULL, "FILE", "write resulting index to <FILE>", PARSE_OPT_NONEG, index_output_cb }, + OPT_SET_INT(0, "empty", &read_empty, + "only empty the index", 1), OPT__VERBOSE(&opts.verbose_update), OPT_GROUP("Merging"), OPT_SET_INT('m', NULL, &opts.merge, @@ -166,6 +169,11 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) die("failed to unpack tree object %s", arg); stage++; } + if (nr_trees == 0 && !read_empty) + warning("read-tree: emptying the index with no arguments is deprecated; use --empty"); + else if (nr_trees > 0 && read_empty) + die("passing trees as arguments contradicts --empty"); + if (1 < opts.index_only + opts.update) die("-u and -i at the same time makes no sense"); if ((opts.update||opts.index_only) && !opts.merge) @@ -372,8 +372,10 @@ int create_bundle(struct bundle_header *header, const char *path, close(rls.in); if (finish_command(&rls)) return error ("pack-objects died"); - if (!bundle_to_stdout) - commit_lock_file(&lock); + if (!bundle_to_stdout) { + if (commit_lock_file(&lock)) + die_errno("cannot create '%s'", path); + } return 0; } diff --git a/configure.ac b/configure.ac index 56731c35c9..cc55b6d4f7 100644 --- a/configure.ac +++ b/configure.ac @@ -282,7 +282,15 @@ GIT_PARSE_WITH(iconv)) GIT_PARSE_WITH_SET_MAKE_VAR(gitconfig, ETC_GITCONFIG, Use VALUE instead of /etc/gitconfig as the global git configuration file. - If VALUE is not fully qualified it will be interpretted + If VALUE is not fully qualified it will be interpreted + as a path relative to the computed prefix at runtime.) + +# +# Allow user to set ETC_GITATTRIBUTES variable +GIT_PARSE_WITH_SET_MAKE_VAR(gitattributes, ETC_GITATTRIBUTES, + Use VALUE instead of /etc/gitattributes as the + global git attributes file. + If VALUE is not fully qualified it will be interpreted as a path relative to the computed prefix at runtime.) # diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 67569901e7..f83f019ca9 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1125,7 +1125,7 @@ _git_diff () case "$cur" in --*) __gitcomp "--cached --staged --pickaxe-all --pickaxe-regex - --base --ours --theirs + --base --ours --theirs --no-index $__git_diff_common_options " return diff --git a/contrib/git-shell-commands/README b/contrib/git-shell-commands/README new file mode 100644 index 0000000000..438463b160 --- /dev/null +++ b/contrib/git-shell-commands/README @@ -0,0 +1,18 @@ +Sample programs callable through git-shell. Place a directory named +'git-shell-commands' in the home directory of a user whose shell is +git-shell. Then anyone logging in as that user will be able to run +executables in the 'git-shell-commands' directory. + +Provided commands: + +help: Prints out the names of available commands. When run +interactively, git-shell will automatically run 'help' on startup, +provided it exists. + +list: Displays any bare repository whose name ends with ".git" under +user's home directory. No other git repositories are visible, +although they might be clonable through git-shell. 'list' is designed +to minimize the number of calls to git that must be made in finding +available repositories; if your setup has additional repositories that +should be user-discoverable, you may wish to modify 'list' +accordingly. diff --git a/contrib/git-shell-commands/help b/contrib/git-shell-commands/help new file mode 100755 index 0000000000..535770c6ec --- /dev/null +++ b/contrib/git-shell-commands/help @@ -0,0 +1,18 @@ +#!/bin/sh + +if tty -s +then + echo "Run 'help' for help, or 'exit' to leave. Available commands:" +else + echo "Run 'help' for help. Available commands:" +fi + +cd "$(dirname "$0")" + +for cmd in * +do + case "$cmd" in + help) ;; + *) [ -f "$cmd" ] && [ -x "$cmd" ] && echo "$cmd" ;; + esac +done diff --git a/contrib/git-shell-commands/list b/contrib/git-shell-commands/list new file mode 100755 index 0000000000..6f89938821 --- /dev/null +++ b/contrib/git-shell-commands/list @@ -0,0 +1,10 @@ +#!/bin/sh + +print_if_bare_repo=' + if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true + then + printf "%s\n" "${1#./}" + fi +' + +find -type d -name "*.git" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir index 3ad2c0cea5..75e8b25817 100755 --- a/contrib/workdir/git-new-workdir +++ b/contrib/workdir/git-new-workdir @@ -42,7 +42,7 @@ then fi # don't link to a workdir -if test -L "$git_dir/config" +if test -h "$git_dir/config" then die "\"$orig_git\" is a working directory only, please specify" \ "a complete repository." @@ -3271,12 +3271,17 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) } else if ((argcount = short_opt('S', av, &optarg))) { options->pickaxe = optarg; + options->pickaxe_opts |= DIFF_PICKAXE_KIND_S; + return argcount; + } else if ((argcount = short_opt('G', av, &optarg))) { + options->pickaxe = optarg; + options->pickaxe_opts |= DIFF_PICKAXE_KIND_G; return argcount; } else if (!strcmp(arg, "--pickaxe-all")) - options->pickaxe_opts = DIFF_PICKAXE_ALL; + options->pickaxe_opts |= DIFF_PICKAXE_ALL; else if (!strcmp(arg, "--pickaxe-regex")) - options->pickaxe_opts = DIFF_PICKAXE_REGEX; + options->pickaxe_opts |= DIFF_PICKAXE_REGEX; else if ((argcount = short_opt('O', av, &optarg))) { options->orderfile = optarg; return argcount; @@ -3310,7 +3315,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac) else if ((argcount = parse_long_opt("output", av, &optarg))) { options->file = fopen(optarg, "w"); if (!options->file) - die_errno("Could not open '%s'", arg + strlen("--output=")); + die_errno("Could not open '%s'", optarg); options->close_file = 1; return argcount; } else @@ -4176,7 +4181,7 @@ void diffcore_std(struct diff_options *options) diffcore_merge_broken(); } if (options->pickaxe) - diffcore_pickaxe(options->pickaxe, options->pickaxe_opts); + diffcore_pickaxe(options); if (options->orderfile) diffcore_order(options->orderfile); if (!options->found_follow) @@ -238,6 +238,9 @@ extern int diff_setup_done(struct diff_options *); #define DIFF_PICKAXE_ALL 1 #define DIFF_PICKAXE_REGEX 2 +#define DIFF_PICKAXE_KIND_S 4 /* traditional plumbing counter */ +#define DIFF_PICKAXE_KIND_G 8 /* grep in the patch */ + extern void diffcore_std(struct diff_options *); extern void diffcore_fix_diff_index(struct diff_options *); diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 929de15aa9..84195e47aa 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -1,9 +1,148 @@ /* * Copyright (C) 2005 Junio C Hamano + * Copyright (C) 2010 Google Inc. */ #include "cache.h" #include "diff.h" #include "diffcore.h" +#include "xdiff-interface.h" + +struct diffgrep_cb { + regex_t *regexp; + int hit; +}; + +static void diffgrep_consume(void *priv, char *line, unsigned long len) +{ + struct diffgrep_cb *data = priv; + regmatch_t regmatch; + int hold; + + if (line[0] != '+' && line[0] != '-') + return; + if (data->hit) + /* + * NEEDSWORK: we should have a way to terminate the + * caller early. + */ + return; + /* Yuck -- line ought to be "const char *"! */ + hold = line[len]; + line[len] = '\0'; + data->hit = !regexec(data->regexp, line + 1, 1, ®match, 0); + line[len] = hold; +} + +static void fill_one(struct diff_filespec *one, + mmfile_t *mf, struct userdiff_driver **textconv) +{ + if (DIFF_FILE_VALID(one)) { + *textconv = get_textconv(one); + mf->size = fill_textconv(*textconv, one, &mf->ptr); + } else { + memset(mf, 0, sizeof(*mf)); + } +} + +static int diff_grep(struct diff_filepair *p, regex_t *regexp, struct diff_options *o) +{ + regmatch_t regmatch; + struct userdiff_driver *textconv_one = NULL; + struct userdiff_driver *textconv_two = NULL; + mmfile_t mf1, mf2; + int hit; + + if (diff_unmodified_pair(p)) + return 0; + + fill_one(p->one, &mf1, &textconv_one); + fill_one(p->two, &mf2, &textconv_two); + + if (!mf1.ptr) { + if (!mf2.ptr) + return 0; /* ignore unmerged */ + /* created "two" -- does it have what we are looking for? */ + hit = !regexec(regexp, p->two->data, 1, ®match, 0); + } else if (!mf2.ptr) { + /* removed "one" -- did it have what we are looking for? */ + hit = !regexec(regexp, p->one->data, 1, ®match, 0); + } else { + /* + * We have both sides; need to run textual diff and see if + * the pattern appears on added/deleted lines. + */ + struct diffgrep_cb ecbdata; + xpparam_t xpp; + xdemitconf_t xecfg; + + memset(&xpp, 0, sizeof(xpp)); + memset(&xecfg, 0, sizeof(xecfg)); + ecbdata.regexp = regexp; + ecbdata.hit = 0; + xecfg.ctxlen = o->context; + xecfg.interhunkctxlen = o->interhunkcontext; + xdi_diff_outf(&mf1, &mf2, diffgrep_consume, &ecbdata, + &xpp, &xecfg); + hit = ecbdata.hit; + } + if (textconv_one) + free(mf1.ptr); + if (textconv_two) + free(mf2.ptr); + return hit; +} + +static void diffcore_pickaxe_grep(struct diff_options *o) +{ + struct diff_queue_struct *q = &diff_queued_diff; + int i, has_changes, err; + regex_t regex; + struct diff_queue_struct outq; + outq.queue = NULL; + outq.nr = outq.alloc = 0; + + err = regcomp(®ex, o->pickaxe, REG_EXTENDED | REG_NEWLINE); + if (err) { + char errbuf[1024]; + regerror(err, ®ex, errbuf, 1024); + regfree(®ex); + die("invalid log-grep regex: %s", errbuf); + } + + if (o->pickaxe_opts & DIFF_PICKAXE_ALL) { + /* Showing the whole changeset if needle exists */ + for (i = has_changes = 0; !has_changes && i < q->nr; i++) { + struct diff_filepair *p = q->queue[i]; + if (diff_grep(p, ®ex, o)) + has_changes++; + } + if (has_changes) + return; /* do not munge the queue */ + + /* + * Otherwise we will clear the whole queue by copying + * the empty outq at the end of this function, but + * first clear the current entries in the queue. + */ + for (i = 0; i < q->nr; i++) + diff_free_filepair(q->queue[i]); + } else { + /* Showing only the filepairs that has the needle */ + for (i = 0; i < q->nr; i++) { + struct diff_filepair *p = q->queue[i]; + if (diff_grep(p, ®ex, o)) + diff_q(&outq, p); + else + diff_free_filepair(p); + } + } + + regfree(®ex); + + free(q->queue); + *q = outq; + return; +} static unsigned int contains(struct diff_filespec *one, const char *needle, unsigned long len, @@ -48,8 +187,10 @@ static unsigned int contains(struct diff_filespec *one, return cnt; } -void diffcore_pickaxe(const char *needle, int opts) +static void diffcore_pickaxe_count(struct diff_options *o) { + const char *needle = o->pickaxe; + int opts = o->pickaxe_opts; struct diff_queue_struct *q = &diff_queued_diff; unsigned long len = strlen(needle); int i, has_changes; @@ -136,3 +277,12 @@ void diffcore_pickaxe(const char *needle, int opts) *q = outq; return; } + +void diffcore_pickaxe(struct diff_options *o) +{ + /* Might want to warn when both S and G are on; I don't care... */ + if (o->pickaxe_opts & DIFF_PICKAXE_KIND_G) + return diffcore_pickaxe_grep(o); + else + return diffcore_pickaxe_count(o); +} diff --git a/diffcore.h b/diffcore.h index 8b3241ad13..b8f1fdecf4 100644 --- a/diffcore.h +++ b/diffcore.h @@ -107,7 +107,7 @@ extern void diff_q(struct diff_queue_struct *, struct diff_filepair *); extern void diffcore_break(int); extern void diffcore_rename(struct diff_options *); extern void diffcore_merge_broken(void); -extern void diffcore_pickaxe(const char *needle, int opts); +extern void diffcore_pickaxe(struct diff_options *); extern void diffcore_order(const char *orderfile); #define DIFF_DEBUG 0 @@ -232,7 +232,7 @@ int add_excludes_from_file_to_list(const char *fname, { struct stat st; int fd, i; - size_t size; + size_t size = 0; char *buf, *entry; fd = open(fname, O_RDONLY); diff --git a/git-compat-util.h b/git-compat-util.h index 877096ecb0..81883e7270 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -160,6 +160,10 @@ extern char *gitbasename(char *); #define PRIx32 "x" #endif +#ifndef PRIo32 +#define PRIo32 "o" +#endif + #ifndef PATH_SEP #define PATH_SEP ':' #endif diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 88fb0f070e..962a93b586 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -139,6 +139,7 @@ do continue ;; --remap-to-ancestor) + # deprecated ($remap_to_ancestor is set now automatically) shift remap_to_ancestor=t continue @@ -265,7 +266,14 @@ mkdir ../map || die "Could not create map/ directory" # we need "--" only if there are no path arguments in $@ nonrevs=$(git rev-parse --no-revs "$@") || exit -test -z "$nonrevs" && dashdash=-- || dashdash= +if test -z "$nonrevs" +then + dashdash=-- +else + dashdash= + remap_to_ancestor=t +fi + rev_args=$(git rev-parse --revs-only "$@") case "$filter_subdir" in diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN index b3f937eace..1fb4d9b4b7 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.12.GITGUI +DEF_VER=0.13.GITGUI LF=' ' diff --git a/git-gui/Makefile b/git-gui/Makefile index 197b55edf3..e22ba5c321 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -215,6 +215,7 @@ endif $(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS $(QUIET_GEN)rm -f $@ $@+ && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ + -e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \ -e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \ -e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \ -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \ diff --git a/git-gui/git-gui--askpass b/git-gui/git-gui--askpass index 12e117ecb1..4277f30c41 100755 --- a/git-gui/git-gui--askpass +++ b/git-gui/git-gui--askpass @@ -5,6 +5,8 @@ exec wish "$0" -- "$@" # This is a trivial implementation of an SSH_ASKPASS handler. # Git-gui uses this script if none are already configured. +package require Tk + set answer {} set yesno 0 set rc 255 @@ -30,16 +32,20 @@ if {!$yesno} { frame .b button .b.ok -text OK -command finish -button .b.cancel -text Cancel -command {destroy .} +button .b.cancel -text Cancel -command cancel pack .b.ok -side left -expand 1 pack .b.cancel -side right -expand 1 pack .b -side bottom -fill x -padx 10 -pady 10 bind . <Visibility> {focus -force .e} -bind . <Key-Return> finish -bind . <Key-Escape> {destroy .} -bind . <Destroy> {exit $rc} +bind . <Key-Return> [list .b.ok invoke] +bind . <Key-Escape> [list .b.cancel invoke] +bind . <Destroy> {set rc $rc} + +proc cancel {} { + set ::rc 255 +} proc finish {} { if {$::yesno} { @@ -50,10 +56,11 @@ proc finish {} { } } - set ::rc 0 puts $::answer - destroy . + set ::rc 0 } wm title . "OpenSSH" tk::PlaceWindow . +vwait rc +exit $rc diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index bb104895a9..4617f29c26 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -10,8 +10,8 @@ exec wish "$argv0" -- "$@" set appvers {@@GITGUI_VERSION@@} -set copyright [encoding convertfrom utf-8 { -Copyright © 2006, 2007 Shawn Pearce, et. al. +set copyright [string map [list (c) \u00a9] { +Copyright (c) 2006-2010 Shawn Pearce, et. al. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -128,6 +128,7 @@ set _githtmldir {} set _reponame {} set _iscygwin {} set _search_path {} +set _shellpath {@@SHELL_PATH@@} set _trace [lsearch -exact $argv --trace] if {$_trace >= 0} { @@ -137,6 +138,18 @@ if {$_trace >= 0} { set _trace 0 } +proc shellpath {} { + global _shellpath env + if {[string match @@* $_shellpath]} { + if {[info exists env(SHELL)]} { + return $env(SHELL) + } else { + return /bin/sh + } + } + return $_shellpath +} + proc appname {} { global _appname return $_appname @@ -2845,7 +2858,13 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]} set subcommand_args {} proc usage {} { - puts stderr "usage: $::argv0 $::subcommand $::subcommand_args" + set s "usage: $::argv0 $::subcommand $::subcommand_args" + if {[tk windowingsystem] eq "win32"} { + wm withdraw . + tk_messageBox -icon info -title "Usage" -message $s + } else { + puts stderr $s + } exit 1 } @@ -2938,7 +2957,12 @@ blame { } blame { if {$head eq {} && ![file exists $path]} { - puts stderr [mc "fatal: cannot stat path %s: No such file or directory" $path] + catch {wm withdraw .} + tk_messageBox \ + -icon error \ + -type ok \ + -title [mc "git-gui: fatal error"] \ + -message [mc "fatal: cannot stat path %s: No such file or directory" $path] exit 1 } blame::new $head $path $jump_spec diff --git a/git-gui/lib/blame.tcl b/git-gui/lib/blame.tcl index 2137ec9684..61e358f960 100644 --- a/git-gui/lib/blame.tcl +++ b/git-gui/lib/blame.tcl @@ -460,7 +460,14 @@ method _load {jump} { } if {$commit eq {}} { if {$do_textconv ne 0} { - set fd [open |[list $textconv $path] r] + # Run textconv with sh -c "..." to allow it to + # contain command + arguments. On windows, just + # call the filter command. + if {![file executable [shellpath]]} { + set fd [open |[linsert $textconv end $path] r] + } else { + set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r] + } } else { set fd [open $path r] } diff --git a/git-gui/po/sv.po b/git-gui/po/sv.po index d8d73acf2c..8bd3c5d75f 100644 --- a/git-gui/po/sv.po +++ b/git-gui/po/sv.po @@ -8,41 +8,41 @@ msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-26 15:47-0800\n" -"PO-Revision-Date: 2010-01-28 13:57+0100\n" +"POT-Creation-Date: 2010-09-12 21:11+0100\n" +"PO-Revision-Date: 2010-09-12 21:12+0100\n" "Last-Translator: Peter Krefting <peter@softwolves.pp.se>\n" "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit" -#: git-gui.sh:41 git-gui.sh:793 git-gui.sh:807 git-gui.sh:820 git-gui.sh:903 -#: git-gui.sh:922 -msgid "git-gui: fatal error" -msgstr "git-gui: ödesdigert fel" - -#: git-gui.sh:743 +#: git-gui.sh:781 #, tcl-format msgid "Invalid font specified in %s:" msgstr "Ogiltigt teckensnitt angivet i %s:" -#: git-gui.sh:779 +#: git-gui.sh:831 msgid "Main Font" msgstr "Huvudteckensnitt" -#: git-gui.sh:780 +#: git-gui.sh:832 msgid "Diff/Console Font" msgstr "Diff/konsolteckensnitt" -#: git-gui.sh:794 +#: git-gui.sh:845 git-gui.sh:859 git-gui.sh:872 git-gui.sh:955 git-gui.sh:974 +#: git-gui.sh:2964 +msgid "git-gui: fatal error" +msgstr "git-gui: ödesdigert fel" + +#: git-gui.sh:846 msgid "Cannot find git in PATH." msgstr "Hittar inte git i PATH." -#: git-gui.sh:821 +#: git-gui.sh:873 msgid "Cannot parse Git version string:" msgstr "Kan inte tolka versionssträng frÃ¥n Git:" -#: git-gui.sh:839 +#: git-gui.sh:891 #, tcl-format msgid "" "Git version cannot be determined.\n" @@ -61,478 +61,478 @@ msgstr "" "\n" "Anta att \"%s\" är version 1.5.0?\n" -#: git-gui.sh:1128 +#: git-gui.sh:1180 msgid "Git directory not found:" msgstr "Git-katalogen hittades inte:" -#: git-gui.sh:1146 +#: git-gui.sh:1201 msgid "Cannot move to top of working directory:" msgstr "Kan inte gÃ¥ till början pÃ¥ arbetskatalogen:" -#: git-gui.sh:1154 +#: git-gui.sh:1209 msgid "Cannot use bare repository:" msgstr "Kan inte använda naket arkiv:" -#: git-gui.sh:1162 +#: git-gui.sh:1217 msgid "No working directory" msgstr "Ingen arbetskatalog" -#: git-gui.sh:1334 lib/checkout_op.tcl:306 +#: git-gui.sh:1389 lib/checkout_op.tcl:306 msgid "Refreshing file status..." msgstr "Uppdaterar filstatus..." -#: git-gui.sh:1390 +#: git-gui.sh:1445 msgid "Scanning for modified files ..." msgstr "Söker efter ändrade filer..." -#: git-gui.sh:1454 +#: git-gui.sh:1509 msgid "Calling prepare-commit-msg hook..." msgstr "" "Anropar kroken för förberedelse av incheckningsmeddelande (prepare-commit-" "msg)..." -#: git-gui.sh:1471 +#: git-gui.sh:1526 msgid "Commit declined by prepare-commit-msg hook." msgstr "" "Incheckningen avvisades av kroken för förberedelse av incheckningsmeddelande " "(prepare-commit-msg)." -#: git-gui.sh:1629 lib/browser.tcl:246 +#: git-gui.sh:1684 lib/browser.tcl:246 msgid "Ready." msgstr "Klar." -#: git-gui.sh:1787 +#: git-gui.sh:1842 #, tcl-format msgid "Displaying only %s of %s files." msgstr "Visar endast %s av %s filer." -#: git-gui.sh:1913 +#: git-gui.sh:1968 msgid "Unmodified" msgstr "Oförändrade" -#: git-gui.sh:1915 +#: git-gui.sh:1970 msgid "Modified, not staged" msgstr "Förändrade, ej köade" -#: git-gui.sh:1916 git-gui.sh:1924 +#: git-gui.sh:1971 git-gui.sh:1979 msgid "Staged for commit" msgstr "Köade för incheckning" -#: git-gui.sh:1917 git-gui.sh:1925 +#: git-gui.sh:1972 git-gui.sh:1980 msgid "Portions staged for commit" msgstr "Delar köade för incheckning" -#: git-gui.sh:1918 git-gui.sh:1926 +#: git-gui.sh:1973 git-gui.sh:1981 msgid "Staged for commit, missing" msgstr "Köade för incheckning, saknade" -#: git-gui.sh:1920 +#: git-gui.sh:1975 msgid "File type changed, not staged" msgstr "Filtyp ändrad, ej köade" -#: git-gui.sh:1921 +#: git-gui.sh:1976 msgid "File type changed, staged" msgstr "Filtyp ändrad, köade" -#: git-gui.sh:1923 +#: git-gui.sh:1978 msgid "Untracked, not staged" msgstr "Ej spÃ¥rade, ej köade" -#: git-gui.sh:1928 +#: git-gui.sh:1983 msgid "Missing" msgstr "Saknade" -#: git-gui.sh:1929 +#: git-gui.sh:1984 msgid "Staged for removal" msgstr "Köade för borttagning" -#: git-gui.sh:1930 +#: git-gui.sh:1985 msgid "Staged for removal, still present" msgstr "Köade för borttagning, fortfarande närvarande" -#: git-gui.sh:1932 git-gui.sh:1933 git-gui.sh:1934 git-gui.sh:1935 -#: git-gui.sh:1936 git-gui.sh:1937 +#: git-gui.sh:1987 git-gui.sh:1988 git-gui.sh:1989 git-gui.sh:1990 +#: git-gui.sh:1991 git-gui.sh:1992 msgid "Requires merge resolution" msgstr "Kräver konflikthantering efter sammanslagning" -#: git-gui.sh:1972 +#: git-gui.sh:2027 msgid "Starting gitk... please wait..." msgstr "Startar gitk... vänta..." -#: git-gui.sh:1984 +#: git-gui.sh:2039 msgid "Couldn't find gitk in PATH" msgstr "Hittade inte gitk i PATH." -#: git-gui.sh:2043 +#: git-gui.sh:2098 msgid "Couldn't find git gui in PATH" msgstr "Hittade inte git gui i PATH." -#: git-gui.sh:2455 lib/choose_repository.tcl:36 +#: git-gui.sh:2515 lib/choose_repository.tcl:36 msgid "Repository" msgstr "Arkiv" -#: git-gui.sh:2456 +#: git-gui.sh:2516 msgid "Edit" msgstr "Redigera" -#: git-gui.sh:2458 lib/choose_rev.tcl:561 +#: git-gui.sh:2518 lib/choose_rev.tcl:566 msgid "Branch" msgstr "Gren" -#: git-gui.sh:2461 lib/choose_rev.tcl:548 +#: git-gui.sh:2521 lib/choose_rev.tcl:553 msgid "Commit@@noun" msgstr "Incheckning" -#: git-gui.sh:2464 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168 +#: git-gui.sh:2524 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168 msgid "Merge" msgstr "SlÃ¥ ihop" -#: git-gui.sh:2465 lib/choose_rev.tcl:557 +#: git-gui.sh:2525 lib/choose_rev.tcl:562 msgid "Remote" msgstr "Fjärrarkiv" -#: git-gui.sh:2468 +#: git-gui.sh:2528 msgid "Tools" msgstr "Verktyg" -#: git-gui.sh:2477 +#: git-gui.sh:2537 msgid "Explore Working Copy" msgstr "Utforska arbetskopia" -#: git-gui.sh:2483 +#: git-gui.sh:2543 msgid "Browse Current Branch's Files" msgstr "Bläddra i grenens filer" -#: git-gui.sh:2487 +#: git-gui.sh:2547 msgid "Browse Branch Files..." msgstr "Bläddra filer pÃ¥ gren..." -#: git-gui.sh:2492 +#: git-gui.sh:2552 msgid "Visualize Current Branch's History" msgstr "Visualisera grenens historik" -#: git-gui.sh:2496 +#: git-gui.sh:2556 msgid "Visualize All Branch History" msgstr "Visualisera alla grenars historik" -#: git-gui.sh:2503 +#: git-gui.sh:2563 #, tcl-format msgid "Browse %s's Files" msgstr "Bläddra i filer för %s" -#: git-gui.sh:2505 +#: git-gui.sh:2565 #, tcl-format msgid "Visualize %s's History" msgstr "Visualisera historik för %s" -#: git-gui.sh:2510 lib/database.tcl:27 lib/database.tcl:67 +#: git-gui.sh:2570 lib/database.tcl:40 lib/database.tcl:66 msgid "Database Statistics" msgstr "Databasstatistik" -#: git-gui.sh:2513 lib/database.tcl:34 +#: git-gui.sh:2573 lib/database.tcl:33 msgid "Compress Database" msgstr "Komprimera databas" -#: git-gui.sh:2516 +#: git-gui.sh:2576 msgid "Verify Database" msgstr "Verifiera databas" -#: git-gui.sh:2523 git-gui.sh:2527 git-gui.sh:2531 lib/shortcut.tcl:8 +#: git-gui.sh:2583 git-gui.sh:2587 git-gui.sh:2591 lib/shortcut.tcl:8 #: lib/shortcut.tcl:40 lib/shortcut.tcl:72 msgid "Create Desktop Icon" msgstr "Skapa skrivbordsikon" -#: git-gui.sh:2539 lib/choose_repository.tcl:183 lib/choose_repository.tcl:191 +#: git-gui.sh:2599 lib/choose_repository.tcl:188 lib/choose_repository.tcl:196 msgid "Quit" msgstr "Avsluta" -#: git-gui.sh:2547 +#: git-gui.sh:2607 msgid "Undo" msgstr "Ã…ngra" -#: git-gui.sh:2550 +#: git-gui.sh:2610 msgid "Redo" msgstr "Gör om" -#: git-gui.sh:2554 git-gui.sh:3109 +#: git-gui.sh:2614 git-gui.sh:3190 msgid "Cut" msgstr "Klipp ut" -#: git-gui.sh:2557 git-gui.sh:3112 git-gui.sh:3186 git-gui.sh:3259 +#: git-gui.sh:2617 git-gui.sh:3193 git-gui.sh:3267 git-gui.sh:3340 #: lib/console.tcl:69 msgid "Copy" msgstr "Kopiera" -#: git-gui.sh:2560 git-gui.sh:3115 +#: git-gui.sh:2620 git-gui.sh:3196 msgid "Paste" msgstr "Klistra in" -#: git-gui.sh:2563 git-gui.sh:3118 lib/branch_delete.tcl:26 -#: lib/remote_branch_delete.tcl:38 +#: git-gui.sh:2623 git-gui.sh:3199 lib/branch_delete.tcl:28 +#: lib/remote_branch_delete.tcl:39 msgid "Delete" msgstr "Ta bort" -#: git-gui.sh:2567 git-gui.sh:3122 git-gui.sh:3263 lib/console.tcl:71 +#: git-gui.sh:2627 git-gui.sh:3203 git-gui.sh:3344 lib/console.tcl:71 msgid "Select All" msgstr "Markera alla" -#: git-gui.sh:2576 +#: git-gui.sh:2636 msgid "Create..." msgstr "Skapa..." -#: git-gui.sh:2582 +#: git-gui.sh:2642 msgid "Checkout..." msgstr "Checka ut..." -#: git-gui.sh:2588 +#: git-gui.sh:2648 msgid "Rename..." msgstr "Byt namn..." -#: git-gui.sh:2593 +#: git-gui.sh:2653 msgid "Delete..." msgstr "Ta bort..." -#: git-gui.sh:2598 +#: git-gui.sh:2658 msgid "Reset..." msgstr "Ã…terställ..." -#: git-gui.sh:2608 +#: git-gui.sh:2668 msgid "Done" msgstr "Färdig" -#: git-gui.sh:2610 +#: git-gui.sh:2670 msgid "Commit@@verb" msgstr "Checka in" -#: git-gui.sh:2619 git-gui.sh:3050 +#: git-gui.sh:2679 git-gui.sh:3131 msgid "New Commit" msgstr "Ny incheckning" -#: git-gui.sh:2627 git-gui.sh:3057 +#: git-gui.sh:2687 git-gui.sh:3138 msgid "Amend Last Commit" msgstr "Lägg till föregÃ¥ende incheckning" -#: git-gui.sh:2637 git-gui.sh:3011 lib/remote_branch_delete.tcl:99 +#: git-gui.sh:2697 git-gui.sh:3092 lib/remote_branch_delete.tcl:101 msgid "Rescan" msgstr "Sök pÃ¥ nytt" -#: git-gui.sh:2643 +#: git-gui.sh:2703 msgid "Stage To Commit" msgstr "Köa för incheckning" -#: git-gui.sh:2649 +#: git-gui.sh:2709 msgid "Stage Changed Files To Commit" msgstr "Köa ändrade filer för incheckning" -#: git-gui.sh:2655 +#: git-gui.sh:2715 msgid "Unstage From Commit" msgstr "Ta bort frÃ¥n incheckningskö" -#: git-gui.sh:2661 lib/index.tcl:412 +#: git-gui.sh:2721 lib/index.tcl:415 msgid "Revert Changes" msgstr "Ã…terställ ändringar" -#: git-gui.sh:2669 git-gui.sh:3310 git-gui.sh:3341 +#: git-gui.sh:2729 git-gui.sh:3391 git-gui.sh:3422 msgid "Show Less Context" msgstr "Visa mindre sammanhang" -#: git-gui.sh:2673 git-gui.sh:3314 git-gui.sh:3345 +#: git-gui.sh:2733 git-gui.sh:3395 git-gui.sh:3426 msgid "Show More Context" msgstr "Visa mer sammanhang" -#: git-gui.sh:2680 git-gui.sh:3024 git-gui.sh:3133 +#: git-gui.sh:2740 git-gui.sh:3105 git-gui.sh:3214 msgid "Sign Off" msgstr "Skriv under" -#: git-gui.sh:2696 +#: git-gui.sh:2756 msgid "Local Merge..." msgstr "Lokal sammanslagning..." -#: git-gui.sh:2701 +#: git-gui.sh:2761 msgid "Abort Merge..." msgstr "Avbryt sammanslagning..." -#: git-gui.sh:2713 git-gui.sh:2741 +#: git-gui.sh:2773 git-gui.sh:2801 msgid "Add..." msgstr "Lägg till..." -#: git-gui.sh:2717 +#: git-gui.sh:2777 msgid "Push..." msgstr "Sänd..." -#: git-gui.sh:2721 +#: git-gui.sh:2781 msgid "Delete Branch..." msgstr "Ta bort gren..." -#: git-gui.sh:2731 git-gui.sh:3292 +#: git-gui.sh:2791 git-gui.sh:3373 msgid "Options..." msgstr "Alternativ..." -#: git-gui.sh:2742 +#: git-gui.sh:2802 msgid "Remove..." msgstr "Ta bort..." -#: git-gui.sh:2751 lib/choose_repository.tcl:50 +#: git-gui.sh:2811 lib/choose_repository.tcl:50 msgid "Help" msgstr "Hjälp" -#: git-gui.sh:2755 git-gui.sh:2759 lib/about.tcl:14 +#: git-gui.sh:2815 git-gui.sh:2819 lib/about.tcl:14 #: lib/choose_repository.tcl:44 lib/choose_repository.tcl:53 #, tcl-format msgid "About %s" msgstr "Om %s" -#: git-gui.sh:2783 +#: git-gui.sh:2843 msgid "Online Documentation" msgstr "Webbdokumentation" -#: git-gui.sh:2786 lib/choose_repository.tcl:47 lib/choose_repository.tcl:56 +#: git-gui.sh:2846 lib/choose_repository.tcl:47 lib/choose_repository.tcl:56 msgid "Show SSH Key" msgstr "Visa SSH-nyckel" -#: git-gui.sh:2893 +#: git-gui.sh:2965 #, tcl-format msgid "fatal: cannot stat path %s: No such file or directory" msgstr "" "ödesdigert: kunde inte ta status pÃ¥ sökvägen %s: Fil eller katalog saknas" -#: git-gui.sh:2926 +#: git-gui.sh:2997 msgid "Current Branch:" msgstr "Aktuell gren:" -#: git-gui.sh:2947 +#: git-gui.sh:3023 msgid "Staged Changes (Will Commit)" msgstr "Köade ändringar (kommer att checkas in)" -#: git-gui.sh:2967 +#: git-gui.sh:3043 msgid "Unstaged Changes" msgstr "Oköade ändringar" -#: git-gui.sh:3017 +#: git-gui.sh:3098 msgid "Stage Changed" msgstr "Köa ändrade" -#: git-gui.sh:3036 lib/transport.tcl:104 lib/transport.tcl:193 +#: git-gui.sh:3117 lib/transport.tcl:107 lib/transport.tcl:196 msgid "Push" msgstr "Sänd" -#: git-gui.sh:3071 +#: git-gui.sh:3152 msgid "Initial Commit Message:" msgstr "Inledande incheckningsmeddelande:" -#: git-gui.sh:3072 +#: git-gui.sh:3153 msgid "Amended Commit Message:" msgstr "Utökat incheckningsmeddelande:" -#: git-gui.sh:3073 +#: git-gui.sh:3154 msgid "Amended Initial Commit Message:" msgstr "Utökat inledande incheckningsmeddelande:" -#: git-gui.sh:3074 +#: git-gui.sh:3155 msgid "Amended Merge Commit Message:" msgstr "Utökat incheckningsmeddelande för sammanslagning:" -#: git-gui.sh:3075 +#: git-gui.sh:3156 msgid "Merge Commit Message:" msgstr "Incheckningsmeddelande för sammanslagning:" -#: git-gui.sh:3076 +#: git-gui.sh:3157 msgid "Commit Message:" msgstr "Incheckningsmeddelande:" -#: git-gui.sh:3125 git-gui.sh:3267 lib/console.tcl:73 +#: git-gui.sh:3206 git-gui.sh:3348 lib/console.tcl:73 msgid "Copy All" msgstr "Kopiera alla" -#: git-gui.sh:3149 lib/blame.tcl:104 +#: git-gui.sh:3230 lib/blame.tcl:104 msgid "File:" msgstr "Fil:" -#: git-gui.sh:3255 +#: git-gui.sh:3336 msgid "Refresh" msgstr "Uppdatera" -#: git-gui.sh:3276 +#: git-gui.sh:3357 msgid "Decrease Font Size" msgstr "Minska teckensnittsstorlek" -#: git-gui.sh:3280 +#: git-gui.sh:3361 msgid "Increase Font Size" msgstr "Öka teckensnittsstorlek" -#: git-gui.sh:3288 lib/blame.tcl:281 +#: git-gui.sh:3369 lib/blame.tcl:281 msgid "Encoding" msgstr "Teckenkodning" -#: git-gui.sh:3299 +#: git-gui.sh:3380 msgid "Apply/Reverse Hunk" msgstr "Använd/Ã¥terställ del" -#: git-gui.sh:3304 +#: git-gui.sh:3385 msgid "Apply/Reverse Line" msgstr "Använd/Ã¥terställ rad" -#: git-gui.sh:3323 +#: git-gui.sh:3404 msgid "Run Merge Tool" msgstr "Starta verktyg för sammanslagning" -#: git-gui.sh:3328 +#: git-gui.sh:3409 msgid "Use Remote Version" msgstr "Använd versionen frÃ¥n fjärrarkivet" -#: git-gui.sh:3332 +#: git-gui.sh:3413 msgid "Use Local Version" msgstr "Använd lokala versionen" -#: git-gui.sh:3336 +#: git-gui.sh:3417 msgid "Revert To Base" msgstr "Ã…terställ till basversionen" -#: git-gui.sh:3354 +#: git-gui.sh:3435 msgid "Visualize These Changes In The Submodule" msgstr "Visualisera ändringarna i undermodulen" -#: git-gui.sh:3358 +#: git-gui.sh:3439 msgid "Visualize Current Branch History In The Submodule" msgstr "Visualisera grenens historik i undermodulen" -#: git-gui.sh:3362 +#: git-gui.sh:3443 msgid "Visualize All Branch History In The Submodule" msgstr "Visualisera alla grenars historik i undermodulen" -#: git-gui.sh:3367 +#: git-gui.sh:3448 msgid "Start git gui In The Submodule" msgstr "Starta git gui i undermodulen" -#: git-gui.sh:3389 +#: git-gui.sh:3483 msgid "Unstage Hunk From Commit" msgstr "Ta bort del ur incheckningskö" -#: git-gui.sh:3391 +#: git-gui.sh:3485 msgid "Unstage Lines From Commit" msgstr "Ta bort rader ur incheckningskö" -#: git-gui.sh:3393 +#: git-gui.sh:3487 msgid "Unstage Line From Commit" msgstr "Ta bort rad ur incheckningskö" -#: git-gui.sh:3396 +#: git-gui.sh:3490 msgid "Stage Hunk For Commit" msgstr "Ställ del i incheckningskö" -#: git-gui.sh:3398 +#: git-gui.sh:3492 msgid "Stage Lines For Commit" msgstr "Ställ rader i incheckningskö" -#: git-gui.sh:3400 +#: git-gui.sh:3494 msgid "Stage Line For Commit" msgstr "Ställ rad i incheckningskö" -#: git-gui.sh:3424 +#: git-gui.sh:3519 msgid "Initializing..." msgstr "Initierar..." -#: git-gui.sh:3541 +#: git-gui.sh:3658 #, tcl-format msgid "" "Possible environment issues exist.\n" @@ -549,7 +549,7 @@ msgstr "" "av %s:\n" "\n" -#: git-gui.sh:3570 +#: git-gui.sh:3687 msgid "" "\n" "This is due to a known issue with the\n" @@ -559,7 +559,7 @@ msgstr "" "Detta beror pÃ¥ ett känt problem med\n" "Tcl-binären som följer med Cygwin." -#: git-gui.sh:3575 +#: git-gui.sh:3692 #, tcl-format msgid "" "\n" @@ -613,132 +613,132 @@ msgstr "Klandra föräldraincheckning" msgid "Reading %s..." msgstr "Läser %s..." -#: lib/blame.tcl:557 +#: lib/blame.tcl:581 msgid "Loading copy/move tracking annotations..." msgstr "Läser annoteringar för kopiering/flyttning..." -#: lib/blame.tcl:577 +#: lib/blame.tcl:601 msgid "lines annotated" msgstr "rader annoterade" -#: lib/blame.tcl:769 +#: lib/blame.tcl:793 msgid "Loading original location annotations..." msgstr "Läser in annotering av originalplacering..." -#: lib/blame.tcl:772 +#: lib/blame.tcl:796 msgid "Annotation complete." msgstr "Annotering fullbordad." -#: lib/blame.tcl:802 +#: lib/blame.tcl:826 msgid "Busy" msgstr "Upptagen" -#: lib/blame.tcl:803 +#: lib/blame.tcl:827 msgid "Annotation process is already running." msgstr "Annoteringsprocess körs redan." -#: lib/blame.tcl:842 +#: lib/blame.tcl:866 msgid "Running thorough copy detection..." msgstr "Kör grundlig kopieringsigenkänning..." -#: lib/blame.tcl:910 +#: lib/blame.tcl:934 msgid "Loading annotation..." msgstr "Läser in annotering..." -#: lib/blame.tcl:963 +#: lib/blame.tcl:987 msgid "Author:" msgstr "Författare:" -#: lib/blame.tcl:967 +#: lib/blame.tcl:991 msgid "Committer:" msgstr "Incheckare:" -#: lib/blame.tcl:972 +#: lib/blame.tcl:996 msgid "Original File:" msgstr "Ursprunglig fil:" -#: lib/blame.tcl:1020 +#: lib/blame.tcl:1044 msgid "Cannot find HEAD commit:" msgstr "Hittar inte incheckning för HEAD:" -#: lib/blame.tcl:1075 +#: lib/blame.tcl:1099 msgid "Cannot find parent commit:" msgstr "Hittar inte föräldraincheckning:" -#: lib/blame.tcl:1090 +#: lib/blame.tcl:1114 msgid "Unable to display parent" msgstr "Kan inte visa förälder" -#: lib/blame.tcl:1091 lib/diff.tcl:320 +#: lib/blame.tcl:1115 lib/diff.tcl:323 msgid "Error loading diff:" msgstr "Fel vid inläsning av differens:" -#: lib/blame.tcl:1231 +#: lib/blame.tcl:1255 msgid "Originally By:" msgstr "Ursprungligen av:" -#: lib/blame.tcl:1237 +#: lib/blame.tcl:1261 msgid "In File:" msgstr "I filen:" -#: lib/blame.tcl:1242 +#: lib/blame.tcl:1266 msgid "Copied Or Moved Here By:" msgstr "Kopierad eller flyttad hit av:" -#: lib/branch_checkout.tcl:14 lib/branch_checkout.tcl:19 +#: lib/branch_checkout.tcl:16 lib/branch_checkout.tcl:21 msgid "Checkout Branch" msgstr "Checka ut gren" -#: lib/branch_checkout.tcl:23 +#: lib/branch_checkout.tcl:26 msgid "Checkout" msgstr "Checka ut" -#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35 -#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:282 -#: lib/checkout_op.tcl:579 lib/choose_font.tcl:43 lib/merge.tcl:172 -#: lib/option.tcl:125 lib/remote_add.tcl:32 lib/remote_branch_delete.tcl:42 -#: lib/tools_dlg.tcl:40 lib/tools_dlg.tcl:204 lib/tools_dlg.tcl:352 -#: lib/transport.tcl:108 +#: lib/branch_checkout.tcl:30 lib/branch_create.tcl:37 +#: lib/branch_delete.tcl:34 lib/branch_rename.tcl:32 lib/browser.tcl:286 +#: lib/checkout_op.tcl:579 lib/choose_font.tcl:45 lib/merge.tcl:172 +#: lib/option.tcl:127 lib/remote_add.tcl:34 lib/remote_branch_delete.tcl:43 +#: lib/tools_dlg.tcl:41 lib/tools_dlg.tcl:202 lib/tools_dlg.tcl:345 +#: lib/transport.tcl:111 msgid "Cancel" msgstr "Avbryt" -#: lib/branch_checkout.tcl:32 lib/browser.tcl:287 lib/tools_dlg.tcl:328 +#: lib/branch_checkout.tcl:35 lib/browser.tcl:291 lib/tools_dlg.tcl:321 msgid "Revision" msgstr "Revision" -#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:280 +#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:69 lib/option.tcl:287 msgid "Options" msgstr "Alternativ" -#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:92 +#: lib/branch_checkout.tcl:42 lib/branch_create.tcl:92 msgid "Fetch Tracking Branch" msgstr "Hämta spÃ¥rande gren" -#: lib/branch_checkout.tcl:44 +#: lib/branch_checkout.tcl:47 msgid "Detach From Local Branch" msgstr "Koppla bort frÃ¥n lokal gren" -#: lib/branch_create.tcl:22 +#: lib/branch_create.tcl:23 msgid "Create Branch" msgstr "Skapa gren" -#: lib/branch_create.tcl:27 +#: lib/branch_create.tcl:28 msgid "Create New Branch" msgstr "Skapa ny gren" -#: lib/branch_create.tcl:31 lib/choose_repository.tcl:381 +#: lib/branch_create.tcl:33 lib/choose_repository.tcl:389 msgid "Create" msgstr "Skapa" -#: lib/branch_create.tcl:40 +#: lib/branch_create.tcl:42 msgid "Branch Name" msgstr "Namn pÃ¥ gren" -#: lib/branch_create.tcl:43 lib/remote_add.tcl:39 lib/tools_dlg.tcl:50 +#: lib/branch_create.tcl:44 lib/remote_add.tcl:41 lib/tools_dlg.tcl:51 msgid "Name:" msgstr "Namn:" -#: lib/branch_create.tcl:58 +#: lib/branch_create.tcl:57 msgid "Match Tracking Branch Name" msgstr "Använd namn pÃ¥ spÃ¥rad gren" @@ -766,41 +766,41 @@ msgstr "Ã…terställ" msgid "Checkout After Creation" msgstr "Checka ut när skapad" -#: lib/branch_create.tcl:131 +#: lib/branch_create.tcl:132 msgid "Please select a tracking branch." msgstr "Välj en gren att spÃ¥ra." -#: lib/branch_create.tcl:140 +#: lib/branch_create.tcl:141 #, tcl-format msgid "Tracking branch %s is not a branch in the remote repository." msgstr "Den spÃ¥rade grenen %s är inte en gren i fjärrarkivet." -#: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 +#: lib/branch_create.tcl:154 lib/branch_rename.tcl:92 msgid "Please supply a branch name." msgstr "Ange ett namn för grenen." -#: lib/branch_create.tcl:164 lib/branch_rename.tcl:106 +#: lib/branch_create.tcl:165 lib/branch_rename.tcl:112 #, tcl-format msgid "'%s' is not an acceptable branch name." msgstr "\"%s\" kan inte användas som namn pÃ¥ grenen." -#: lib/branch_delete.tcl:15 +#: lib/branch_delete.tcl:16 msgid "Delete Branch" msgstr "Ta bort gren" -#: lib/branch_delete.tcl:20 +#: lib/branch_delete.tcl:21 msgid "Delete Local Branch" msgstr "Ta bort lokal gren" -#: lib/branch_delete.tcl:37 +#: lib/branch_delete.tcl:39 msgid "Local Branches" msgstr "Lokala grenar" -#: lib/branch_delete.tcl:52 +#: lib/branch_delete.tcl:51 msgid "Delete Only If Merged Into" msgstr "Ta bara bort om sammanslagen med" -#: lib/branch_delete.tcl:54 lib/remote_branch_delete.tcl:119 +#: lib/branch_delete.tcl:53 lib/remote_branch_delete.tcl:120 msgid "Always (Do not perform merge checks)" msgstr "Alltid (utför inte sammanslagningstest)" @@ -809,7 +809,7 @@ msgstr "Alltid (utför inte sammanslagningstest)" msgid "The following branches are not completely merged into %s:" msgstr "Följande grenar är inte till fullo sammanslagna med %s:" -#: lib/branch_delete.tcl:115 lib/remote_branch_delete.tcl:217 +#: lib/branch_delete.tcl:115 lib/remote_branch_delete.tcl:218 msgid "" "Recovering deleted branches is difficult.\n" "\n" @@ -828,32 +828,32 @@ msgstr "" "Kunde inte ta bort grenar:\n" "%s" -#: lib/branch_rename.tcl:14 lib/branch_rename.tcl:22 +#: lib/branch_rename.tcl:15 lib/branch_rename.tcl:23 msgid "Rename Branch" msgstr "Byt namn pÃ¥ gren" -#: lib/branch_rename.tcl:26 +#: lib/branch_rename.tcl:28 msgid "Rename" msgstr "Byt namn" -#: lib/branch_rename.tcl:36 +#: lib/branch_rename.tcl:38 msgid "Branch:" msgstr "Gren:" -#: lib/branch_rename.tcl:39 +#: lib/branch_rename.tcl:46 msgid "New Name:" msgstr "Nytt namn:" -#: lib/branch_rename.tcl:75 +#: lib/branch_rename.tcl:81 msgid "Please select a branch to rename." msgstr "Välj en gren att byta namn pÃ¥." -#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:202 +#: lib/branch_rename.tcl:102 lib/checkout_op.tcl:202 #, tcl-format msgid "Branch '%s' already exists." msgstr "Grenen \"%s\" finns redan." -#: lib/branch_rename.tcl:117 +#: lib/branch_rename.tcl:123 #, tcl-format msgid "Failed to rename '%s'." msgstr "Kunde inte byta namn pÃ¥ \"%s\"." @@ -862,7 +862,7 @@ msgstr "Kunde inte byta namn pÃ¥ \"%s\"." msgid "Starting..." msgstr "Startar..." -#: lib/browser.tcl:26 +#: lib/browser.tcl:27 msgid "File Browser" msgstr "Filbläddrare" @@ -875,13 +875,13 @@ msgstr "Läser %s..." msgid "[Up To Parent]" msgstr "[Upp till förälder]" -#: lib/browser.tcl:267 lib/browser.tcl:273 +#: lib/browser.tcl:269 lib/browser.tcl:276 msgid "Browse Branch Files" msgstr "Bläddra filer pÃ¥ grenen" -#: lib/browser.tcl:278 lib/choose_repository.tcl:398 -#: lib/choose_repository.tcl:486 lib/choose_repository.tcl:497 -#: lib/choose_repository.tcl:1028 +#: lib/browser.tcl:282 lib/choose_repository.tcl:404 +#: lib/choose_repository.tcl:491 lib/choose_repository.tcl:500 +#: lib/choose_repository.tcl:1027 msgid "Browse" msgstr "Bläddra" @@ -895,8 +895,8 @@ msgstr "Hämtar %s frÃ¥n %s" msgid "fatal: Cannot resolve %s" msgstr "ödesdigert: Kunde inte slÃ¥ upp %s" -#: lib/checkout_op.tcl:146 lib/console.tcl:81 lib/database.tcl:31 -#: lib/sshkey.tcl:53 +#: lib/checkout_op.tcl:146 lib/console.tcl:81 lib/database.tcl:30 +#: lib/sshkey.tcl:55 msgid "Close" msgstr "Stäng" @@ -1008,7 +1008,7 @@ msgstr "Det kanske inte är sÃ¥ enkelt att Ã¥terskapa förlorade incheckningar." msgid "Reset '%s'?" msgstr "Ã…terställa \"%s\"?" -#: lib/checkout_op.tcl:567 lib/merge.tcl:164 lib/tools_dlg.tcl:343 +#: lib/checkout_op.tcl:567 lib/merge.tcl:164 lib/tools_dlg.tcl:336 msgid "Visualize" msgstr "Visualisera" @@ -1029,23 +1029,23 @@ msgstr "" "\n" "Detta skulle inte ha hänt. %s kommer nu stängas och ge upp." -#: lib/choose_font.tcl:39 +#: lib/choose_font.tcl:41 msgid "Select" msgstr "Välj" -#: lib/choose_font.tcl:53 +#: lib/choose_font.tcl:55 msgid "Font Family" msgstr "Teckensnittsfamilj" -#: lib/choose_font.tcl:74 +#: lib/choose_font.tcl:76 msgid "Font Size" msgstr "Storlek" -#: lib/choose_font.tcl:91 +#: lib/choose_font.tcl:93 msgid "Font Example" msgstr "Exempel" -#: lib/choose_font.tcl:103 +#: lib/choose_font.tcl:105 msgid "" "This is example text.\n" "If you like this text, it can be your font." @@ -1057,7 +1057,7 @@ msgstr "" msgid "Git Gui" msgstr "Git Gui" -#: lib/choose_repository.tcl:87 lib/choose_repository.tcl:386 +#: lib/choose_repository.tcl:87 lib/choose_repository.tcl:394 msgid "Create New Repository" msgstr "Skapa nytt arkiv" @@ -1065,76 +1065,76 @@ msgstr "Skapa nytt arkiv" msgid "New..." msgstr "Nytt..." -#: lib/choose_repository.tcl:100 lib/choose_repository.tcl:471 +#: lib/choose_repository.tcl:100 lib/choose_repository.tcl:478 msgid "Clone Existing Repository" msgstr "Klona befintligt arkiv" -#: lib/choose_repository.tcl:106 +#: lib/choose_repository.tcl:111 msgid "Clone..." msgstr "Klona..." -#: lib/choose_repository.tcl:113 lib/choose_repository.tcl:1016 +#: lib/choose_repository.tcl:118 lib/choose_repository.tcl:1017 msgid "Open Existing Repository" msgstr "Öppna befintligt arkiv" -#: lib/choose_repository.tcl:119 +#: lib/choose_repository.tcl:124 msgid "Open..." msgstr "Öppna..." -#: lib/choose_repository.tcl:132 +#: lib/choose_repository.tcl:137 msgid "Recent Repositories" msgstr "Senaste arkiven" -#: lib/choose_repository.tcl:138 +#: lib/choose_repository.tcl:143 msgid "Open Recent Repository:" msgstr "Öppna tidigare arkiv:" -#: lib/choose_repository.tcl:306 lib/choose_repository.tcl:313 -#: lib/choose_repository.tcl:320 +#: lib/choose_repository.tcl:313 lib/choose_repository.tcl:320 +#: lib/choose_repository.tcl:327 #, tcl-format msgid "Failed to create repository %s:" msgstr "Kunde inte skapa arkivet %s:" -#: lib/choose_repository.tcl:391 +#: lib/choose_repository.tcl:399 msgid "Directory:" msgstr "Katalog:" -#: lib/choose_repository.tcl:423 lib/choose_repository.tcl:550 -#: lib/choose_repository.tcl:1052 +#: lib/choose_repository.tcl:429 lib/choose_repository.tcl:550 +#: lib/choose_repository.tcl:1051 msgid "Git Repository" msgstr "Gitarkiv" -#: lib/choose_repository.tcl:448 +#: lib/choose_repository.tcl:454 #, tcl-format msgid "Directory %s already exists." msgstr "Katalogen %s finns redan." -#: lib/choose_repository.tcl:452 +#: lib/choose_repository.tcl:458 #, tcl-format msgid "File %s already exists." msgstr "Filen %s finns redan." -#: lib/choose_repository.tcl:466 +#: lib/choose_repository.tcl:473 msgid "Clone" msgstr "Klona" -#: lib/choose_repository.tcl:479 +#: lib/choose_repository.tcl:486 msgid "Source Location:" msgstr "Plats för källkod:" -#: lib/choose_repository.tcl:490 +#: lib/choose_repository.tcl:495 msgid "Target Directory:" msgstr "MÃ¥lkatalog:" -#: lib/choose_repository.tcl:502 +#: lib/choose_repository.tcl:505 msgid "Clone Type:" msgstr "Typ av klon:" -#: lib/choose_repository.tcl:508 +#: lib/choose_repository.tcl:510 msgid "Standard (Fast, Semi-Redundant, Hardlinks)" msgstr "Standard (snabb, semiredundant, hÃ¥rda länkar)" -#: lib/choose_repository.tcl:514 +#: lib/choose_repository.tcl:515 msgid "Full Copy (Slower, Redundant Backup)" msgstr "Full kopia (lÃ¥ngsammare, redundant säkerhetskopia)" @@ -1144,7 +1144,7 @@ msgstr "Delad (snabbast, rekommenderas ej, ingen säkerhetskopia)" #: lib/choose_repository.tcl:556 lib/choose_repository.tcl:603 #: lib/choose_repository.tcl:749 lib/choose_repository.tcl:819 -#: lib/choose_repository.tcl:1058 lib/choose_repository.tcl:1066 +#: lib/choose_repository.tcl:1057 lib/choose_repository.tcl:1065 #, tcl-format msgid "Not a Git repository: %s" msgstr "Inte ett Gitarkiv: %s" @@ -1258,8 +1258,8 @@ msgstr "Kunde inte slÃ¥ upp %s till nÃ¥gon incheckning." msgid "Creating working directory" msgstr "Skapar arbetskatalog" -#: lib/choose_repository.tcl:939 lib/index.tcl:67 lib/index.tcl:130 -#: lib/index.tcl:198 +#: lib/choose_repository.tcl:939 lib/index.tcl:70 lib/index.tcl:133 +#: lib/index.tcl:201 msgid "files" msgstr "filer" @@ -1267,20 +1267,20 @@ msgstr "filer" msgid "Initial file checkout failed." msgstr "Inledande filutcheckning misslyckades." -#: lib/choose_repository.tcl:1011 +#: lib/choose_repository.tcl:1012 msgid "Open" msgstr "Öppna" -#: lib/choose_repository.tcl:1021 +#: lib/choose_repository.tcl:1022 msgid "Repository:" msgstr "Arkiv:" -#: lib/choose_repository.tcl:1072 +#: lib/choose_repository.tcl:1071 #, tcl-format msgid "Failed to open repository %s:" msgstr "Kunde inte öppna arkivet %s:" -#: lib/choose_rev.tcl:53 +#: lib/choose_rev.tcl:52 msgid "This Detached Checkout" msgstr "Denna frÃ¥nkopplade utcheckning" @@ -1288,36 +1288,36 @@ msgstr "Denna frÃ¥nkopplade utcheckning" msgid "Revision Expression:" msgstr "Revisionsuttryck:" -#: lib/choose_rev.tcl:74 +#: lib/choose_rev.tcl:72 msgid "Local Branch" msgstr "Lokal gren" -#: lib/choose_rev.tcl:79 +#: lib/choose_rev.tcl:77 msgid "Tracking Branch" msgstr "SpÃ¥rande gren" -#: lib/choose_rev.tcl:84 lib/choose_rev.tcl:538 +#: lib/choose_rev.tcl:82 lib/choose_rev.tcl:543 msgid "Tag" msgstr "Tagg" -#: lib/choose_rev.tcl:317 +#: lib/choose_rev.tcl:321 #, tcl-format msgid "Invalid revision: %s" msgstr "Ogiltig revision: %s" -#: lib/choose_rev.tcl:338 +#: lib/choose_rev.tcl:342 msgid "No revision selected." msgstr "Ingen revision vald." -#: lib/choose_rev.tcl:346 +#: lib/choose_rev.tcl:350 msgid "Revision expression is empty." msgstr "Revisionsuttrycket är tomt." -#: lib/choose_rev.tcl:531 +#: lib/choose_rev.tcl:536 msgid "Updated" msgstr "Uppdaterad" -#: lib/choose_rev.tcl:559 +#: lib/choose_rev.tcl:564 msgid "URL" msgstr "Webbadress" @@ -1508,31 +1508,31 @@ msgstr "Lyckades" msgid "Error: Command Failed" msgstr "Fel: Kommando misslyckades" -#: lib/database.tcl:43 +#: lib/database.tcl:42 msgid "Number of loose objects" msgstr "Antal lösa objekt" -#: lib/database.tcl:44 +#: lib/database.tcl:43 msgid "Disk space used by loose objects" msgstr "Diskutrymme använt av lösa objekt" -#: lib/database.tcl:45 +#: lib/database.tcl:44 msgid "Number of packed objects" msgstr "Antal packade objekt" -#: lib/database.tcl:46 +#: lib/database.tcl:45 msgid "Number of packs" msgstr "Antal paket" -#: lib/database.tcl:47 +#: lib/database.tcl:46 msgid "Disk space used by packed objects" msgstr "Diskutrymme använt av packade objekt" -#: lib/database.tcl:48 +#: lib/database.tcl:47 msgid "Packed objects waiting for pruning" msgstr "Packade objekt som väntar pÃ¥ städning" -#: lib/database.tcl:49 +#: lib/database.tcl:48 msgid "Garbage files" msgstr "Skräpfiler" @@ -1618,7 +1618,7 @@ msgstr "LOKAL:\n" msgid "REMOTE:\n" msgstr "FJÄRR:\n" -#: lib/diff.tcl:202 lib/diff.tcl:319 +#: lib/diff.tcl:202 lib/diff.tcl:322 #, tcl-format msgid "Unable to display %s" msgstr "Kan inte visa %s" @@ -1655,19 +1655,19 @@ msgstr "" "* Den ospÃ¥rade filen klipptes här av %s.\n" "* För att se hela filen, använd ett externt redigeringsprogram.\n" -#: lib/diff.tcl:482 +#: lib/diff.tcl:485 msgid "Failed to unstage selected hunk." msgstr "Kunde inte ta bort den valda delen frÃ¥n kön." -#: lib/diff.tcl:489 +#: lib/diff.tcl:492 msgid "Failed to stage selected hunk." msgstr "Kunde inte lägga till den valda delen till kön." -#: lib/diff.tcl:568 +#: lib/diff.tcl:571 msgid "Failed to unstage selected line." msgstr "Kunde inte ta bort den valda raden frÃ¥n kön." -#: lib/diff.tcl:576 +#: lib/diff.tcl:579 msgid "Failed to stage selected line." msgstr "Kunde inte lägga till den valda raden till kön." @@ -1684,7 +1684,7 @@ msgstr "Systemets (%s)" msgid "Other" msgstr "Annan" -#: lib/error.tcl:20 lib/error.tcl:114 +#: lib/error.tcl:20 lib/error.tcl:116 msgid "error" msgstr "fel" @@ -1692,7 +1692,7 @@ msgstr "fel" msgid "warning" msgstr "varning" -#: lib/error.tcl:94 +#: lib/error.tcl:96 msgid "You must correct the above errors before committing." msgstr "Du mÃ¥ste rätta till felen ovan innan du checkar in." @@ -1700,11 +1700,11 @@ msgstr "Du mÃ¥ste rätta till felen ovan innan du checkar in." msgid "Unable to unlock the index." msgstr "Kunde inte lÃ¥sa upp indexet." -#: lib/index.tcl:15 +#: lib/index.tcl:17 msgid "Index Error" msgstr "Indexfel" -#: lib/index.tcl:17 +#: lib/index.tcl:19 msgid "" "Updating the Git index failed. A rescan will be automatically started to " "resynchronize git-gui." @@ -1712,52 +1712,52 @@ msgstr "" "Misslyckades med att uppdatera Gitindexet. En omsökning kommer att startas " "automatiskt för att synkronisera om git-gui." -#: lib/index.tcl:28 +#: lib/index.tcl:30 msgid "Continue" msgstr "Forstätt" -#: lib/index.tcl:31 +#: lib/index.tcl:33 msgid "Unlock Index" msgstr "LÃ¥s upp index" -#: lib/index.tcl:289 +#: lib/index.tcl:292 #, tcl-format msgid "Unstaging %s from commit" msgstr "Tar bort %s för incheckningskön" -#: lib/index.tcl:328 +#: lib/index.tcl:331 msgid "Ready to commit." msgstr "Redo att checka in." -#: lib/index.tcl:341 +#: lib/index.tcl:344 #, tcl-format msgid "Adding %s" msgstr "Lägger till %s" -#: lib/index.tcl:398 +#: lib/index.tcl:401 #, tcl-format msgid "Revert changes in file %s?" msgstr "Ã…terställ ändringarna i filen %s?" -#: lib/index.tcl:400 +#: lib/index.tcl:403 #, tcl-format msgid "Revert changes in these %i files?" msgstr "Ã…terställ ändringarna i dessa %i filer?" -#: lib/index.tcl:408 +#: lib/index.tcl:411 msgid "Any unstaged changes will be permanently lost by the revert." msgstr "" "Alla oköade ändringar kommer permanent gÃ¥ förlorade vid Ã¥terställningen." -#: lib/index.tcl:411 +#: lib/index.tcl:414 msgid "Do Nothing" msgstr "Gör ingenting" -#: lib/index.tcl:429 +#: lib/index.tcl:432 msgid "Reverting selected files" msgstr "Ã…terställer valda filer" -#: lib/index.tcl:433 +#: lib/index.tcl:436 #, tcl-format msgid "Reverting %s" msgstr "Ã…terställer %s" @@ -2004,145 +2004,133 @@ msgstr "Den globala teckenkodningen \"%s\" är ogiltig" msgid "Invalid repo encoding '%s'" msgstr "Arkivets teckenkodning \"%s\" är ogiltig" -#: lib/option.tcl:117 +#: lib/option.tcl:119 msgid "Restore Defaults" msgstr "Ã…terställ standardvärden" -#: lib/option.tcl:121 +#: lib/option.tcl:123 msgid "Save" msgstr "Spara" -#: lib/option.tcl:131 +#: lib/option.tcl:133 #, tcl-format msgid "%s Repository" msgstr "Arkivet %s" -#: lib/option.tcl:132 +#: lib/option.tcl:134 msgid "Global (All Repositories)" msgstr "Globalt (alla arkiv)" -#: lib/option.tcl:138 +#: lib/option.tcl:140 msgid "User Name" msgstr "Användarnamn" -#: lib/option.tcl:139 +#: lib/option.tcl:141 msgid "Email Address" msgstr "E-postadress" -#: lib/option.tcl:141 +#: lib/option.tcl:143 msgid "Summarize Merge Commits" msgstr "Summera sammanslagningsincheckningar" -#: lib/option.tcl:142 +#: lib/option.tcl:144 msgid "Merge Verbosity" msgstr "Pratsamhet för sammanslagningar" -#: lib/option.tcl:143 +#: lib/option.tcl:145 msgid "Show Diffstat After Merge" msgstr "Visa diffstatistik efter sammanslagning" -#: lib/option.tcl:144 +#: lib/option.tcl:146 msgid "Use Merge Tool" msgstr "Använd verktyg för sammanslagning" -#: lib/option.tcl:146 +#: lib/option.tcl:148 msgid "Trust File Modification Timestamps" msgstr "Lita pÃ¥ filändringstidsstämplar" -#: lib/option.tcl:147 +#: lib/option.tcl:149 msgid "Prune Tracking Branches During Fetch" msgstr "Städa spÃ¥rade grenar vid hämtning" -#: lib/option.tcl:148 +#: lib/option.tcl:150 msgid "Match Tracking Branches" msgstr "Matcha spÃ¥rade grenar" -#: lib/option.tcl:149 +#: lib/option.tcl:151 +msgid "Use Textconv For Diffs and Blames" +msgstr "Använd Textconv för diff och klandring" + +#: lib/option.tcl:152 msgid "Blame Copy Only On Changed Files" msgstr "Klandra kopiering bara i ändrade filer" -#: lib/option.tcl:150 +#: lib/option.tcl:153 msgid "Minimum Letters To Blame Copy On" msgstr "Minsta antal tecken att klandra kopiering för" -#: lib/option.tcl:151 +#: lib/option.tcl:154 msgid "Blame History Context Radius (days)" msgstr "Historikradie för klandring (dagar)" -#: lib/option.tcl:152 +#: lib/option.tcl:155 msgid "Number of Diff Context Lines" msgstr "Antal rader sammanhang i differenser" -#: lib/option.tcl:153 +#: lib/option.tcl:156 msgid "Commit Message Text Width" msgstr "Textbredd för incheckningsmeddelande" -#: lib/option.tcl:154 +#: lib/option.tcl:157 msgid "New Branch Name Template" msgstr "Mall för namn pÃ¥ nya grenar" -#: lib/option.tcl:155 +#: lib/option.tcl:158 msgid "Default File Contents Encoding" msgstr "Standardteckenkodning för filinnehÃ¥ll" -#: lib/option.tcl:203 +#: lib/option.tcl:204 msgid "Change" msgstr "Ändra" -#: lib/option.tcl:230 +#: lib/option.tcl:231 msgid "Spelling Dictionary:" msgstr "Stavningsordlista:" -#: lib/option.tcl:254 +#: lib/option.tcl:261 msgid "Change Font" msgstr "Byt teckensnitt" -#: lib/option.tcl:258 +#: lib/option.tcl:265 #, tcl-format msgid "Choose %s" msgstr "Välj %s" -#: lib/option.tcl:264 +#: lib/option.tcl:271 msgid "pt." msgstr "p." -#: lib/option.tcl:278 +#: lib/option.tcl:285 msgid "Preferences" msgstr "Inställningar" -#: lib/option.tcl:314 +#: lib/option.tcl:322 msgid "Failed to completely save options:" msgstr "Misslyckades med att helt spara alternativ:" -#: lib/remote.tcl:163 -msgid "Remove Remote" -msgstr "Ta bort fjärrarkiv" - -#: lib/remote.tcl:168 -msgid "Prune from" -msgstr "Ta bort frÃ¥n" - -#: lib/remote.tcl:173 -msgid "Fetch from" -msgstr "Hämta frÃ¥n" - -#: lib/remote.tcl:215 -msgid "Push to" -msgstr "Sänd till" - -#: lib/remote_add.tcl:19 +#: lib/remote_add.tcl:20 msgid "Add Remote" msgstr "Lägg till fjärrarkiv" -#: lib/remote_add.tcl:24 +#: lib/remote_add.tcl:25 msgid "Add New Remote" msgstr "Lägg till nytt fjärrarkiv" -#: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36 +#: lib/remote_add.tcl:30 lib/tools_dlg.tcl:37 msgid "Add" msgstr "Lägg till" -#: lib/remote_add.tcl:37 +#: lib/remote_add.tcl:39 msgid "Remote Details" msgstr "Detaljer för fjärrarkiv" @@ -2150,58 +2138,58 @@ msgstr "Detaljer för fjärrarkiv" msgid "Location:" msgstr "Plats:" -#: lib/remote_add.tcl:62 +#: lib/remote_add.tcl:60 msgid "Further Action" msgstr "Ytterligare Ã¥tgärd" -#: lib/remote_add.tcl:65 +#: lib/remote_add.tcl:63 msgid "Fetch Immediately" msgstr "Hämta omedelbart" -#: lib/remote_add.tcl:71 +#: lib/remote_add.tcl:69 msgid "Initialize Remote Repository and Push" msgstr "Initiera fjärrarkiv och sänd till" -#: lib/remote_add.tcl:77 +#: lib/remote_add.tcl:75 msgid "Do Nothing Else Now" msgstr "Gör ingent mer nu" -#: lib/remote_add.tcl:101 +#: lib/remote_add.tcl:100 msgid "Please supply a remote name." msgstr "Ange ett namn för fjärrarkivet." -#: lib/remote_add.tcl:114 +#: lib/remote_add.tcl:113 #, tcl-format msgid "'%s' is not an acceptable remote name." msgstr "\"%s\" kan inte användas som namn pÃ¥ fjärrarkivet." -#: lib/remote_add.tcl:125 +#: lib/remote_add.tcl:124 #, tcl-format msgid "Failed to add remote '%s' of location '%s'." msgstr "Kunde inte lägga till fjärrarkivet \"%s\" pÃ¥ platsen \"%s\"." -#: lib/remote_add.tcl:133 lib/transport.tcl:6 +#: lib/remote_add.tcl:132 lib/transport.tcl:6 #, tcl-format msgid "fetch %s" msgstr "hämta %s" -#: lib/remote_add.tcl:134 +#: lib/remote_add.tcl:133 #, tcl-format msgid "Fetching the %s" msgstr "Hämtar %s" -#: lib/remote_add.tcl:157 +#: lib/remote_add.tcl:156 #, tcl-format msgid "Do not know how to initialize repository at location '%s'." msgstr "Vet inte hur arkivet pÃ¥ platsen \"%s\" skall initieras." -#: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:63 +#: lib/remote_add.tcl:162 lib/transport.tcl:25 lib/transport.tcl:63 #: lib/transport.tcl:81 #, tcl-format msgid "push %s" msgstr "sänd %s" -#: lib/remote_add.tcl:164 +#: lib/remote_add.tcl:163 #, tcl-format msgid "Setting up the %s (at %s)" msgstr "Konfigurerar %s (pÃ¥ %s)" @@ -2210,35 +2198,35 @@ msgstr "Konfigurerar %s (pÃ¥ %s)" msgid "Delete Branch Remotely" msgstr "Ta bort gren frÃ¥n fjärrarkiv" -#: lib/remote_branch_delete.tcl:47 +#: lib/remote_branch_delete.tcl:48 msgid "From Repository" msgstr "FrÃ¥n arkiv" -#: lib/remote_branch_delete.tcl:50 lib/transport.tcl:134 +#: lib/remote_branch_delete.tcl:51 lib/transport.tcl:134 msgid "Remote:" msgstr "Fjärrarkiv:" -#: lib/remote_branch_delete.tcl:66 lib/transport.tcl:149 +#: lib/remote_branch_delete.tcl:72 lib/transport.tcl:154 msgid "Arbitrary Location:" msgstr "Godtycklig plats:" -#: lib/remote_branch_delete.tcl:84 +#: lib/remote_branch_delete.tcl:88 msgid "Branches" msgstr "Grenar" -#: lib/remote_branch_delete.tcl:109 +#: lib/remote_branch_delete.tcl:110 msgid "Delete Only If" msgstr "Ta endast bort om" -#: lib/remote_branch_delete.tcl:111 +#: lib/remote_branch_delete.tcl:112 msgid "Merged Into:" msgstr "Sammanslagen i:" -#: lib/remote_branch_delete.tcl:152 +#: lib/remote_branch_delete.tcl:153 msgid "A branch is required for 'Merged Into'." msgstr "En gren krävs för \"Sammanslagen i\"." -#: lib/remote_branch_delete.tcl:184 +#: lib/remote_branch_delete.tcl:185 #, tcl-format msgid "" "The following branches are not completely merged into %s:\n" @@ -2249,7 +2237,7 @@ msgstr "" "\n" " - %s" -#: lib/remote_branch_delete.tcl:189 +#: lib/remote_branch_delete.tcl:190 #, tcl-format msgid "" "One or more of the merge tests failed because you have not fetched the " @@ -2258,37 +2246,53 @@ msgstr "" "En eller flera av sammanslagningstesterna misslyckades eftersom du inte har " "hämtat de nödvändiga incheckningarna. Försök hämta frÃ¥n %s först." -#: lib/remote_branch_delete.tcl:207 +#: lib/remote_branch_delete.tcl:208 msgid "Please select one or more branches to delete." msgstr "Välj en eller flera grenar att ta bort." -#: lib/remote_branch_delete.tcl:226 +#: lib/remote_branch_delete.tcl:227 #, tcl-format msgid "Deleting branches from %s" msgstr "Tar bort grenar frÃ¥n %s" -#: lib/remote_branch_delete.tcl:292 +#: lib/remote_branch_delete.tcl:293 msgid "No repository selected." msgstr "Inget arkiv markerat." -#: lib/remote_branch_delete.tcl:297 +#: lib/remote_branch_delete.tcl:298 #, tcl-format msgid "Scanning %s..." msgstr "Söker %s..." -#: lib/search.tcl:21 +#: lib/remote.tcl:163 +msgid "Remove Remote" +msgstr "Ta bort fjärrarkiv" + +#: lib/remote.tcl:168 +msgid "Prune from" +msgstr "Ta bort frÃ¥n" + +#: lib/remote.tcl:173 +msgid "Fetch from" +msgstr "Hämta frÃ¥n" + +#: lib/remote.tcl:215 +msgid "Push to" +msgstr "Sänd till" + +#: lib/search.tcl:22 msgid "Find:" msgstr "Sök:" -#: lib/search.tcl:23 +#: lib/search.tcl:24 msgid "Next" msgstr "Nästa" -#: lib/search.tcl:24 +#: lib/search.tcl:25 msgid "Prev" msgstr "Föreg" -#: lib/search.tcl:25 +#: lib/search.tcl:26 msgid "Case-Sensitive" msgstr "Skilj pÃ¥ VERSALER/gemener" @@ -2350,19 +2354,19 @@ msgstr "Hittade öppen nyckel i: %s" msgid "Generate Key" msgstr "Skapa nyckel" -#: lib/sshkey.tcl:56 +#: lib/sshkey.tcl:58 msgid "Copy To Clipboard" msgstr "Kopiera till Urklipp" -#: lib/sshkey.tcl:70 +#: lib/sshkey.tcl:72 msgid "Your OpenSSH Public Key" msgstr "Din öppna OpenSSH-nyckel" -#: lib/sshkey.tcl:78 +#: lib/sshkey.tcl:80 msgid "Generating..." msgstr "Skapar..." -#: lib/sshkey.tcl:84 +#: lib/sshkey.tcl:86 #, tcl-format msgid "" "Could not start ssh-keygen:\n" @@ -2373,54 +2377,24 @@ msgstr "" "\n" "%s" -#: lib/sshkey.tcl:111 +#: lib/sshkey.tcl:113 msgid "Generation failed." msgstr "Misslyckades med att skapa." -#: lib/sshkey.tcl:118 +#: lib/sshkey.tcl:120 msgid "Generation succeded, but no keys found." msgstr "Lyckades skapa nyckeln, men hittar inte nÃ¥gon nyckel." -#: lib/sshkey.tcl:121 +#: lib/sshkey.tcl:123 #, tcl-format msgid "Your key is in: %s" msgstr "Din nyckel finns i: %s" -#: lib/status_bar.tcl:83 +#: lib/status_bar.tcl:86 #, tcl-format msgid "%s ... %*i of %*i %s (%3i%%)" msgstr "%s... %*i av %*i %s (%3i%%)" -#: lib/tools.tcl:75 -#, tcl-format -msgid "Running %s requires a selected file." -msgstr "För att starta %s mÃ¥ste du välja en fil." - -#: lib/tools.tcl:90 -#, tcl-format -msgid "Are you sure you want to run %s?" -msgstr "Är du säker pÃ¥ att du vill starta %s?" - -#: lib/tools.tcl:110 -#, tcl-format -msgid "Tool: %s" -msgstr "Verktyg: %s" - -#: lib/tools.tcl:111 -#, tcl-format -msgid "Running: %s" -msgstr "Exekverar: %s" - -#: lib/tools.tcl:149 -#, tcl-format -msgid "Tool completed successfully: %s" -msgstr "Verktyget avslutades framgÃ¥ngsrikt: %s" - -#: lib/tools.tcl:151 -#, tcl-format -msgid "Tool failed: %s" -msgstr "Verktyget misslyckades: %s" - #: lib/tools_dlg.tcl:22 msgid "Add Tool" msgstr "Lägg till verktyg" @@ -2429,52 +2403,52 @@ msgstr "Lägg till verktyg" msgid "Add New Tool Command" msgstr "Lägg till nytt verktygskommando" -#: lib/tools_dlg.tcl:33 +#: lib/tools_dlg.tcl:34 msgid "Add globally" msgstr "Lägg till globalt" -#: lib/tools_dlg.tcl:45 +#: lib/tools_dlg.tcl:46 msgid "Tool Details" msgstr "Detaljer för verktyg" -#: lib/tools_dlg.tcl:48 +#: lib/tools_dlg.tcl:49 msgid "Use '/' separators to create a submenu tree:" msgstr "Använd \"/\"-avdelare för att skapa ett undermenyträd:" -#: lib/tools_dlg.tcl:61 +#: lib/tools_dlg.tcl:60 msgid "Command:" msgstr "Kommando:" -#: lib/tools_dlg.tcl:74 +#: lib/tools_dlg.tcl:71 msgid "Show a dialog before running" msgstr "Visa dialog innan programmet startas" -#: lib/tools_dlg.tcl:80 +#: lib/tools_dlg.tcl:77 msgid "Ask the user to select a revision (sets $REVISION)" msgstr "Be användaren välja en version (sätter $REVISION)" -#: lib/tools_dlg.tcl:85 +#: lib/tools_dlg.tcl:82 msgid "Ask the user for additional arguments (sets $ARGS)" msgstr "Be användaren om ytterligare parametrar (sätter $ARGS)" -#: lib/tools_dlg.tcl:92 +#: lib/tools_dlg.tcl:89 msgid "Don't show the command output window" msgstr "Visa inte kommandots utdatafönster" -#: lib/tools_dlg.tcl:97 +#: lib/tools_dlg.tcl:94 msgid "Run only if a diff is selected ($FILENAME not empty)" msgstr "Kör endast om en diff har markerats ($FILENAME är inte tomt)" -#: lib/tools_dlg.tcl:121 +#: lib/tools_dlg.tcl:118 msgid "Please supply a name for the tool." msgstr "Ange ett namn för verktyget." -#: lib/tools_dlg.tcl:129 +#: lib/tools_dlg.tcl:126 #, tcl-format msgid "Tool '%s' already exists." msgstr "Verktyget \"%s\" finns redan." -#: lib/tools_dlg.tcl:151 +#: lib/tools_dlg.tcl:148 #, tcl-format msgid "" "Could not add tool:\n" @@ -2483,35 +2457,65 @@ msgstr "" "Kunde inte lägga till verktyget:\n" "%s" -#: lib/tools_dlg.tcl:190 +#: lib/tools_dlg.tcl:187 msgid "Remove Tool" msgstr "Ta bort verktyg" -#: lib/tools_dlg.tcl:196 +#: lib/tools_dlg.tcl:193 msgid "Remove Tool Commands" msgstr "Ta bort verktygskommandon" -#: lib/tools_dlg.tcl:200 +#: lib/tools_dlg.tcl:198 msgid "Remove" msgstr "Ta bort" -#: lib/tools_dlg.tcl:236 +#: lib/tools_dlg.tcl:231 msgid "(Blue denotes repository-local tools)" msgstr "(BlÃ¥tt anger verktyg lokala för arkivet)" -#: lib/tools_dlg.tcl:297 +#: lib/tools_dlg.tcl:292 #, tcl-format msgid "Run Command: %s" msgstr "Kör kommandot: %s" -#: lib/tools_dlg.tcl:311 +#: lib/tools_dlg.tcl:306 msgid "Arguments" msgstr "Argument" -#: lib/tools_dlg.tcl:348 +#: lib/tools_dlg.tcl:341 msgid "OK" msgstr "OK" +#: lib/tools.tcl:75 +#, tcl-format +msgid "Running %s requires a selected file." +msgstr "För att starta %s mÃ¥ste du välja en fil." + +#: lib/tools.tcl:90 +#, tcl-format +msgid "Are you sure you want to run %s?" +msgstr "Är du säker pÃ¥ att du vill starta %s?" + +#: lib/tools.tcl:110 +#, tcl-format +msgid "Tool: %s" +msgstr "Verktyg: %s" + +#: lib/tools.tcl:111 +#, tcl-format +msgid "Running: %s" +msgstr "Exekverar: %s" + +#: lib/tools.tcl:149 +#, tcl-format +msgid "Tool completed successfully: %s" +msgstr "Verktyget avslutades framgÃ¥ngsrikt: %s" + +#: lib/tools.tcl:151 +#, tcl-format +msgid "Tool failed: %s" +msgstr "Verktyget misslyckades: %s" + #: lib/transport.tcl:7 #, tcl-format msgid "Fetching new changes from %s" @@ -2542,11 +2546,11 @@ msgstr "Speglar till %s" msgid "Pushing %s %s to %s" msgstr "Sänder %s %s till %s" -#: lib/transport.tcl:100 +#: lib/transport.tcl:102 msgid "Push Branches" msgstr "Sänd grenar" -#: lib/transport.tcl:114 +#: lib/transport.tcl:117 msgid "Source Branches" msgstr "Källgrenar" @@ -2554,19 +2558,19 @@ msgstr "Källgrenar" msgid "Destination Repository" msgstr "Destinationsarkiv" -#: lib/transport.tcl:169 +#: lib/transport.tcl:172 msgid "Transfer Options" msgstr "Överföringsalternativ" -#: lib/transport.tcl:171 +#: lib/transport.tcl:174 msgid "Force overwrite existing branch (may discard changes)" msgstr "Tvinga överskrivning av befintlig gren (kan kasta bort ändringar)" -#: lib/transport.tcl:175 +#: lib/transport.tcl:178 msgid "Use thin pack (for slow network connections)" msgstr "Använd tunt paket (för lÃ¥ngsamma nätverksanslutningar)" -#: lib/transport.tcl:179 +#: lib/transport.tcl:182 msgid "Include tags" msgstr "Ta med taggar" diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index eb2dff55f8..a27952d9fd 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -626,7 +626,7 @@ skip_unnecessary_picks () { case "$fd,$command" in 3,pick|3,p) # pick a commit whose parent is current $ONTO -> skip - sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1) + sha1=${rest%% *} case "$(git rev-parse --verify --quiet "$sha1"^)" in "$ONTO"*) ONTO=$sha1 diff --git a/git-rebase.sh b/git-rebase.sh index 7508463b30..3335cee70b 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -566,6 +566,7 @@ fi if test -z "$do_merge" then git format-patch -k --stdout --full-index --ignore-if-in-upstream \ + --src-prefix=a/ --dst-prefix=b/ \ --no-renames $root_flag "$revisions" | git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" && move_to_original_branch diff --git a/git-send-email.perl b/git-send-email.perl index 6dab3bf6a7..e1f29a72a1 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -895,7 +895,7 @@ sub sanitize_address { sub valid_fqdn { my $domain = shift; - return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./; + return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./; } sub maildomain_net { diff --git a/git-stash.sh b/git-stash.sh index 7ce818bd1b..5fb1245ea7 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -265,28 +265,21 @@ parse_flags_and_rev() i_tree= REV=$(git rev-parse --no-flags --symbolic "$@" 2>/dev/null) - FLAGS=$(git rev-parse --no-revs -- "$@" 2>/dev/null) - - set -- $FLAGS FLAGS= - while test $# -ne 0 + for opt do - case "$1" in + case "$opt" in -q|--quiet) GIT_QUIET=-t ;; --index) INDEX_OPTION=--index ;; - --) - : - ;; - *) - FLAGS="${FLAGS}${FLAGS:+ }$1" + -*) + FLAGS="${FLAGS}${FLAGS:+ }$opt" ;; esac - shift done set -- $REV @@ -439,9 +432,9 @@ apply_to_branch () { assert_stash_like "$@" git checkout -b $branch $REV^ && - apply_stash "$@" - - test -z "$IS_STASH_REF" || drop_stash "$@" + apply_stash "$@" && { + test -z "$IS_STASH_REF" || drop_stash "$@" + } } PARSE_CACHE='--not-parsed' diff --git a/merge-recursive.c b/merge-recursive.c index 20e1779428..c574698819 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -955,6 +955,12 @@ static int process_renames(struct merge_options *o, ren1->pair->two : NULL, branch1 == o->branch1 ? NULL : ren1->pair->two, 1); + } else if ((dst_other.mode == ren1->pair->two->mode) && + sha_eq(dst_other.sha1, ren1->pair->two->sha1)) { + /* Added file on the other side + identical to the file being + renamed: clean merge */ + update_file(o, 1, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst); } else if (!sha_eq(dst_other.sha1, null_sha1)) { const char *new_path; clean_merge = 0; diff --git a/sha1_name.c b/sha1_name.c index 7b7e61719f..484081de82 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -1062,6 +1062,7 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1, /* sha1:path --> object name of path in ent sha1 * :path -> object name of path in index * :[0-3]:path -> object name of path in index at stage + * :/foo -> recent commit matching foo */ if (name[0] == ':') { int stage = 0; @@ -2,6 +2,10 @@ #include "quote.h" #include "exec_cmd.h" #include "strbuf.h" +#include "run-command.h" + +#define COMMAND_DIR "git-shell-commands" +#define HELP_COMMAND COMMAND_DIR "/help" static int do_generic_cmd(const char *me, char *arg) { @@ -33,6 +37,86 @@ static int do_cvs_cmd(const char *me, char *arg) return execv_git_cmd(cvsserver_argv); } +static int is_valid_cmd_name(const char *cmd) +{ + /* Test command contains no . or / characters */ + return cmd[strcspn(cmd, "./")] == '\0'; +} + +static char *make_cmd(const char *prog) +{ + char *prefix = xmalloc((strlen(prog) + strlen(COMMAND_DIR) + 2)); + strcpy(prefix, COMMAND_DIR); + strcat(prefix, "/"); + strcat(prefix, prog); + return prefix; +} + +static void cd_to_homedir(void) +{ + const char *home = getenv("HOME"); + if (!home) + die("could not determine user's home directory; HOME is unset"); + if (chdir(home) == -1) + die("could not chdir to user's home directory"); +} + +static void run_shell(void) +{ + int done = 0; + static const char *help_argv[] = { HELP_COMMAND, NULL }; + /* Print help if enabled */ + run_command_v_opt(help_argv, RUN_SILENT_EXEC_FAILURE); + + do { + struct strbuf line = STRBUF_INIT; + const char *prog; + char *full_cmd; + char *rawargs; + char *split_args; + const char **argv; + int code; + int count; + + fprintf(stderr, "git> "); + if (strbuf_getline(&line, stdin, '\n') == EOF) { + fprintf(stderr, "\n"); + strbuf_release(&line); + break; + } + strbuf_trim(&line); + rawargs = strbuf_detach(&line, NULL); + split_args = xstrdup(rawargs); + count = split_cmdline(split_args, &argv); + if (count < 0) { + fprintf(stderr, "invalid command format '%s': %s\n", rawargs, + split_cmdline_strerror(count)); + free(split_args); + free(rawargs); + continue; + } + + prog = argv[0]; + if (!strcmp(prog, "")) { + } else if (!strcmp(prog, "quit") || !strcmp(prog, "logout") || + !strcmp(prog, "exit") || !strcmp(prog, "bye")) { + done = 1; + } else if (is_valid_cmd_name(prog)) { + full_cmd = make_cmd(prog); + argv[0] = full_cmd; + code = run_command_v_opt(argv, RUN_SILENT_EXEC_FAILURE); + if (code == -1 && errno == ENOENT) { + fprintf(stderr, "unrecognized command '%s'\n", prog); + } + free(full_cmd); + } else { + fprintf(stderr, "invalid command format '%s'\n", prog); + } + + free(argv); + free(rawargs); + } while (!done); +} static struct commands { const char *name; @@ -48,8 +132,10 @@ static struct commands { int main(int argc, char **argv) { char *prog; + const char **user_argv; struct commands *cmd; int devnull_fd; + int count; /* * Always open file descriptors 0/1/2 to avoid clobbering files @@ -66,17 +152,28 @@ int main(int argc, char **argv) /* * Special hack to pretend to be a CVS server */ - if (argc == 2 && !strcmp(argv[1], "cvs server")) + if (argc == 2 && !strcmp(argv[1], "cvs server")) { argv--; + } else if (argc == 1) { + /* Allow the user to run an interactive shell */ + cd_to_homedir(); + if (access(COMMAND_DIR, R_OK | X_OK) == -1) { + die("Interactive git shell is not enabled.\n" + "hint: ~/" COMMAND_DIR " should exist " + "and have read and execute access."); + } + run_shell(); + exit(0); + } else if (argc != 3 || strcmp(argv[1], "-c")) { + /* + * We do not accept any other modes except "-c" followed by + * "cmd arg", where "cmd" is a very limited subset of git + * commands or a command in the COMMAND_DIR + */ + die("Run with no arguments or with -c cmd"); + } - /* - * We do not accept anything but "-c" followed by "cmd arg", - * where "cmd" is a very limited subset of git commands. - */ - else if (argc != 3 || strcmp(argv[1], "-c")) - die("What do you think I am? A shell?"); - - prog = argv[2]; + prog = xstrdup(argv[2]); if (!strncmp(prog, "git", 3) && isspace(prog[3])) /* Accept "git foo" as if the caller said "git-foo". */ prog[3] = '-'; @@ -99,5 +196,21 @@ int main(int argc, char **argv) } exit(cmd->exec(cmd->name, arg)); } - die("unrecognized command '%s'", prog); + + cd_to_homedir(); + count = split_cmdline(prog, &user_argv); + if (count >= 0) { + if (is_valid_cmd_name(user_argv[0])) { + prog = make_cmd(user_argv[0]); + user_argv[0] = prog; + execv(user_argv[0], (char *const *) user_argv); + } + free(prog); + free(user_argv); + die("unrecognized command '%s'", argv[2]); + } else { + free(prog); + die("invalid command format '%s': %s", argv[2], + split_cmdline_strerror(count)); + } } @@ -16,7 +16,7 @@ * * 2. the ->buf member is a byte array that has at least ->len + 1 bytes * allocated. The extra byte is used to store a '\0', allowing the ->buf - * member to be a valid C-string. Every strbuf function ensure this + * member to be a valid C-string. Every strbuf function ensures this * invariant is preserved. * * Note that it is OK to "play" with the buffer directly if you work it diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index de38c7f7aa..25205ac0ee 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -36,6 +36,9 @@ test_expect_success 'setup' ' echo "d/* test=a/b/d/*" echo "d/yes notest" ) >a/b/.gitattributes + ( + echo "global test=global" + ) >$HOME/global-gitattributes ' @@ -57,6 +60,16 @@ test_expect_success 'attribute test' ' ' +test_expect_success 'core.attributesfile' ' + attr_check global unspecified && + git config core.attributesfile "$HOME/global-gitattributes" && + attr_check global global && + git config core.attributesfile "~/global-gitattributes" && + attr_check global global && + echo "global test=precedence" >> .gitattributes && + attr_check global precedence +' + test_expect_success 'attribute test: read paths from stdin' ' cat <<EOF > expect diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 56874996a6..a3ac33801a 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -16,24 +16,23 @@ test_expect_success setup ' cp one original.one && cp dir/two original.two ' -HERE=`pwd` LF=' ' test_expect_success 'update-index and ls-files' ' - cd "$HERE" && git update-index --add one && case "`git ls-files`" in one) echo pass one ;; *) echo bad one; exit 1 ;; esac && - cd dir && - git update-index --add two && - case "`git ls-files`" in - two) echo pass two ;; - *) echo bad two; exit 1 ;; - esac && - cd .. && + ( + cd dir && + git update-index --add two && + case "`git ls-files`" in + two) echo pass two ;; + *) echo bad two; exit 1 ;; + esac + ) && case "`git ls-files`" in dir/two"$LF"one) echo pass both ;; *) echo bad; exit 1 ;; @@ -41,20 +40,20 @@ test_expect_success 'update-index and ls-files' ' ' test_expect_success 'cat-file' ' - cd "$HERE" && two=`git ls-files -s dir/two` && two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` && echo "$two" && git cat-file -p "$two" >actual && cmp dir/two actual && - cd dir && - git cat-file -p "$two" >actual && - cmp two actual + ( + cd dir && + git cat-file -p "$two" >actual && + cmp two actual + ) ' rm -f actual dir/actual test_expect_success 'diff-files' ' - cd "$HERE" && echo a >>one && echo d >>dir/two && case "`git diff-files --name-only`" in @@ -62,77 +61,88 @@ test_expect_success 'diff-files' ' *) echo bad top; exit 1 ;; esac && # diff should not omit leading paths - cd dir && - case "`git diff-files --name-only`" in - dir/two"$LF"one) echo pass subdir ;; - *) echo bad subdir; exit 1 ;; - esac && - case "`git diff-files --name-only .`" in - dir/two) echo pass subdir limited ;; - *) echo bad subdir limited; exit 1 ;; - esac + ( + cd dir && + case "`git diff-files --name-only`" in + dir/two"$LF"one) echo pass subdir ;; + *) echo bad subdir; exit 1 ;; + esac && + case "`git diff-files --name-only .`" in + dir/two) echo pass subdir limited ;; + *) echo bad subdir limited; exit 1 ;; + esac + ) ' test_expect_success 'write-tree' ' - cd "$HERE" && top=`git write-tree` && echo $top && - cd dir && - sub=`git write-tree` && - echo $sub && - test "z$top" = "z$sub" + ( + cd dir && + sub=`git write-tree` && + echo $sub && + test "z$top" = "z$sub" + ) ' test_expect_success 'checkout-index' ' - cd "$HERE" && git checkout-index -f -u one && cmp one original.one && - cd dir && - git checkout-index -f -u two && - cmp two ../original.two + ( + cd dir && + git checkout-index -f -u two && + cmp two ../original.two + ) ' test_expect_success 'read-tree' ' - cd "$HERE" && rm -f one dir/two && tree=`git write-tree` && git read-tree --reset -u "$tree" && cmp one original.one && cmp dir/two original.two && - cd dir && - rm -f two && - git read-tree --reset -u "$tree" && - cmp two ../original.two && - cmp ../one ../original.one + ( + cd dir && + rm -f two && + git read-tree --reset -u "$tree" && + cmp two ../original.two && + cmp ../one ../original.one + ) ' test_expect_success 'no file/rev ambiguity check inside .git' ' - cd "$HERE" && git commit -a -m 1 && - cd "$HERE"/.git && - git show -s HEAD + ( + cd .git && + git show -s HEAD + ) ' test_expect_success 'no file/rev ambiguity check inside a bare repo' ' - cd "$HERE" && git clone -s --bare .git foo.git && - cd foo.git && GIT_DIR=. git show -s HEAD + ( + cd foo.git && + GIT_DIR=. git show -s HEAD + ) ' # This still does not work as it should... : test_expect_success 'no file/rev ambiguity check inside a bare repo' ' - cd "$HERE" && git clone -s --bare .git foo.git && - cd foo.git && git show -s HEAD + ( + cd foo.git && + git show -s HEAD + ) ' test_expect_success SYMLINKS 'detection should not be fooled by a symlink' ' - cd "$HERE" && rm -fr foo.git && git clone -s .git another && ln -s another yetanother && - cd yetanother/.git && - git show -s HEAD + ( + cd yetanother/.git && + git show -s HEAD + ) ' test_done diff --git a/t/t1302-repo-version.sh b/t/t1302-repo-version.sh index 8d305b4372..a6bf1bf4d6 100755 --- a/t/t1302-repo-version.sh +++ b/t/t1302-repo-version.sh @@ -7,41 +7,64 @@ test_description='Test repository version check' . ./test-lib.sh -cat >test.patch <<EOF -diff --git a/test.txt b/test.txt -new file mode 100644 ---- /dev/null -+++ b/test.txt -@@ -0,0 +1 @@ -+123 -EOF +test_expect_success 'setup' ' + cat >test.patch <<-\EOF && + diff --git a/test.txt b/test.txt + new file mode 100644 + --- /dev/null + +++ b/test.txt + @@ -0,0 +1 @@ + +123 + EOF -test_create_repo "test" -test_create_repo "test2" - -GIT_CONFIG=test2/.git/config git config core.repositoryformatversion 99 || exit 1 + test_create_repo "test" && + test_create_repo "test2" && + GIT_CONFIG=test2/.git/config git config core.repositoryformatversion 99 +' test_expect_success 'gitdir selection on normal repos' ' - (test "$(git config core.repositoryformatversion)" = 0 && - cd test && - test "$(git config core.repositoryformatversion)" = 0)' + echo 0 >expect && + git config core.repositoryformatversion >actual && + ( + cd test && + git config core.repositoryformatversion >../actual2 + ) && + test_cmp expect actual && + test_cmp expect actual2 +' -# Make sure it would stop at test2, not trash test_expect_success 'gitdir selection on unsupported repo' ' - (cd test2 && - test "$(git config core.repositoryformatversion)" = 99)' + # Make sure it would stop at test2, not trash + echo 99 >expect && + ( + cd test2 && + git config core.repositoryformatversion >../actual + ) + test_cmp expect actual +' test_expect_success 'gitdir not required mode' ' - (git apply --stat test.patch && - cd test && git apply --stat ../test.patch && - cd ../test2 && git apply --stat ../test.patch)' - -test_expect_success 'gitdir required mode on normal repos' ' - (git apply --check --index test.patch && - cd test && git apply --check --index ../test.patch)' + git apply --stat test.patch && + ( + cd test && + git apply --stat ../test.patch + ) && + ( + cd test2 && + git apply --stat ../test.patch + ) +' -test_expect_success 'gitdir required mode on unsupported repo' ' - (cd test2 && test_must_fail git apply --check --index ../test.patch) +test_expect_success 'gitdir required mode' ' + git apply --check --index test.patch && + ( + cd test && + git apply --check --index ../test.patch + ) && + ( + cd test2 && + test_must_fail git apply --check --index ../test.patch + ) ' test_done diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 759cf12e16..1be415e334 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -1,21 +1,23 @@ #!/bin/sh -test_description='git fsck random collection of tests' +test_description='git fsck random collection of tests + +* (HEAD) B +* (master) A +' . ./test-lib.sh test_expect_success setup ' + git config gc.auto 0 && git config i18n.commitencoding ISO-8859-1 && test_commit A fileA one && git config --unset i18n.commitencoding && git checkout HEAD^0 && test_commit B fileB two && git tag -d A B && - git reflog expire --expire=now --all -' - -test_expect_success 'HEAD is part of refs' ' - test 0 = $(git fsck | wc -l) + git reflog expire --expire=now --all && + >empty ' test_expect_success 'loose objects borrowed from alternate are not missing' ' @@ -25,110 +27,132 @@ test_expect_success 'loose objects borrowed from alternate are not missing' ' git init && echo ../../../.git/objects >.git/objects/info/alternates && test_commit C fileC one && - git fsck >out && - ! grep "missing blob" out - ) + git fsck >../out 2>&1 + ) && + { + grep -v dangling out >actual || + : + } && + test_cmp empty actual ' -test_expect_success 'valid objects appear valid' ' - { git fsck 2>out; true; } && - ! grep error out && - ! grep fatal out +test_expect_success 'HEAD is part of refs, valid objects appear valid' ' + git fsck >actual 2>&1 && + test_cmp empty actual ' # Corruption tests follow. Make sure to remove all traces of the # specific corruption you test afterwards, lest a later test trip over # it. +test_expect_success 'setup: helpers for corruption tests' ' + sha1_file() { + echo "$*" | sed "s#..#.git/objects/&/#" + } && + + remove_object() { + file=$(sha1_file "$*") && + test -e "$file" && + rm -f "$file" + } +' + test_expect_success 'object with bad sha1' ' sha=$(echo blob | git hash-object -w --stdin) && - echo $sha && old=$(echo $sha | sed "s+^..+&/+") && new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff && sha="$(dirname $new)$(basename $new)" mv .git/objects/$old .git/objects/$new && + test_when_finished "remove_object $sha" && git update-index --add --cacheinfo 100644 $sha foo && + test_when_finished "git read-tree -u --reset HEAD" && tree=$(git write-tree) && + test_when_finished "remove_object $tree" && cmt=$(echo bogus | git commit-tree $tree) && + test_when_finished "remove_object $cmt" && git update-ref refs/heads/bogus $cmt && - (git fsck 2>out; true) && - grep "$sha.*corrupt" out && - rm -f .git/objects/$new && - git update-ref -d refs/heads/bogus && - git read-tree -u --reset HEAD + test_when_finished "git update-ref -d refs/heads/bogus" && + + test_might_fail git fsck 2>out && + cat out && + grep "$sha.*corrupt" out ' test_expect_success 'branch pointing to non-commit' ' - git rev-parse HEAD^{tree} > .git/refs/heads/invalid && + git rev-parse HEAD^{tree} >.git/refs/heads/invalid && + test_when_finished "git update-ref -d refs/heads/invalid" && git fsck 2>out && - grep "not a commit" out && - git update-ref -d refs/heads/invalid + cat out && + grep "not a commit" out ' -new=nothing test_expect_success 'email without @ is okay' ' git cat-file commit HEAD >basis && sed "s/@/AT/" basis >okay && new=$(git hash-object -t commit -w --stdin <okay) && - echo "$new" && + test_when_finished "remove_object $new" && git update-ref refs/heads/bogus "$new" && + test_when_finished "git update-ref -d refs/heads/bogus" && git fsck 2>out && cat out && - ! grep "error in commit $new" out + ! grep "commit $new" out ' -git update-ref -d refs/heads/bogus -rm -f ".git/objects/$new" -new=nothing test_expect_success 'email with embedded > is not okay' ' git cat-file commit HEAD >basis && sed "s/@[a-z]/&>/" basis >bad-email && new=$(git hash-object -t commit -w --stdin <bad-email) && - echo "$new" && + test_when_finished "remove_object $new" && git update-ref refs/heads/bogus "$new" && + test_when_finished "git update-ref -d refs/heads/bogus" && git fsck 2>out && cat out && grep "error in commit $new" out ' -git update-ref -d refs/heads/bogus -rm -f ".git/objects/$new" - -cat > invalid-tag <<EOF -object ffffffffffffffffffffffffffffffffffffffff -type commit -tag invalid -tagger T A Gger <tagger@example.com> 1234567890 -0000 - -This is an invalid tag. -EOF test_expect_success 'tag pointing to nonexistent' ' - tag=$(git hash-object -t tag -w --stdin < invalid-tag) && - echo $tag > .git/refs/tags/invalid && + cat >invalid-tag <<-\EOF + object ffffffffffffffffffffffffffffffffffffffff + type commit + tag invalid + tagger T A Gger <tagger@example.com> 1234567890 -0000 + + This is an invalid tag. + EOF + + tag=$(git hash-object -t tag -w --stdin <invalid-tag) && + test_when_finished "remove_object $tag" && + echo $tag >.git/refs/tags/invalid && + test_when_finished "git update-ref -d refs/tags/invalid" && test_must_fail git fsck --tags >out && cat out && - grep "broken link" out && - rm .git/refs/tags/invalid + grep "broken link" out ' -cat > wrong-tag <<EOF -object $(echo blob | git hash-object -w --stdin) -type commit -tag wrong -tagger T A Gger <tagger@example.com> 1234567890 -0000 - -This is an invalid tag. -EOF - test_expect_success 'tag pointing to something else than its type' ' - tag=$(git hash-object -t tag -w --stdin < wrong-tag) && - echo $tag > .git/refs/tags/wrong && + sha=$(echo blob | git hash-object -w --stdin) && + test_when_finished "remove_object $sha" && + cat >wrong-tag <<-EOF && + object $sha + type commit + tag wrong + tagger T A Gger <tagger@example.com> 1234567890 -0000 + + This is an invalid tag. + EOF + + tag=$(git hash-object -t tag -w --stdin <wrong-tag) && + test_when_finished "remove_object $tag" && + echo $tag >.git/refs/tags/wrong && + test_when_finished "git update-ref -d refs/tags/wrong" && test_must_fail git fsck --tags 2>out && cat out && - grep "error in tag.*broken links" out && - rm .git/refs/tags/wrong + grep "error in tag.*broken links" out ' - +test_expect_success 'cleaned up' ' + git fsck >actual 2>&1 && + test_cmp empty actual +' test_done diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh index 100f857b16..813cc1b3e2 100755 --- a/t/t1503-rev-parse-verify.sh +++ b/t/t1503-rev-parse-verify.sh @@ -106,8 +106,8 @@ test_expect_success 'use --default' ' test_expect_success 'master@{n} for various n' ' N=$(git reflog | wc -l) && - Nm1=$((N-1)) && - Np1=$((N+1)) && + Nm1=$(($N-1)) && + Np1=$(($N+1)) && git rev-parse --verify master@{0} && git rev-parse --verify master@{1} && git rev-parse --verify master@{$Nm1} && diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh index 7657ec190c..a463b13b27 100755 --- a/t/t2016-checkout-patch.sh +++ b/t/t2016-checkout-patch.sh @@ -52,7 +52,7 @@ test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' ' ' test_expect_success PERL 'git checkout -p HEAD with change already staged' ' - set_state dir/foo index index + set_state dir/foo index index && # the third n is to get out in case it mistakenly does not apply (echo n; echo y; echo n) | git checkout -p HEAD && verify_saved_state bar && diff --git a/t/t2101-update-index-reupdate.sh b/t/t2101-update-index-reupdate.sh index 648184fd98..76ad7c344c 100755 --- a/t/t2101-update-index-reupdate.sh +++ b/t/t2101-update-index-reupdate.sh @@ -63,10 +63,10 @@ cat > expected <<\EOF EOF test_expect_success 'update-index --update from subdir' \ 'echo not so happy >file2 && - cd dir1 && + (cd dir1 && cat ../file2 >file3 && - git update-index --again && - cd .. && + git update-index --again + ) && git ls-files -s >current && cmp current expected' diff --git a/t/t2105-update-index-gitfile.sh b/t/t2105-update-index-gitfile.sh index 641607d89a..a7f3d47aec 100755 --- a/t/t2105-update-index-gitfile.sh +++ b/t/t2105-update-index-gitfile.sh @@ -13,7 +13,7 @@ test_expect_success 'submodule with absolute .git file' ' (cd sub1 && git init && REAL="$(pwd)/.real" && - mv .git "$REAL" + mv .git "$REAL" && echo "gitdir: $REAL" >.git && test_commit first) ' diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index efe2900a37..e66e550b24 100755 --- a/t/t3030-merge-recursive.sh +++ b/t/t3030-merge-recursive.sh @@ -23,6 +23,8 @@ test_expect_success 'setup 1' ' git branch df-3 && git branch remove && git branch submod && + git branch copy && + git branch rename && echo hello >>a && cp a d/e && @@ -248,6 +250,22 @@ test_expect_success 'setup 7' ' git commit -m "make d/ a submodule" ' +test_expect_success 'setup 8' ' + git checkout rename && + git mv a e && + git add e && + test_tick && + git commit -m "rename a->e" +' + +test_expect_success 'setup 9' ' + git checkout copy && + cp a e && + git add e && + test_tick && + git commit -m "copy a->e" +' + test_expect_success 'merge-recursive simple' ' rm -fr [abcd] && @@ -580,4 +598,21 @@ test_expect_failure 'merge-recursive simple w/submodule result' ' test_cmp expected actual ' +test_expect_success 'merge-recursive copy vs. rename' ' + git checkout -f copy && + git merge rename && + ( git ls-tree -r HEAD && git ls-files -s ) >actual && + ( + echo "100644 blob $o0 b" + echo "100644 blob $o0 c" + echo "100644 blob $o0 d/e" + echo "100644 blob $o0 e" + echo "100644 $o0 0 b" + echo "100644 $o0 0 c" + echo "100644 $o0 0 d/e" + echo "100644 $o0 0 e" + ) >expected && + test_cmp expected actual +' + test_done diff --git a/t/t3060-ls-files-with-tree.sh b/t/t3060-ls-files-with-tree.sh index 3ce501bb97..61c1f53d1b 100755 --- a/t/t3060-ls-files-with-tree.sh +++ b/t/t3060-ls-files-with-tree.sh @@ -53,17 +53,15 @@ test_expect_success setup ' git add . ' -# We have to run from a sub-directory to trigger prune_path -# Then we finally get to run our --with-tree test -cd sub - test_expect_success 'git -ls-files --with-tree should succeed from subdir' ' - - git ls-files --with-tree=HEAD~1 >../output - + # We have to run from a sub-directory to trigger prune_path + # Then we finally get to run our --with-tree test + ( + cd sub && + git ls-files --with-tree=HEAD~1 >../output + ) ' -cd .. test_expect_success \ 'git -ls-files --with-tree should add entries from named tree.' \ 'test_cmp expected output' diff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh index eee0d344d2..81d90b66c5 100755 --- a/t/t3100-ls-tree-restrict.sh +++ b/t/t3100-ls-tree-restrict.sh @@ -165,4 +165,13 @@ test_expect_success \ EOF test_output' +test_expect_success \ + 'ls-tree with one path a prefix of the other' \ + 'git ls-tree $tree path2/baz path2/bazbo >current && + make_expected <<\EOF && +040000 tree X path2/baz +120000 blob X path2/bazbo +EOF + test_output' + test_done diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh index 06654c6f82..026f9f89d9 100755 --- a/t/t3101-ls-tree-dirname.sh +++ b/t/t3101-ls-tree-dirname.sh @@ -21,33 +21,32 @@ entries. Also test odd filename and missing entries handling. ' . ./test-lib.sh -test_expect_success \ - 'setup' \ - 'echo 111 >1.txt && - echo 222 >2.txt && - mkdir path0 path0/a path0/a/b path0/a/b/c && - echo 111 >path0/a/b/c/1.txt && - mkdir path1 path1/b path1/b/c && - echo 111 >path1/b/c/1.txt && - mkdir path2 && - echo 111 >path2/1.txt && - mkdir path3 && - echo 111 >path3/1.txt && - echo 222 >path3/2.txt && - find *.txt path* \( -type f -o -type l \) -print | - xargs git update-index --add && - tree=`git write-tree` && - echo $tree' +test_expect_success 'setup' ' + echo 111 >1.txt && + echo 222 >2.txt && + mkdir path0 path0/a path0/a/b path0/a/b/c && + echo 111 >path0/a/b/c/1.txt && + mkdir path1 path1/b path1/b/c && + echo 111 >path1/b/c/1.txt && + mkdir path2 && + echo 111 >path2/1.txt && + mkdir path3 && + echo 111 >path3/1.txt && + echo 222 >path3/2.txt && + find *.txt path* \( -type f -o -type l \) -print | + xargs git update-index --add && + tree=`git write-tree` && + echo $tree +' test_output () { - sed -e "s/ $_x40 / X /" <current >check - test_cmp expected check + sed -e "s/ $_x40 / X /" <current >check && + test_cmp expected check } -test_expect_success \ - 'ls-tree plain' \ - 'git ls-tree $tree >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree plain' ' + git ls-tree $tree >current && + cat >expected <<\EOF && 100644 blob X 1.txt 100644 blob X 2.txt 040000 tree X path0 @@ -55,13 +54,13 @@ test_expect_success \ 040000 tree X path2 040000 tree X path3 EOF - test_output' + test_output +' # Recursive does not show tree nodes anymore... -test_expect_success \ - 'ls-tree recursive' \ - 'git ls-tree -r $tree >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree recursive' ' + git ls-tree -r $tree >current && + cat >expected <<\EOF && 100644 blob X 1.txt 100644 blob X 2.txt 100644 blob X path0/a/b/c/1.txt @@ -70,68 +69,71 @@ test_expect_success \ 100644 blob X path3/1.txt 100644 blob X path3/2.txt EOF - test_output' + test_output +' -test_expect_success \ - 'ls-tree filter 1.txt' \ - 'git ls-tree $tree 1.txt >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree filter 1.txt' ' + git ls-tree $tree 1.txt >current && + cat >expected <<\EOF && 100644 blob X 1.txt EOF - test_output' + test_output +' -test_expect_success \ - 'ls-tree filter path1/b/c/1.txt' \ - 'git ls-tree $tree path1/b/c/1.txt >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree filter path1/b/c/1.txt' ' + git ls-tree $tree path1/b/c/1.txt >current && + cat >expected <<\EOF && 100644 blob X path1/b/c/1.txt EOF - test_output' + test_output +' -test_expect_success \ - 'ls-tree filter all 1.txt files' \ - 'git ls-tree $tree 1.txt path0/a/b/c/1.txt path1/b/c/1.txt path2/1.txt path3/1.txt >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree filter all 1.txt files' ' + git ls-tree $tree 1.txt path0/a/b/c/1.txt \ + path1/b/c/1.txt path2/1.txt path3/1.txt >current && + cat >expected <<\EOF && 100644 blob X 1.txt 100644 blob X path0/a/b/c/1.txt 100644 blob X path1/b/c/1.txt 100644 blob X path2/1.txt 100644 blob X path3/1.txt EOF - test_output' + test_output +' # I am not so sure about this one after ls-tree doing pathspec match. # Having both path0/a and path0/a/b/c makes path0/a redundant, and # it behaves as if path0/a/b/c, path1/b/c, path2 and path3 are specified. -test_expect_success \ - 'ls-tree filter directories' \ - 'git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree filter directories' ' + git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current && + cat >expected <<\EOF && 040000 tree X path0/a/b/c 040000 tree X path1/b/c 040000 tree X path2 040000 tree X path3 EOF - test_output' + test_output +' # Again, duplicates are filtered away so this is equivalent to # having 1.txt and path3 -test_expect_success \ - 'ls-tree filter odd names' \ - 'git ls-tree $tree 1.txt ./1.txt .//1.txt path3/1.txt path3/./1.txt path3 path3// >current && - cat >expected <<\EOF && +test_expect_success 'ls-tree filter odd names' ' + git ls-tree $tree 1.txt ./1.txt .//1.txt \ + path3/1.txt path3/./1.txt path3 path3// >current && + cat >expected <<\EOF && 100644 blob X 1.txt 100644 blob X path3/1.txt 100644 blob X path3/2.txt EOF - test_output' + test_output +' -test_expect_success \ - 'ls-tree filter missing files and extra slashes' \ - 'git ls-tree $tree 1.txt/ abc.txt path3//23.txt path3/2.txt/// >current && - cat >expected <<\EOF && -EOF - test_output' +test_expect_success 'ls-tree filter missing files and extra slashes' ' + git ls-tree $tree 1.txt/ abc.txt \ + path3//23.txt path3/2.txt/// >current && + >expected && + test_output +' test_expect_success 'ls-tree filter is leading path match' ' git ls-tree $tree pa path3/a >current && @@ -198,7 +200,7 @@ EOF ' test_expect_success 'ls-tree --name-only' ' - git ls-tree --name-only $tree >current + git ls-tree --name-only $tree >current && cat >expected <<\EOF && 1.txt 2.txt @@ -211,7 +213,7 @@ EOF ' test_expect_success 'ls-tree --name-only -r' ' - git ls-tree --name-only -r $tree >current + git ls-tree --name-only -r $tree >current && cat >expected <<\EOF && 1.txt 2.txt diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh index 8f785e7957..74161a42ec 100755 --- a/t/t3409-rebase-preserve-merges.sh +++ b/t/t3409-rebase-preserve-merges.sh @@ -42,23 +42,24 @@ test_expect_success 'setup for merge-preserving rebase' \ git commit -a -m "Modify A2" && git clone ./. clone1 && - cd clone1 && + (cd clone1 && git checkout -b topic origin/topic && - git merge origin/master && - cd .. && + git merge origin/master + ) && echo Fifth > B && git add B && git commit -m "Add different B" && git clone ./. clone2 && - cd clone2 && - git checkout -b topic origin/topic && - test_must_fail git merge origin/master && - echo Resolved > B && - git add B && - git commit -m "Merge origin/master into topic" && - cd .. && + ( + cd clone2 && + git checkout -b topic origin/topic && + test_must_fail git merge origin/master && + echo Resolved >B && + git add B && + git commit -m "Merge origin/master into topic" + ) && git checkout topic && echo Fourth >> B && diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index d99f27a12f..903a122efe 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -69,9 +69,10 @@ test_expect_success 'apply stashed changes (including index)' ' test_expect_success 'unstashing in a subdirectory' ' git reset --hard HEAD && mkdir subdir && - cd subdir && - git stash apply && - cd .. + ( + cd subdir && + git stash apply + ) ' test_expect_success 'drop top stash' ' @@ -415,8 +416,37 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' ' echo bar >> file && STASH_ID=$(git stash create) && git reset --hard && - git stash show ${STASH_ID} + cat >expected <<-EOF && + file | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + EOF + git stash show ${STASH_ID} >actual && + test_cmp expected actual +' + +test_expect_success 'stash show -p - stashes on stack, stash-like argument' ' + git stash clear && + test_when_finished "git reset --hard HEAD" && + git reset --hard && + echo foo >> file && + git stash && + test_when_finished "git stash drop" && + echo bar >> file && + STASH_ID=$(git stash create) && + git reset --hard && + cat >expected <<-EOF && + diff --git a/file b/file + index 7601807..935fbd3 100644 + --- a/file + +++ b/file + @@ -1 +1,2 @@ + baz + +bar + EOF + git stash show -p ${STASH_ID} >actual && + test_cmp expected actual ' + test_expect_success 'stash show - no stashes on stack, stash-like argument' ' git stash clear && test_when_finished "git reset --hard HEAD" && @@ -424,7 +454,32 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' ' echo foo >> file && STASH_ID=$(git stash create) && git reset --hard && - git stash show ${STASH_ID} + cat >expected <<-EOF && + file | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + EOF + git stash show ${STASH_ID} >actual && + test_cmp expected actual +' + +test_expect_success 'stash show -p - no stashes on stack, stash-like argument' ' + git stash clear && + test_when_finished "git reset --hard HEAD" && + git reset --hard && + echo foo >> file && + STASH_ID=$(git stash create) && + git reset --hard && + cat >expected <<-EOF && + diff --git a/file b/file + index 7601807..71b52c4 100644 + --- a/file + +++ b/file + @@ -1 +1,2 @@ + baz + +foo + EOF + git stash show -p ${STASH_ID} >actual && + test_cmp expected actual ' test_expect_success 'stash drop - fail early if specified stash is not a stash reference' ' @@ -490,4 +545,15 @@ test_expect_success 'invalid ref of the form stash@{n}, n >= N' ' git stash drop ' +test_expect_success 'stash branch should not drop the stash if the branch exists' ' + git stash clear && + echo foo >file && + git add file && + git commit -m initial && + echo bar >file && + git stash && + test_must_fail git stash branch master stash@{0} && + git rev-parse stash@{0} -- +' + test_done diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 19857f4326..9a66520588 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -210,6 +210,9 @@ log -m -p master log -SF master log -S F master log -SF -p master +log -GF master +log -GF -p master +log -GF -p --pickaxe-all master log --decorate --all log --decorate=full --all diff --git a/t/t4013/diff.log_-GF_-p_--pickaxe-all_master b/t/t4013/diff.log_-GF_-p_--pickaxe-all_master new file mode 100644 index 0000000000..d36f88098b --- /dev/null +++ b/t/t4013/diff.log_-GF_-p_--pickaxe-all_master @@ -0,0 +1,27 @@ +$ git log -GF -p --pickaxe-all master +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 +Author: A U Thor <author@example.com> +Date: Mon Jun 26 00:02:00 2006 +0000 + + Third + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +diff --git a/file1 b/file1 +new file mode 100644 +index 0000000..b1e6722 +--- /dev/null ++++ b/file1 +@@ -0,0 +1,3 @@ ++A ++B ++C +$ diff --git a/t/t4013/diff.log_-GF_-p_master b/t/t4013/diff.log_-GF_-p_master new file mode 100644 index 0000000000..9d93f2c23a --- /dev/null +++ b/t/t4013/diff.log_-GF_-p_master @@ -0,0 +1,18 @@ +$ git log -GF -p master +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 +Author: A U Thor <author@example.com> +Date: Mon Jun 26 00:02:00 2006 +0000 + + Third + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +$ diff --git a/t/t4013/diff.log_-GF_master b/t/t4013/diff.log_-GF_master new file mode 100644 index 0000000000..4c6708d2d0 --- /dev/null +++ b/t/t4013/diff.log_-GF_master @@ -0,0 +1,7 @@ +$ git log -GF master +commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 +Author: A U Thor <author@example.com> +Date: Mon Jun 26 00:02:00 2006 +0000 + + Third +$ diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index f87434b9f8..07bf6eb49d 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -12,24 +12,29 @@ test_expect_success setup ' for i in 1 2 3 4 5 6 7 8 9 10; do echo "$i"; done >file && cat file >elif && git add file elif && + test_tick && git commit -m Initial && git checkout -b side && for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file && test_chmod +x elif && + test_tick && git commit -m "Side changes #1" && for i in D E F; do echo "$i"; done >>file && git update-index file && + test_tick && git commit -m "Side changes #2" && git tag C2 && for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file && git update-index file && + test_tick && git commit -m "Side changes #3 with \\n backslash-n in it." && git checkout master && git diff-tree -p C2 | git apply --index && + test_tick && git commit -m "Master accepts moral equivalent of #2" ' @@ -51,6 +56,22 @@ test_expect_success "format-patch --ignore-if-in-upstream" ' ' +test_expect_success "format-patch doesn't consider merge commits" ' + + git checkout -b slave master && + echo "Another line" >>file && + test_tick && + git commit -am "Slave change #1" && + echo "Yet another line" >>file && + test_tick && + git commit -am "Slave change #2" && + git checkout -b merger master && + test_tick && + git merge --no-ff slave && + cnt=`git format-patch -3 --stdout | grep "^From " | wc -l` && + test $cnt = 3 +' + test_expect_success "format-patch result applies" ' git checkout -b rebuild-0 master && diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh index c8e19372b0..0a61b57b5f 100755 --- a/t/t4018-diff-funcname.sh +++ b/t/t4018-diff-funcname.sh @@ -32,7 +32,7 @@ EOF sed 's/beer\\/beer,\\/' < Beer.java > Beer-correct.java -builtin_patterns="bibtex cpp csharp html java objc pascal php python ruby tex" +builtin_patterns="bibtex cpp csharp fortran html java objc pascal php python ruby tex" for p in $builtin_patterns do test_expect_success "builtin $p pattern compiles" ' diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index 8e391cf9a7..995bdfafec 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -85,10 +85,11 @@ EOF " commit_file sm1 && -cd sm1 && -git reset --hard HEAD~2 >/dev/null && -head3=$(git rev-parse --verify HEAD | cut -c1-7) && -cd .. +head3=$( + cd sm1 && + git reset --hard HEAD~2 >/dev/null && + git rev-parse --verify HEAD | cut -c1-7 +) test_expect_success 'modified submodule(backward)' " git diff-index -p --submodule=log HEAD >actual && diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index efb42d1540..9a884751ec 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -21,27 +21,30 @@ test_expect_success setup ' test_expect_success "clone and setup child repos" ' git clone . one && - cd one && - echo >file updated by one && - git commit -a -m "updated by one" && - cd .. && + ( + cd one && + echo >file updated by one && + git commit -a -m "updated by one" + ) && git clone . two && - cd two && - git config branch.master.remote one && - git config remote.one.url ../one/.git/ && - git config remote.one.fetch refs/heads/master:refs/heads/one && - cd .. && + ( + cd two && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch refs/heads/master:refs/heads/one + ) && git clone . three && - cd three && - git config branch.master.remote two && - git config branch.master.merge refs/heads/one && - mkdir -p .git/remotes && - { - echo "URL: ../two/.git/" - echo "Pull: refs/heads/master:refs/heads/two" - echo "Pull: refs/heads/one:refs/heads/one" - } >.git/remotes/two && - cd .. && + ( + cd three && + git config branch.master.remote two && + git config branch.master.merge refs/heads/one && + mkdir -p .git/remotes && + { + echo "URL: ../two/.git/" + echo "Pull: refs/heads/master:refs/heads/two" + echo "Pull: refs/heads/one:refs/heads/one" + } >.git/remotes/two + ) && git clone . bundle && git clone . seven ' diff --git a/t/t5704-bundle.sh b/t/t5704-bundle.sh index ddc3dc52f4..728ccd88c3 100755 --- a/t/t5704-bundle.sh +++ b/t/t5704-bundle.sh @@ -30,6 +30,13 @@ test_expect_success 'tags can be excluded by rev-list options' ' ' +test_expect_success 'die if bundle file cannot be created' ' + + mkdir adir && + test_must_fail git bundle create adir --all + +' + test_expect_failure 'bundle --stdin' ' echo master | git bundle create stdin-bundle.bdl --stdin && diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index dd917d76da..95b180f469 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -104,17 +104,18 @@ test_expect_success '"git fsck" works' ' test_expect_success 'repack, clone and fetch work' ' git repack -a -d && git clone --no-hardlinks . clone_dir && - cd clone_dir && - git show HEAD~5 | grep "A U Thor" && - git show $HASH2 | grep "A U Thor" && - git cat-file commit $R && - git repack -a -d && - test_must_fail git cat-file commit $R && - git fetch ../ "refs/replace/*:refs/replace/*" && - git show HEAD~5 | grep "O Thor" && - git show $HASH2 | grep "O Thor" && - git cat-file commit $R && - cd .. + ( + cd clone_dir && + git show HEAD~5 | grep "A U Thor" && + git show $HASH2 | grep "A U Thor" && + git cat-file commit $R && + git repack -a -d && + test_must_fail git cat-file commit $R && + git fetch ../ "refs/replace/*:refs/replace/*" && + git show HEAD~5 | grep "O Thor" && + git show $HASH2 | grep "O Thor" && + git cat-file commit $R + ) ' test_expect_success '"git replace" listing and deleting' ' @@ -177,10 +178,11 @@ test_expect_success 'create parallel branch without the bug' ' test_expect_success 'push to cloned repo' ' git push cloned $HASH6^:refs/heads/parallel && - cd clone_dir && - git checkout parallel && - git log --pretty=oneline | grep $PARA2 && - cd .. + ( + cd clone_dir && + git checkout parallel && + git log --pretty=oneline | grep $PARA2 + ) ' test_expect_success 'push branch with replacement' ' @@ -191,20 +193,29 @@ test_expect_success 'push branch with replacement' ' git show $HASH6~2 | grep "O Thor" && git show $PARA3 | grep "O Thor" && git push cloned $HASH6^:refs/heads/parallel2 && - cd clone_dir && - git checkout parallel2 && - git log --pretty=oneline | grep $PARA3 && - git show $PARA3 | grep "A U Thor" && - cd .. + ( + cd clone_dir && + git checkout parallel2 && + git log --pretty=oneline | grep $PARA3 && + git show $PARA3 | grep "A U Thor" + ) ' test_expect_success 'fetch branch with replacement' ' git branch tofetch $HASH6 && - cd clone_dir && - git fetch origin refs/heads/tofetch:refs/heads/parallel3 - git log --pretty=oneline parallel3 | grep $PARA3 - git show $PARA3 | grep "A U Thor" - cd .. + ( + cd clone_dir && + git fetch origin refs/heads/tofetch:refs/heads/parallel3 && + git log --pretty=oneline parallel3 > output.txt && + ! grep $PARA3 output.txt && + git show $PARA3 > para3.txt && + grep "A U Thor" para3.txt && + git fetch origin "refs/replace/*:refs/replace/*" && + git log --pretty=oneline parallel3 > output.txt && + grep $PARA3 output.txt && + git show $PARA3 > para3.txt && + grep "O Thor" para3.txt + ) ' test_expect_success 'bisect and replacements' ' diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 71f6cad3c2..9a16806921 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -129,6 +129,97 @@ test_expect_success '[merge] summary/log configuration' ' test_cmp expected actual2 ' +test_expect_success 'setup: clear [merge] configuration' ' + test_might_fail git config --unset-all merge.log && + test_might_fail git config --unset-all merge.summary +' + +test_expect_success 'setup FETCH_HEAD' ' + git checkout master && + test_tick && + git fetch . left +' + +test_expect_success 'merge.log=3 limits shortlog length' ' + cat >expected <<-EOF && + Merge branch ${apos}left${apos} + + * left: (5 commits) + Left #5 + Left #4 + Left #3 + ... + EOF + + git -c merge.log=3 fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success 'merge.log=5 shows all 5 commits' ' + cat >expected <<-EOF && + Merge branch ${apos}left${apos} + + * left: + Left #5 + Left #4 + Left #3 + Common #2 + Common #1 + EOF + + git -c merge.log=5 fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success 'merge.log=0 disables shortlog' ' + echo "Merge branch ${apos}left${apos}" >expected + git -c merge.log=0 fmt-merge-msg <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success '--log=3 limits shortlog length' ' + cat >expected <<-EOF && + Merge branch ${apos}left${apos} + + * left: (5 commits) + Left #5 + Left #4 + Left #3 + ... + EOF + + git fmt-merge-msg --log=3 <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success '--log=5 shows all 5 commits' ' + cat >expected <<-EOF && + Merge branch ${apos}left${apos} + + * left: + Left #5 + Left #4 + Left #3 + Common #2 + Common #1 + EOF + + git fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success '--no-log disables shortlog' ' + echo "Merge branch ${apos}left${apos}" >expected && + git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + +test_expect_success '--log=0 disables shortlog' ' + echo "Merge branch ${apos}left${apos}" >expected && + git fmt-merge-msg --no-log <.git/FETCH_HEAD >actual && + test_cmp expected actual +' + test_expect_success 'fmt-merge-msg -m' ' echo "Sync with left" >expected && cat >expected.log <<-EOF && diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index 2c55801ee8..e0227730de 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -3,31 +3,34 @@ test_description='git filter-branch' . ./test-lib.sh -make_commit () { - lower=$(echo $1 | tr '[A-Z]' '[a-z]') - echo $lower > $lower - git add $lower - test_tick - git commit -m $1 - git tag $1 -} - test_expect_success 'setup' ' - make_commit A - 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 - git checkout branch - git merge C - git tag F - make_commit G - make_commit H -' + test_commit A && + test_commit B && + git checkout -b branch B && + test_commit D && + mkdir dir && + test_commit dir/D && + test_commit E && + git checkout master && + test_commit C && + git checkout branch && + git merge C && + git tag F && + test_commit G && + test_commit H +' +# * (HEAD, branch) H +# * G +# * Merge commit 'C' into branch +# |\ +# | * (master) C +# * | E +# * | dir/D +# * | D +# |/ +# * B +# * A + H=$(git rev-parse H) @@ -65,14 +68,14 @@ test_expect_success 'Fail if commit filter fails' ' ' test_expect_success 'rewrite, renaming a specific file' ' - git filter-branch -f --tree-filter "mv d doh || :" HEAD + git filter-branch -f --tree-filter "mv D.t doh || :" HEAD ' test_expect_success 'test that the file was renamed' ' - test d = "$(git show HEAD:doh --)" && - ! test -f d && + test D = "$(git show HEAD:doh --)" && + ! test -f D.t && test -f doh && - test d = "$(cat doh)" + test D = "$(cat doh)" ' test_expect_success 'rewrite, renaming a specific directory' ' @@ -80,18 +83,18 @@ test_expect_success 'rewrite, renaming a specific directory' ' ' test_expect_success 'test that the directory was renamed' ' - test dir/d = "$(git show HEAD:diroh/d --)" && + test dir/D = "$(git show HEAD:diroh/D.t --)" && ! test -d dir && test -d diroh && ! test -d diroh/dir && - test -f diroh/d && - test dir/d = "$(cat diroh/d)" + test -f diroh/D.t && + test dir/D = "$(cat diroh/D.t)" ' git tag oldD HEAD~4 test_expect_success 'rewrite one branch, keeping a side branch' ' git branch modD oldD && - git filter-branch -f --tree-filter "mv b boh || :" D..modD + git filter-branch -f --tree-filter "mv B.t boh || :" D..modD ' test_expect_success 'common ancestor is still common (unchanged)' ' @@ -104,13 +107,13 @@ test_expect_success 'filter subdirectory only' ' git add subdir/new && test_tick && git commit -m "subdir" && - echo H > a && + echo H > A.t && test_tick && - git commit -m "not subdir" a && + git commit -m "not subdir" A.t && echo A > subdir/new && test_tick && git commit -m "again subdir" subdir/new && - git rm a && + git rm A.t && test_tick && git commit -m "again not subdir" && git branch sub && @@ -134,7 +137,7 @@ test_expect_success 'more setup' ' git add subdir/new && test_tick && git commit -m "subdir on master" subdir/new && - git rm a && + git rm A.t && test_tick && git commit -m "again subdir on master" && git merge branch @@ -283,8 +286,8 @@ test_expect_success 'Tag name filtering allows slashes in tag names' ' test_expect_success 'Prune empty commits' ' git rev-list HEAD > expect && - make_commit to_remove && - git filter-branch -f --index-filter "git update-index --remove to_remove" --prune-empty HEAD && + test_commit to_remove && + git filter-branch -f --index-filter "git update-index --remove to_remove.t" --prune-empty HEAD && git rev-list HEAD > actual && test_cmp expect actual ' @@ -307,6 +310,24 @@ test_expect_success '--remap-to-ancestor with filename filters' ' test $orig_invariant = $(git rev-parse invariant) ' +test_expect_success 'automatic remapping to ancestor with filename filters' ' + git checkout master && + git reset --hard A && + test_commit add-foo2 foo 1 && + git branch moved-foo2 && + test_commit add-bar2 bar a && + git branch invariant2 && + orig_invariant=$(git rev-parse invariant2) && + git branch moved-bar2 && + test_commit change-foo2 foo 2 && + git filter-branch -f \ + moved-foo2 moved-bar2 A..master \ + -- -- foo && + test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) && + test $(git rev-parse moved-foo2) = $(git rev-parse master^) && + test $orig_invariant = $(git rev-parse invariant2) +' + test_expect_success 'setup submodule' ' rm -fr ?* .git && git init && diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 7dbbea13ac..6c776e9bec 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -443,7 +443,7 @@ test_expect_success 'git clean -e' ' ( cd repo && git init && - touch 1 2 3 known && + touch known 1 2 3 && git add known && git clean -f -e 1 -e 2 && test -e 1 && diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 9bda970584..782b0a3ece 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -413,12 +413,13 @@ test_expect_success 'submodule <invalid-path> warns' ' test_expect_success 'add submodules without specifying an explicit path' ' mkdir repo && - cd repo && - git init && - echo r >r && - git add r && - git commit -m "repo commit 1" && - cd .. && + ( + cd repo && + git init && + echo r >r && + git add r && + git commit -m "repo commit 1" + ) && git clone --bare repo/ bare.git && cd addtest && git submodule add "$submodurl/repo" && diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh index cee319da0a..294584452b 100755 --- a/t/t7401-submodule-summary.sh +++ b/t/t7401-submodule-summary.sh @@ -66,10 +66,11 @@ EOF " commit_file sm1 && -cd sm1 && -git reset --hard HEAD~2 >/dev/null && -head3=$(git rev-parse --verify HEAD | cut -c1-7) && -cd .. +head3=$( + cd sm1 && + git reset --hard HEAD~2 >/dev/null && + git rev-parse --verify HEAD | cut -c1-7 +) test_expect_success 'modified submodule(backward)' " git submodule summary >actual && diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh index d5adae640b..b041516a1d 100755 --- a/t/t9100-git-svn-basic.sh +++ b/t/t9100-git-svn-basic.sh @@ -22,17 +22,18 @@ esac test_expect_success \ 'initialize git svn' ' mkdir import && - cd import && - echo foo > foo && - ln -s foo foo.link - mkdir -p dir/a/b/c/d/e && - echo "deep dir" > dir/a/b/c/d/e/file && - mkdir bar && - echo "zzz" > bar/zzz && - echo "#!/bin/sh" > exec.sh && - chmod +x exec.sh && - svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null && - cd .. && + ( + cd import && + echo foo >foo && + ln -s foo foo.link + mkdir -p dir/a/b/c/d/e && + echo "deep dir" >dir/a/b/c/d/e/file && + mkdir bar && + echo "zzz" >bar/zzz && + echo "#!/bin/sh" >exec.sh && + chmod +x exec.sh && + svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null + ) && rm -rf import && git svn init "$svnrepo"' @@ -142,7 +143,7 @@ test_expect_success "$name" ' git svn set-tree --find-copies-harder --rmdir \ ${remotes_git_svn}..mybranch5 && svn_cmd up "$SVN_TREE" && - test -L "$SVN_TREE"/exec.sh' + test -h "$SVN_TREE"/exec.sh' name='new symlink is added to a file that was also just made executable' @@ -155,7 +156,7 @@ test_expect_success "$name" ' ${remotes_git_svn}..mybranch5 && svn_cmd up "$SVN_TREE" && test -x "$SVN_TREE"/bar/zzz && - test -L "$SVN_TREE"/exec-2.sh' + test -h "$SVN_TREE"/exec-2.sh' name='modify a symlink to become a file' test_expect_success "$name" ' @@ -168,7 +169,7 @@ test_expect_success "$name" ' ${remotes_git_svn}..mybranch5 && svn_cmd up "$SVN_TREE" && test -f "$SVN_TREE"/exec-2.sh && - test ! -L "$SVN_TREE"/exec-2.sh && + test ! -h "$SVN_TREE"/exec-2.sh && test_cmp help "$SVN_TREE"/exec-2.sh' name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL" diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh index 929499e996..8869f5018e 100755 --- a/t/t9101-git-svn-props.sh +++ b/t/t9101-git-svn-props.sh @@ -53,8 +53,9 @@ cd .. rm -rf import test_expect_success 'checkout working copy from svn' 'svn co "$svnrepo" test_wc' -test_expect_success 'setup some commits to svn' \ - 'cd test_wc && +test_expect_success 'setup some commits to svn' ' + ( + cd test_wc && echo Greetings >> kw.c && poke kw.c && svn_cmd commit -m "Not yet an Id" && @@ -63,8 +64,9 @@ test_expect_success 'setup some commits to svn' \ svn_cmd commit -m "Modified file, but still not yet an Id" && svn_cmd propset svn:keywords Id kw.c && poke kw.c && - svn_cmd commit -m "Propset Id" && - cd ..' + svn_cmd commit -m "Propset Id" + ) +' test_expect_success 'initialize git svn' 'git svn init "$svnrepo"' test_expect_success 'fetch revisions from svn' 'git svn fetch' @@ -81,13 +83,15 @@ expect='/* $Id$ */' got="`sed -ne 2p kw.c`" test_expect_success 'raw $Id$ found in kw.c' "test '$expect' = '$got'" -test_expect_success "propset CR on crlf files" \ - 'cd test_wc && +test_expect_success "propset CR on crlf files" ' + ( + cd test_wc && svn_cmd propset svn:eol-style CR empty && svn_cmd propset svn:eol-style CR crlf && svn_cmd propset svn:eol-style CR ne_crlf && - svn_cmd commit -m "propset CR on crlf files" && - cd ..' + svn_cmd commit -m "propset CR on crlf files" + ) +' test_expect_success 'fetch and pull latest from svn and checkout a new wc' \ 'git svn fetch && @@ -137,19 +141,20 @@ cat > show-ignore.expect <<\EOF EOF test_expect_success 'test show-ignore' " - cd test_wc && - mkdir -p deeply/nested/directory && - touch deeply/nested/directory/.keep && - svn_cmd add deeply && - svn_cmd up && - svn_cmd propset -R svn:ignore ' + ( + cd test_wc && + mkdir -p deeply/nested/directory && + touch deeply/nested/directory/.keep && + svn_cmd add deeply && + svn_cmd up && + svn_cmd propset -R svn:ignore ' no-such-file* ' . - svn_cmd commit -m 'propset svn:ignore' - cd .. && + svn_cmd commit -m 'propset svn:ignore' + ) && git svn show-ignore > show-ignore.got && cmp show-ignore.expect show-ignore.got - " +" cat >create-ignore.expect <<\EOF /no-such-file* diff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh index 028fb19e09..eb70f4839c 100755 --- a/t/t9102-git-svn-deep-rmdir.sh +++ b/t/t9102-git-svn-deep-rmdir.sh @@ -4,13 +4,14 @@ test_description='git svn rmdir' test_expect_success 'initialize repo' ' mkdir import && - cd import && - mkdir -p deeply/nested/directory/number/1 && - mkdir -p deeply/nested/directory/number/2 && - echo foo > deeply/nested/directory/number/1/file && - echo foo > deeply/nested/directory/number/2/another && - svn_cmd import -m "import for git svn" . "$svnrepo" && - cd .. + ( + cd import && + mkdir -p deeply/nested/directory/number/1 && + mkdir -p deeply/nested/directory/number/2 && + echo foo >deeply/nested/directory/number/1/file && + echo foo >deeply/nested/directory/number/2/another && + svn_cmd import -m "import for git svn" . "$svnrepo" + ) ' test_expect_success 'mirror via git svn' ' diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh index bbfd7f4793..f7f3c5ab8e 100755 --- a/t/t9104-git-svn-follow-parent.sh +++ b/t/t9104-git-svn-follow-parent.sh @@ -8,22 +8,24 @@ test_description='git svn fetching' test_expect_success 'initialize repo' ' mkdir import && - cd import && - mkdir -p trunk && - echo hello > trunk/readme && - svn_cmd import -m "initial" . "$svnrepo" && - cd .. && + ( + cd import && + mkdir -p trunk && + echo hello >trunk/readme && + svn_cmd import -m "initial" . "$svnrepo" + ) && svn_cmd co "$svnrepo" wc && - cd wc && - echo world >> trunk/readme && - poke trunk/readme && - svn_cmd commit -m "another commit" && - svn_cmd up && - svn_cmd mv trunk thunk && - echo goodbye >> thunk/readme && - poke thunk/readme && - svn_cmd commit -m "bye now" && - cd .. + ( + cd wc && + echo world >>trunk/readme && + poke trunk/readme && + svn_cmd commit -m "another commit" && + svn_cmd up && + svn_cmd mv trunk thunk && + echo goodbye >>thunk/readme && + poke thunk/readme && + svn_cmd commit -m "bye now" + ) ' test_expect_success 'init and fetch a moved directory' ' @@ -83,16 +85,17 @@ test_expect_success 'follow larger parent' ' ' test_expect_success 'follow higher-level parent' ' - svn mkdir -m "follow higher-level parent" "$svnrepo"/blob && - svn co "$svnrepo"/blob blob && - cd blob && - echo hi > hi && - svn add hi && - svn commit -m "hihi" && - cd .. - svn mkdir -m "new glob at top level" "$svnrepo"/glob && - svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob && - git svn init --minimize-url -i blob "$svnrepo"/glob/blob && + svn mkdir -m "follow higher-level parent" "$svnrepo"/blob && + svn co "$svnrepo"/blob blob && + ( + cd blob && + echo hi > hi && + svn add hi && + svn commit -m "hihi" + ) && + svn mkdir -m "new glob at top level" "$svnrepo"/glob && + svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob && + git svn init --minimize-url -i blob "$svnrepo"/glob/blob && git svn fetch -i blob ' @@ -117,18 +120,23 @@ test_expect_success 'follow-parent avoids deleting relevant info' ' import/trunk/subversion/bindings/swig/perl/t/larger-parent && echo "bad delete test 2" > \ import/trunk/subversion/bindings/swig/perl/another-larger && - cd import && - svn import -m "r9270 test" . "$svnrepo"/r9270 && - cd .. && + ( + cd import && + svn import -m "r9270 test" . "$svnrepo"/r9270 + ) && svn_cmd co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 && - cd r9270 && - svn mkdir native && - svn mv t native/t && - for i in a b c; do svn mv $i.pm native/$i.pm; done && - echo z >> native/t/c.t && - poke native/t/c.t && - svn commit -m "reorg test" && - cd .. && + ( + cd r9270 && + svn mkdir native && + svn mv t native/t && + for i in a b c + do + svn mv $i.pm native/$i.pm + done && + echo z >>native/t/c.t && + poke native/t/c.t && + svn commit -m "reorg test" + ) && git svn init --minimize-url -i r9270-t \ "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t && git svn fetch -i r9270-t && diff --git a/t/t9105-git-svn-commit-diff.sh b/t/t9105-git-svn-commit-diff.sh index dd48e9cba8..5d0afeae6c 100755 --- a/t/t9105-git-svn-commit-diff.sh +++ b/t/t9105-git-svn-commit-diff.sh @@ -6,10 +6,11 @@ test_description='git svn commit-diff' test_expect_success 'initialize repo' ' mkdir import && - cd import && - echo hello > readme && - svn_cmd import -m "initial" . "$svnrepo" && - cd .. && + ( + cd import && + echo hello >readme && + svn_cmd import -m "initial" . "$svnrepo" + ) && echo hello > readme && git update-index --add readme && git commit -a -m "initial" && diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh index 12f21b700e..f6d7ac7c5f 100755 --- a/t/t9106-git-svn-commit-diff-clobber.sh +++ b/t/t9106-git-svn-commit-diff-clobber.sh @@ -6,21 +6,23 @@ test_description='git svn commit-diff clobber' test_expect_success 'initialize repo' ' mkdir import && - cd import && - echo initial > file && - svn_cmd import -m "initial" . "$svnrepo" && - cd .. && + ( + cd import && + echo initial >file && + svn_cmd import -m "initial" . "$svnrepo" + ) && echo initial > file && git update-index --add file && git commit -a -m "initial" ' test_expect_success 'commit change from svn side' ' svn_cmd co "$svnrepo" t.svn && - cd t.svn && - echo second line from svn >> file && - poke file && - svn_cmd commit -m "second line from svn" && - cd .. && + ( + cd t.svn && + echo second line from svn >>file && + poke file && + svn_cmd commit -m "second line from svn" + ) && rm -rf t.svn ' @@ -44,11 +46,12 @@ test_expect_success 'dcommit fails to commit because of conflict' ' git svn fetch && git reset --hard refs/${remotes_git_svn} && svn_cmd co "$svnrepo" t.svn && - cd t.svn && - echo fourth line from svn >> file && - poke file && - svn_cmd commit -m "fourth line from svn" && - cd .. && + ( + cd t.svn && + echo fourth line from svn >>file && + poke file && + svn_cmd commit -m "fourth line from svn" + ) && rm -rf t.svn && echo "fourth line from git" >> file && git commit -a -m "fourth line from git" && @@ -68,11 +71,12 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' " test_expect_success 'commit another change from svn side' ' svn_cmd co "$svnrepo" t.svn && - cd t.svn && - echo third line from svn >> file && + ( + cd t.svn && + echo third line from svn >>file && poke file && - svn_cmd commit -m "third line from svn" && - cd .. && + svn_cmd commit -m "third line from svn" + ) && rm -rf t.svn ' diff --git a/t/t9107-git-svn-migrate.sh b/t/t9107-git-svn-migrate.sh index 901b8e09fb..289fc313fb 100755 --- a/t/t9107-git-svn-migrate.sh +++ b/t/t9107-git-svn-migrate.sh @@ -6,14 +6,16 @@ test_description='git svn metadata migrations from previous versions' test_expect_success 'setup old-looking metadata' ' cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn && mkdir import && - cd import && - for i in trunk branches/a branches/b \ - tags/0.1 tags/0.2 tags/0.3; do - mkdir -p $i && \ - echo hello >> $i/README || exit 1 - done && \ + ( + cd import && + for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3 + do + mkdir -p $i && + echo hello >>$i/README || + exit 1 + done && svn_cmd import -m test . "$svnrepo" - cd .. && + ) && git svn init "$svnrepo" && git svn fetch && rm -rf "$GIT_DIR"/svn && diff --git a/t/t9114-git-svn-dcommit-merge.sh b/t/t9114-git-svn-dcommit-merge.sh index 84f7c9b4bb..3077851015 100755 --- a/t/t9114-git-svn-dcommit-merge.sh +++ b/t/t9114-git-svn-dcommit-merge.sh @@ -37,11 +37,12 @@ EOF test_expect_success 'setup svn repository' ' svn_cmd co "$svnrepo" mysvnwork && mkdir -p mysvnwork/trunk && - cd mysvnwork && - big_text_block >> trunk/README && + ( + cd mysvnwork && + big_text_block >>trunk/README && svn_cmd add trunk && - svn_cmd ci -m "first commit" trunk && - cd .. + svn_cmd ci -m "first commit" trunk + ) ' test_expect_success 'setup git mirror and merge' ' diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index 767799e7a7..6a48e40429 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -61,11 +61,12 @@ test_expect_success 'add a file with plus signs' ' test_expect_success 'clone the repository to test rebase' ' git svn clone "$svnrepo" test-rebase && - cd test-rebase && - echo test-rebase > test-rebase && + ( + cd test-rebase && + echo test-rebase >test-rebase && git add test-rebase && - git commit -m test-rebase && - cd .. + git commit -m test-rebase + ) ' test_expect_success 'make a commit to test rebase' ' diff --git a/t/t9116-git-svn-log.sh b/t/t9116-git-svn-log.sh index 0374a7476b..5d477e4bda 100755 --- a/t/t9116-git-svn-log.sh +++ b/t/t9116-git-svn-log.sh @@ -8,14 +8,16 @@ test_description='git svn log tests' test_expect_success 'setup repository and import' ' mkdir import && - cd import && - for i in trunk branches/a branches/b \ - tags/0.1 tags/0.2 tags/0.3; do - mkdir -p $i && \ - echo hello >> $i/README || exit 1 - done && \ + ( + cd import && + for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3 + do + mkdir -p $i && + echo hello >>$i/README || + exit 1 + done && svn_cmd import -m test . "$svnrepo" - cd .. && + ) && git svn init "$svnrepo" -T trunk -b branches -t tags && git svn fetch && git reset --hard trunk && diff --git a/t/t9119-git-svn-info.sh b/t/t9119-git-svn-info.sh index 5fb94fb3d6..f3f397cdda 100755 --- a/t/t9119-git-svn-info.sh +++ b/t/t9119-git-svn-info.sh @@ -39,27 +39,30 @@ quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')" test_expect_success 'setup repository and import' ' mkdir info && - cd info && - echo FIRST > A && - echo one > file && + ( + cd info && + echo FIRST >A && + echo one >file && ln -s file symlink-file && mkdir directory && touch directory/.placeholder && ln -s directory symlink-directory && - svn_cmd import -m "initial" . "$svnrepo" && - cd .. && + svn_cmd import -m "initial" . "$svnrepo" + ) && svn_cmd co "$svnrepo" svnwc && - cd svnwc && - echo foo > foo && + ( + cd svnwc && + echo foo >foo && svn_cmd add foo && svn_cmd commit -m "change outside directory" && - svn_cmd update && - cd .. && + svn_cmd update + ) && mkdir gitwc && - cd gitwc && + ( + cd gitwc && git svn init "$svnrepo" && - git svn fetch && - cd .. && + git svn fetch + ) && ptouch gitwc/file svnwc/file && ptouch gitwc/directory svnwc/directory && ptouch gitwc/symlink-file svnwc/symlink-file && @@ -138,14 +141,16 @@ test_expect_success 'info --url symlink-directory' ' test_expect_success 'info added-file' " echo two > gitwc/added-file && - cd gitwc && - git add added-file && - cd .. && + ( + cd gitwc && + git add added-file + ) && cp gitwc/added-file svnwc/added-file && ptouch gitwc/added-file svnwc/added-file && - cd svnwc && - svn_cmd add added-file > /dev/null && - cd .. && + ( + cd svnwc && + svn_cmd add added-file > /dev/null + ) && (cd svnwc; svn info added-file) > expected.info-added-file && (cd gitwc; git svn info added-file) > actual.info-added-file && test_cmp expected.info-added-file actual.info-added-file @@ -160,12 +165,14 @@ test_expect_success 'info added-directory' " mkdir gitwc/added-directory svnwc/added-directory && ptouch gitwc/added-directory svnwc/added-directory && touch gitwc/added-directory/.placeholder && - cd svnwc && - svn_cmd add added-directory > /dev/null && - cd .. && - cd gitwc && - git add added-directory && - cd .. && + ( + cd svnwc && + svn_cmd add added-directory > /dev/null + ) && + ( + cd gitwc && + git add added-directory + ) && (cd svnwc; svn info added-directory) \ > expected.info-added-directory && (cd gitwc; git svn info added-directory) \ @@ -179,14 +186,16 @@ test_expect_success 'info --url added-directory' ' ' test_expect_success 'info added-symlink-file' " - cd gitwc && + ( + cd gitwc && ln -s added-file added-symlink-file && - git add added-symlink-file && - cd .. && - cd svnwc && + git add added-symlink-file + ) && + ( + cd svnwc && ln -s added-file added-symlink-file && - svn_cmd add added-symlink-file > /dev/null && - cd .. && + svn_cmd add added-symlink-file > /dev/null + ) && ptouch gitwc/added-symlink-file svnwc/added-symlink-file && (cd svnwc; svn info added-symlink-file) \ > expected.info-added-symlink-file && @@ -202,14 +211,16 @@ test_expect_success 'info --url added-symlink-file' ' ' test_expect_success 'info added-symlink-directory' " - cd gitwc && + ( + cd gitwc && ln -s added-directory added-symlink-directory && - git add added-symlink-directory && - cd .. && - cd svnwc && + git add added-symlink-directory + ) && + ( + cd svnwc && ln -s added-directory added-symlink-directory && - svn_cmd add added-symlink-directory > /dev/null && - cd .. && + svn_cmd add added-symlink-directory > /dev/null + ) && ptouch gitwc/added-symlink-directory svnwc/added-symlink-directory && (cd svnwc; svn info added-symlink-directory) \ > expected.info-added-symlink-directory && @@ -230,12 +241,14 @@ test_expect_success 'info --url added-symlink-directory' ' # simply reuses the Last Changed Date. test_expect_success 'info deleted-file' " - cd gitwc && - git rm -f file > /dev/null && - cd .. && - cd svnwc && - svn_cmd rm --force file > /dev/null && - cd .. && + ( + cd gitwc && + git rm -f file > /dev/null + ) && + ( + cd svnwc && + svn_cmd rm --force file > /dev/null + ) && (cd svnwc; svn info file) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > expected.info-deleted-file && @@ -251,12 +264,14 @@ test_expect_success 'info --url file (deleted)' ' ' test_expect_success 'info deleted-directory' " - cd gitwc && - git rm -r -f directory > /dev/null && - cd .. && - cd svnwc && - svn_cmd rm --force directory > /dev/null && - cd .. && + ( + cd gitwc && + git rm -r -f directory > /dev/null + ) && + ( + cd svnwc && + svn_cmd rm --force directory > /dev/null + ) && (cd svnwc; svn info directory) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > expected.info-deleted-directory && @@ -272,12 +287,14 @@ test_expect_success 'info --url directory (deleted)' ' ' test_expect_success 'info deleted-symlink-file' " - cd gitwc && - git rm -f symlink-file > /dev/null && - cd .. && - cd svnwc && - svn_cmd rm --force symlink-file > /dev/null && - cd .. && + ( + cd gitwc && + git rm -f symlink-file > /dev/null + ) && + ( + cd svnwc && + svn_cmd rm --force symlink-file > /dev/null + ) && (cd svnwc; svn info symlink-file) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > expected.info-deleted-symlink-file && @@ -294,12 +311,14 @@ test_expect_success 'info --url symlink-file (deleted)' ' ' test_expect_success 'info deleted-symlink-directory' " - cd gitwc && - git rm -f symlink-directory > /dev/null && - cd .. && - cd svnwc && - svn_cmd rm --force symlink-directory > /dev/null && - cd .. && + ( + cd gitwc && + git rm -f symlink-directory > /dev/null + ) && + ( + cd svnwc && + svn_cmd rm --force symlink-directory > /dev/null + ) && (cd svnwc; svn info symlink-directory) | sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \ > expected.info-deleted-symlink-directory && @@ -346,9 +365,10 @@ test_expect_success 'info --url unknown-directory' ' ' test_expect_success 'info unknown-symlink-file' " - cd gitwc && - ln -s unknown-file unknown-symlink-file && - cd .. && + ( + cd gitwc && + ln -s unknown-file unknown-symlink-file + ) && (cd gitwc; test_must_fail git svn info unknown-symlink-file) \ 2> actual.info-unknown-symlink-file && grep unknown-symlink-file actual.info-unknown-symlink-file @@ -361,9 +381,10 @@ test_expect_success 'info --url unknown-symlink-file' ' ' test_expect_success 'info unknown-symlink-directory' " - cd gitwc && - ln -s unknown-directory unknown-symlink-directory && - cd .. && + ( + cd gitwc && + ln -s unknown-directory unknown-symlink-directory + ) && (cd gitwc; test_must_fail git svn info unknown-symlink-directory) \ 2> actual.info-unknown-symlink-directory && grep unknown-symlink-directory actual.info-unknown-symlink-directory diff --git a/t/t9120-git-svn-clone-with-percent-escapes.sh b/t/t9120-git-svn-clone-with-percent-escapes.sh index 9d9ebd533c..1d92c05035 100755 --- a/t/t9120-git-svn-clone-with-percent-escapes.sh +++ b/t/t9120-git-svn-clone-with-percent-escapes.sh @@ -20,9 +20,10 @@ test_expect_success 'setup svnrepo' ' 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 .. + ( + cd clone && + git rev-parse refs/${remotes_git_svn} + ) ' # SVN works either way, so should we... diff --git a/t/t9123-git-svn-rebuild-with-rewriteroot.sh b/t/t9123-git-svn-rebuild-with-rewriteroot.sh index 045521615c..0ed90d982d 100755 --- a/t/t9123-git-svn-rebuild-with-rewriteroot.sh +++ b/t/t9123-git-svn-rebuild-with-rewriteroot.sh @@ -8,10 +8,10 @@ test_description='git svn respects rewriteRoot during rebuild' . ./lib-git-svn.sh mkdir import -cd import +(cd import touch foo svn_cmd import -m 'import for git svn' . "$svnrepo" >/dev/null -cd .. +) rm -rf import test_expect_success 'init, fetch and checkout repository' ' diff --git a/t/t9125-git-svn-multi-glob-branch-names.sh b/t/t9125-git-svn-multi-glob-branch-names.sh index c19418614f..096abd1fe5 100755 --- a/t/t9125-git-svn-multi-glob-branch-names.sh +++ b/t/t9125-git-svn-multi-glob-branch-names.sh @@ -19,19 +19,19 @@ test_expect_success 'setup svnrepo' ' test_expect_success 'test clone with multi-glob in branch names' ' git svn clone -T trunk -b branches/*/* -t tags \ "$svnrepo/project" project && - cd project && + (cd project && git rev-parse "refs/remotes/v14.1/beta" && - git rev-parse "refs/remotes/v14.1/gold" && - cd .. + git rev-parse "refs/remotes/v14.1/gold" + ) ' test_expect_success 'test dcommit to multi-globbed branch' " - cd project && + (cd project && git reset --hard 'refs/remotes/v14.1/gold' && echo hello >> foo && git commit -m 'hello' -- foo && - git svn dcommit && - cd .. + git svn dcommit + ) " test_done diff --git a/t/t9127-git-svn-partial-rebuild.sh b/t/t9127-git-svn-partial-rebuild.sh index 4aab8ecc14..2e4789d061 100755 --- a/t/t9127-git-svn-partial-rebuild.sh +++ b/t/t9127-git-svn-partial-rebuild.sh @@ -9,27 +9,27 @@ test_description='git svn partial-rebuild tests' test_expect_success 'initialize svnrepo' ' mkdir import && ( - cd import && + (cd import && mkdir trunk branches tags && - cd trunk && - echo foo > foo && - cd .. && + (cd trunk && + echo foo > foo + ) && svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null && svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \ - -m "created branch a" && - cd .. && + -m "created branch a" + ) && rm -rf import && svn_cmd co "$svnrepo"/trunk trunk && - cd trunk && + (cd trunk && echo bar >> foo && - svn_cmd ci -m "updated trunk" && - cd .. && + svn_cmd ci -m "updated trunk" + ) && svn_cmd co "$svnrepo"/branches/a a && - cd a && + (cd a && echo baz >> a && svn_cmd add a && - svn_cmd ci -m "updated a" && - cd .. && + svn_cmd ci -m "updated a" + ) && git svn init --stdlayout "$svnrepo" ) ' @@ -41,11 +41,11 @@ test_expect_success 'import an early SVN revision into git' ' test_expect_success 'make full git mirror of SVN' ' mkdir mirror && ( - cd mirror && + (cd mirror && git init && git svn init --stdlayout "$svnrepo" && - git svn fetch && - cd .. + git svn fetch + ) ) ' diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh index 807e494a3a..4b034a67f3 100755 --- a/t/t9128-git-svn-cmd-branch.sh +++ b/t/t9128-git-svn-cmd-branch.sh @@ -9,19 +9,19 @@ test_description='git svn partial-rebuild tests' test_expect_success 'initialize svnrepo' ' mkdir import && ( - cd import && + (cd import && mkdir trunk branches tags && - cd trunk && - echo foo > foo && - cd .. && - svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null && - cd .. && + (cd trunk && + echo foo > foo + ) && + svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null + ) && rm -rf import && svn_cmd co "$svnrepo"/trunk trunk && - cd trunk && + (cd trunk && echo bar >> foo && - svn_cmd ci -m "updated trunk" && - cd .. && + svn_cmd ci -m "updated trunk" + ) && rm -rf trunk ) ' diff --git a/t/t9131-git-svn-empty-symlink.sh b/t/t9131-git-svn-empty-symlink.sh index 9a24a65b64..f762038f0e 100755 --- a/t/t9131-git-svn-empty-symlink.sh +++ b/t/t9131-git-svn-empty-symlink.sh @@ -88,7 +88,7 @@ test_expect_success 'enable broken symlink workaround' \ test_expect_success '"bar" is an empty file' 'test -f x/bar && ! test -s x/bar' test_expect_success 'get "bar" => symlink fix from svn' \ '(cd x && git svn rebase)' -test_expect_success SYMLINKS '"bar" becomes a symlink' 'test -L x/bar' +test_expect_success SYMLINKS '"bar" becomes a symlink' 'test -h x/bar' test_expect_success 'clone using git svn' 'git svn clone -r1 "$svnrepo" y' diff --git a/t/t9137-git-svn-dcommit-clobber-series.sh b/t/t9137-git-svn-dcommit-clobber-series.sh index 636ca0abb9..d60da63f7a 100755 --- a/t/t9137-git-svn-dcommit-clobber-series.sh +++ b/t/t9137-git-svn-dcommit-clobber-series.sh @@ -6,10 +6,10 @@ test_description='git svn dcommit clobber series' test_expect_success 'initialize repo' ' mkdir import && - cd import && + (cd import && awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file - svn_cmd import -m "initial" . "$svnrepo" && - cd .. && + svn_cmd import -m "initial" . "$svnrepo" + ) && git svn init "$svnrepo" && git svn fetch && test -e file @@ -19,14 +19,14 @@ test_expect_success '(supposedly) non-conflicting change from SVN' ' test x"`sed -n -e 58p < file`" = x58 && test x"`sed -n -e 61p < file`" = x61 && svn_cmd co "$svnrepo" tmp && - cd tmp && + (cd tmp && perl -i.bak -p -e "s/^58$/5588/" file && perl -i.bak -p -e "s/^61$/6611/" file && poke file && test x"`sed -n -e 58p < file`" = x5588 && test x"`sed -n -e 61p < file`" = x6611 && - svn_cmd commit -m "58 => 5588, 61 => 6611" && - cd .. + svn_cmd commit -m "58 => 5588, 61 => 6611" + ) ' test_expect_success 'some unrelated changes to git' " diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 96d07f1833..7c059204e9 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -1110,11 +1110,10 @@ test_expect_success \ 'P: supermodule & submodule mix' \ 'git fast-import <input && git checkout subuse1 && - rm -rf sub && mkdir sub && cd sub && + rm -rf sub && mkdir sub && (cd sub && git init && git fetch --update-head-ok .. refs/heads/sub:refs/heads/master && - git checkout master && - cd .. && + git checkout master) && git submodule init && git submodule update' diff --git a/t/t9401-git-cvsserver-crlf.sh b/t/t9401-git-cvsserver-crlf.sh index 925bd0fbed..1bbfd824e5 100755 --- a/t/t9401-git-cvsserver-crlf.sh +++ b/t/t9401-git-cvsserver-crlf.sh @@ -129,21 +129,22 @@ test_expect_success 'cvs co (use attributes)' ' ' test_expect_success 'adding files' ' - cd cvswork/subdir && + (cd cvswork && + (cd subdir && echo "more text" > src.c && GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 && marked_as . src.c "" && - echo "psuedo-binary" > temp.bin && - cd .. && + echo "psuedo-binary" > temp.bin + ) && GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 && marked_as subdir temp.bin "-kb" && cd subdir && GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 && marked_as . temp.bin "-kb" && marked_as . src.c "" + ) ' -cd "$WORKDIR" test_expect_success 'updating' ' git pull gitcvs.git && echo 'hi' > subdir/newfile.bin && @@ -153,9 +154,9 @@ test_expect_success 'updating' ' git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin && git commit -q -m "Add and change some files" && git push gitcvs.git >/dev/null && - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q update && - cd .. && + (cd cvswork && + GIT_CONFIG="$git_config" cvs -Q update + ) && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes "" && @@ -233,35 +234,35 @@ test_expect_success 'cvs co another copy (guess)' ' ' test_expect_success 'add text (guess)' ' - cd cvswork && + (cd cvswork && echo "simpleText" > simpleText.c && - GIT_CONFIG="$git_config" cvs -Q add simpleText.c && - cd .. && + GIT_CONFIG="$git_config" cvs -Q add simpleText.c + ) && marked_as cvswork simpleText.c "" ' test_expect_success 'add bin (guess)' ' - cd cvswork && + (cd cvswork && echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin && - GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin && - cd .. && + GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin + ) && marked_as cvswork simpleBin.bin -kb ' test_expect_success 'remove files (guess)' ' - cd cvswork && + (cd cvswork && GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h && - cd subdir && - GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin && - cd ../.. && + (cd subdir && + GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin + )) && marked_as cvswork/subdir withCr.bin -kb && marked_as cvswork/subdir file.h "" ' test_expect_success 'cvs ci (guess)' ' - cd cvswork && - GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1 && - cd .. && + (cd cvswork && + GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1 + ) && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes "" && @@ -278,9 +279,9 @@ test_expect_success 'cvs ci (guess)' ' ' test_expect_success 'update subdir of other copy (guess)' ' - cd cvswork2/subdir && - GIT_CONFIG="$git_config" cvs -Q update && - cd ../.. && + (cd cvswork2/subdir && + GIT_CONFIG="$git_config" cvs -Q update + ) && marked_as cvswork2 textfile.c "" && marked_as cvswork2 binfile.bin -kb && marked_as cvswork2 .gitattributes "" && @@ -304,11 +305,11 @@ test_expect_success 'update/merge full other copy (guess)' ' git add multilineTxt.c && git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" && git push gitcvs.git >/dev/null && - cd cvswork2 && + (cd cvswork2 && sed "s/1/replaced_1/" < multilineTxt.c > ml.temp && mv ml.temp multilineTxt.c && - GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1 && - cd .. && + GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1 + ) && marked_as cvswork2 textfile.c "" && marked_as cvswork2 binfile.bin -kb && marked_as cvswork2 .gitattributes "" && diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh index 559ce41795..432b82e3d5 100755 --- a/t/t9600-cvsimport.sh +++ b/t/t9600-cvsimport.sh @@ -14,7 +14,7 @@ test_expect_success PERL 'setup a cvs module' ' mkdir "$CVSROOT/module" && $CVS co -d module-cvs module && - cd module-cvs && + (cd module-cvs && cat <<EOF >o_fortuna && O Fortuna velut luna @@ -38,8 +38,8 @@ add "O Fortuna" lyrics These public domain lyrics make an excellent sample text. EOF - $CVS commit -F message && - cd .. + $CVS commit -F message + ) ' test_expect_success PERL 'import a trivial module' ' @@ -49,7 +49,7 @@ test_expect_success PERL 'import a trivial module' ' ' -test_expect_success PERL 'pack refs' 'cd module-git && git gc && cd ..' +test_expect_success PERL 'pack refs' '(cd module-git && git gc)' test_expect_success PERL 'initial import has correct .git/cvs-revisions' ' @@ -59,8 +59,7 @@ test_expect_success PERL 'initial import has correct .git/cvs-revisions' ' ' test_expect_success PERL 'update cvs module' ' - - cd module-cvs && + (cd module-cvs && cat <<EOF >o_fortuna && O Fortune, like the moon @@ -83,16 +82,16 @@ translate to English My Latin is terrible. EOF - $CVS commit -F message && - cd .. + $CVS commit -F message + ) ' test_expect_success PERL 'update git module' ' - cd module-git && + (cd module-git && git cvsimport -a -R -z 0 module && - git merge origin && - cd .. && + git merge origin + ) && test_cmp module-cvs/o_fortuna module-git/o_fortuna ' @@ -107,21 +106,20 @@ test_expect_success PERL 'update has correct .git/cvs-revisions' ' test_expect_success PERL 'update cvs module' ' - cd module-cvs && + (cd module-cvs && echo 1 >tick && $CVS add tick && $CVS commit -m 1 - cd .. - + ) ' test_expect_success PERL 'cvsimport.module config works' ' - cd module-git && + (cd module-git && git config cvsimport.module module && git cvsimport -a -R -z0 && - git merge origin && - cd .. && + git merge origin + ) && test_cmp module-cvs/tick module-git/tick ' @@ -138,12 +136,12 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' ' test_expect_success PERL 'import from a CVS working tree' ' $CVS co -d import-from-wt module && - cd import-from-wt && + (cd import-from-wt && git cvsimport -a -z0 && echo 1 >expect && git log -1 --pretty=format:%s%n >actual && - test_cmp actual expect && - cd .. + test_cmp actual expect + ) ' diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh index 93c4fa885e..52034c8f77 100755 --- a/t/t9603-cvsimport-patchsets.sh +++ b/t/t9603-cvsimport-patchsets.sh @@ -19,12 +19,12 @@ setup_cvs_test_repository t9603 test_expect_failure 'import with criss cross times on revisions' ' git cvsimport -p"-x" -C module-git module && - cd module-git && + (cd module-git && git log --pretty=format:%s > ../actual-master && git log A~2..A --pretty="format:%s %ad" -- > ../actual-A && echo "" >> ../actual-master && - echo "" >> ../actual-A && - cd .. && + echo "" >> ../actual-A + ) && echo "Rev 4 Rev 3 Rev 2 diff --git a/userdiff.c b/userdiff.c index e5522159b3..f9e05b548c 100644 --- a/userdiff.c +++ b/userdiff.c @@ -9,7 +9,23 @@ static int drivers_alloc; #define PATTERNS(name, pattern, word_regex) \ { name, NULL, -1, { pattern, REG_EXTENDED }, word_regex } +#define IPATTERN(name, pattern, word_regex) \ + { name, NULL, -1, { pattern, REG_EXTENDED | REG_ICASE }, word_regex } static struct userdiff_driver builtin_drivers[] = { +IPATTERN("fortran", + "!^([C*]|[ \t]*!)\n" + "!^[ \t]*MODULE[ \t]+PROCEDURE[ \t]\n" + "^[ \t]*((END[ \t]+)?(PROGRAM|MODULE|BLOCK[ \t]+DATA" + "|([^'\" \t]+[ \t]+)*(SUBROUTINE|FUNCTION))[ \t]+[A-Z].*)$", + /* -- */ + "[a-zA-Z][a-zA-Z0-9_]*" + "|\\.([Ee][Qq]|[Nn][Ee]|[Gg][TtEe]|[Ll][TtEe]|[Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee]|[Aa][Nn][Dd]|[Oo][Rr]|[Nn]?[Ee][Qq][Vv]|[Nn][Oo][Tt])\\." + /* numbers and format statements like 2E14.4, or ES12.6, 9X. + * Don't worry about format statements without leading digits since + * they would have been matched above as a variable anyway. */ + "|[-+]?[0-9.]+([AaIiDdEeFfLlTtXx][Ss]?[-+]?[0-9.]*)?(_[a-zA-Z0-9][a-zA-Z0-9_]*)?" + "|//|\\*\\*|::|[/<>=]=" + "|[^[:space:]]|[\x80-\xff]+"), PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", "[^<>= \t]+|[^[:space:]]|[\x80-\xff]+"), PATTERNS("java", @@ -101,6 +117,7 @@ PATTERNS("csharp", { "default", NULL, -1, { NULL, 0 } }, }; #undef PATTERNS +#undef IPATTERN static struct userdiff_driver driver_true = { "diff=true", diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c index 256a0522b2..6cfa256a37 100644 --- a/vcs-svn/fast_export.c +++ b/vcs-svn/fast_export.c @@ -25,7 +25,7 @@ void fast_export_modify(uint32_t depth, uint32_t *path, uint32_t mode, uint32_t mark) { /* Mode must be 100644, 100755, 120000, or 160000. */ - printf("M %06o :%d ", mode, mark); + printf("M %06"PRIo32" :%"PRIu32" ", mode, mark); pool_print_seq(depth, path, '/', stdout); putchar('\n'); } @@ -38,7 +38,8 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log, if (!log) log = ""; if (~uuid && ~url) { - snprintf(gitsvnline, MAX_GITSVN_LINE_LEN, "\n\ngit-svn-id: %s@%d %s\n", + snprintf(gitsvnline, MAX_GITSVN_LINE_LEN, + "\n\ngit-svn-id: %s@%"PRIu32" %s\n", pool_fetch(url), revision, pool_fetch(uuid)); } else { *gitsvnline = '\0'; @@ -59,7 +60,7 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log, repo_diff(revision - 1, revision); fputc('\n', stdout); - printf("progress Imported commit %d.\n\n", revision); + printf("progress Imported commit %"PRIu32".\n\n", revision); } void fast_export_blob(uint32_t mode, uint32_t mark, uint32_t len) @@ -69,7 +70,7 @@ void fast_export_blob(uint32_t mode, uint32_t mark, uint32_t len) buffer_skip_bytes(5); len -= 5; } - printf("blob\nmark :%d\ndata %d\n", mark, len); + printf("blob\nmark :%"PRIu32"\ndata %"PRIu32"\n", mark, len); buffer_copy_bytes(len); fputc('\n', stdout); } diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c index 630eeb53b7..53d0215d2d 100644 --- a/vcs-svn/svndump.c +++ b/vcs-svn/svndump.c @@ -257,7 +257,7 @@ void svndump_read(const char *url) handle_node(); active_ctx = REV_CTX; } else { - fprintf(stderr, "Unexpected content length header: %d\n", len); + fprintf(stderr, "Unexpected content length header: %"PRIu32"\n", len); buffer_skip_bytes(len); } } diff --git a/wt-status.c b/wt-status.c index 54b6b03b9c..fc2438f60b 100644 --- a/wt-status.c +++ b/wt-status.c @@ -390,11 +390,9 @@ static void wt_status_collect_untracked(struct wt_status *s) fill_directory(&dir, s->pathspec); for (i = 0; i < dir.nr; i++) { struct dir_entry *ent = dir.entries[i]; - if (!cache_name_is_other(ent->name, ent->len)) - continue; - if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL)) - continue; - string_list_insert(&s->untracked, ent->name); + if (cache_name_is_other(ent->name, ent->len) && + match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL)) + string_list_insert(&s->untracked, ent->name); free(ent); } @@ -404,11 +402,9 @@ static void wt_status_collect_untracked(struct wt_status *s) fill_directory(&dir, s->pathspec); for (i = 0; i < dir.nr; i++) { struct dir_entry *ent = dir.entries[i]; - if (!cache_name_is_other(ent->name, ent->len)) - continue; - if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL)) - continue; - string_list_insert(&s->ignored, ent->name); + if (cache_name_is_other(ent->name, ent->len) && + match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL)) + string_list_insert(&s->ignored, ent->name); free(ent); } } |