diff options
99 files changed, 4935 insertions, 2212 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile index 14286cb657..063fa696c9 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -66,12 +66,6 @@ endif -include ../config.mak # -# For asciidoc ... -# -7.1.2, set ASCIIDOC7 -# 8.0-, no extra settings are needed -# - -# # For docbook-xsl ... # -1.68.1, no extra settings are needed? # 1.69.0, set ASCIIDOC_ROFF? @@ -81,9 +75,6 @@ endif # 1.73.0-, no extra settings are needed # -ifndef ASCIIDOC7 -ASCIIDOC_EXTRA += -a asciidoc7compatible -endif ifdef DOCBOOK_XSL_172 ASCIIDOC_EXTRA += -a git-asciidoc-no-roff MANPAGE_XSL = manpage-1.72.xsl @@ -134,15 +125,6 @@ DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR)) ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)' endif -# -# Please note that there is a minor bug in asciidoc. -# The version after 6.0.3 _will_ include the patch found here: -# http://marc.theaimsgroup.com/?l=git&m=111558757202243&w=2 -# -# Until that version is released you may have to apply the patch -# yourself - yes, all 6 characters of it! -# - QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir QUIET_SUBDIR1 = @@ -280,6 +262,7 @@ technical/api-index.txt: technical/api-index-skel.txt \ technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS)) $(QUIET_GEN)cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh +technical/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \ $(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) $*.txt @@ -333,6 +316,7 @@ $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt WEBDOC_DEST = /pub/software/scm/git/docs +howto/%.html: ASCIIDOC_EXTRA += -a git-relative-html-prefix=../ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ sed -e '1,/^$$/d' $< | $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b xhtml11 - >$@+ && \ diff --git a/Documentation/RelNotes/1.7.10.5.txt b/Documentation/RelNotes/1.7.10.5.txt new file mode 100644 index 0000000000..4db1770e38 --- /dev/null +++ b/Documentation/RelNotes/1.7.10.5.txt @@ -0,0 +1,12 @@ +Git v1.7.10.5 Release Notes +=========================== + +Fixes since v1.7.10.4 +--------------------- + + * "git fast-export" did not give a readable error message when the + same mark erroneously appeared twice in the --import-marks input. + + * "git rebase -p" used to pay attention to rebase.autosquash which + was wrong. "git rebase -p -i" should, but "git rebase -p" by + itself should not. diff --git a/Documentation/RelNotes/1.7.11.1.txt b/Documentation/RelNotes/1.7.11.1.txt new file mode 100644 index 0000000000..577eccaacd --- /dev/null +++ b/Documentation/RelNotes/1.7.11.1.txt @@ -0,0 +1,9 @@ +Git v1.7.11.1 Release Notes +=========================== + +Fixes since v1.7.11 +------------------- + + * The cross links in the HTML version of manual pages were broken. + +Also contains minor typofixes and documentation updates. diff --git a/Documentation/RelNotes/1.7.11.txt b/Documentation/RelNotes/1.7.11.txt index f74adcc0be..15b954ca4b 100644 --- a/Documentation/RelNotes/1.7.11.txt +++ b/Documentation/RelNotes/1.7.11.txt @@ -18,10 +18,13 @@ UI, Workflows & Features * A third-party tool "git subtree" is distributed in contrib/ + * A remote helper that acts as a proxy and caches ssl session for the + https:// transport is added to the contrib/ area. + * Error messages given when @{u} is used for a branch without its - upstream configured have been clatified. + upstream configured have been clarified. - * Even with "-q"uiet option, "checkout" used to report setting up + * Even with the "-q"uiet option, "checkout" used to report setting up tracking. Also "branch" learned the "-q"uiet option to squelch informational message. @@ -37,8 +40,8 @@ UI, Workflows & Features * "git am" learned the "--include" option, which is an opposite of existing the "--exclude" option. - * When "git am -3" needs to fall back to an application to a - synthesized preimage followed by a 3-way merge, the paths that + * When "git am -3" needs to fall back to an application of the patch + to a synthesized preimage followed by a 3-way merge, the paths that needed such treatment are now reported to the end user, so that the result in them can be eyeballed with extra care. @@ -50,8 +53,9 @@ UI, Workflows & Features after populating two temporary directories, instead of running an instance of the external tool once per a file pair. - * The "fmt-merge-msg" command learns to list the primary contributors - involved in the side topic you are merging. + * The "fmt-merge-msg" command learned to list the primary contributors + involved in the side topic you are merging in a comment in the merge + commit template. * "git rebase" learned to optionally keep commits that do not introduce any change in the original history. @@ -67,15 +71,15 @@ UI, Workflows & Features Foreign Interface - * "git svn" used to die with unwanted SIGPIPE when talking with HTTP + * "git svn" used to die with unwanted SIGPIPE when talking with an HTTP server that uses keep-alive. * "git svn" learned to use platform specific authentication providers, e.g. gnome-keyring, kwallet, etc. - * "git p4" has been moved out of contrib/ area and has seen more work - on importing labels as tags from (and exporting tags as labels to) - p4. + * "git p4" has been moved out of the contrib/ area and has seen more + work on importing labels as tags from (and exporting tags as labels + to) p4. Performance and Internal Implementation (please report possible regressions) @@ -113,8 +117,8 @@ Performance and Internal Implementation (please report possible regressions) systems, run-command API now uses SHELL_PATH, not /bin/sh, when spawning an external command (not applicable to Windows port). - * The API to iterate over refs/ hierarchy has been tweaked to allow - walking only a subset of it more efficiently. + * The API to iterate over the refs/ hierarchy has been tweaked to + allow walking only a subset of it more efficiently. Also contains minor documentation updates and code clean-ups. @@ -126,11 +130,6 @@ Unless otherwise noted, all the fixes since v1.7.10 in the maintenance releases are contained in this release (see release notes to them for details). - * "git rebase -p" used to pay attention to rebase.autosquash which - was wrong. "git rebase -p -i" should, but "git rebase -p" by - itself should not. - (cherry-pick 8a6dae1 vr/rebase-autosquash-does-not-imply-i later to maint). - * "git submodule init" used to report "registered for path ..." even for submodules that were registered earlier. (cherry-pick c1c259e jl/submodule-report-new-path-once later to maint). diff --git a/Documentation/RelNotes/1.7.12.txt b/Documentation/RelNotes/1.7.12.txt new file mode 100644 index 0000000000..79cbb564c3 --- /dev/null +++ b/Documentation/RelNotes/1.7.12.txt @@ -0,0 +1,65 @@ +Git v1.7.12 Release Notes +========================= + +Updates since v1.7.11 +--------------------- + +UI, Workflows & Features + + * "git help" used to always default to "man" format even on platforms + where "man" viewer is not widely available. + + * "git clone --local $path" started its life as an experiment to + optionally use link/copy when cloning a repository on the disk, but + we didn't deprecate it after we made the option a no-op to always + use the optimization. The command learned "--no-local" option to + turn this off, as a more explicit alternative over use of file:// + URL. + + * git native protocol agents learned to show software version over + the wire, so that the server log can be examined to see the vintage + distribution of clients. + + +Foreign Interface + + +Performance, Internal Implementation, etc. (please report possible regressions) + + * Some tests showed false failures caused by a bug in ecryptofs. + + * We no longer use AsciiDoc7 syntax in our documentation and favor a + more modern style. + + +Also contains minor documentation updates and code clean-ups. + + +Fixes since v1.7.11 +------------------- + +Unless otherwise noted, all the fixes since v1.7.11 in the maintenance +releases are contained in this release (see release notes to them for +details). + + * The documentation for "git cherry-pick A B..C" was misleading. + (merge b98878e cn/cherry-pick-range-docs later to maint). + + * "git archive" incorrectly computed the header checksum; the symptom + was observed only when using pathnames with hi-bit set. + (merge a5a46eb jc/ustar-checksum-is-unsigned later to maint). + + * Running "git bundle verify" on a bundle that records a complete + history said "it requires these 0 commits". + (merge 8c3710f jc/bundle-complete-notice later to maint). + + * "git ls-files --exclude=t -i" did not consider anything under t/ as + excluded, as it did not pay attention to exclusion of leading paths + while walking the index. Other two users of excluded() are also + updated. + (merge 0d316f0 jc/ls-files-i-dir later to maint). + + * "git request-pull $url dev" when the tip of "dev" branch was tagged + with "ext4-for-linus" used the contents from the tag in the output + but still asked the "dev" branch to be pulled, not the tag. + (merge 682853e jc/request-pull-match-tagname later to maint). diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf index aea8627be0..a26d245ab4 100644 --- a/Documentation/asciidoc.conf +++ b/Documentation/asciidoc.conf @@ -90,6 +90,8 @@ endif::backend-docbook[] endif::doctype-manpage[] ifdef::backend-xhtml11[] +[attributes] +git-relative-html-prefix= [linkgit-inlinemacro] -<a href="{target}.html">{target}{0?({0})}</a> +<a href="{git-relative-html-prefix}{target}.html">{target}{0?({0})}</a> endif::backend-xhtml11[] diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt index 6aa1be0478..67a90a828c 100644 --- a/Documentation/diff-config.txt +++ b/Documentation/diff-config.txt @@ -54,7 +54,7 @@ and accumulating child directory counts in the parent directories: diff.statGraphWidth:: Limit the width of the graph part in --stat output. If set, applies - to all commands generating --stat outuput except format-patch. + to all commands generating --stat output except format-patch. diff.external:: If this config variable is set, diff generation is not diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 6cfedd85dc..cf4b216598 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -59,7 +59,7 @@ endif::git-format-patch[] Generate a diffstat. By default, as much space as necessary will be used for the filename part, and the rest for the graph part. Maximum width defaults to terminal width, or 80 columns - if not connected to a terminal, and can be overriden by + if not connected to a terminal, and can be overridden by `<width>`. The width of the filename part can be limited by giving another width `<name-width>` after a comma. The width of the graph part can be limited by using diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index 9f3dae631e..0e170a51ca 100644 --- a/Documentation/git-cherry-pick.txt +++ b/Documentation/git-cherry-pick.txt @@ -47,7 +47,9 @@ OPTIONS linkgit:gitrevisions[7]. Sets of commits can be passed but no traversal is done by default, as if the '--no-walk' option was specified, see - linkgit:git-rev-list[1]. + linkgit:git-rev-list[1]. Note that specifying a range will + feed all <commit>... arguments to a single revision walk + (see a later example that uses 'maint master..next'). -e:: --edit:: @@ -149,6 +151,15 @@ EXAMPLES Apply the changes introduced by all commits that are ancestors of master but not of HEAD to produce new commits. +`git cherry-pick maint next ^master`:: +`git cherry-pick maint master..next`:: + + Apply the changes introduced by all commits that are + ancestors of maint or next, but not master or any of its + ancestors. Note that the latter does not mean `maint` and + everything between `master` and `next`; specifically, + `maint` will not be used if it is included in `master`. + `git cherry-pick master~4 master~2`:: Apply the changes introduced by the fifth and third last diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 6e22522c4f..c1ddd4c2cc 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -46,13 +46,18 @@ OPTIONS mechanism and clones the repository by making a copy of HEAD and everything under objects and refs directories. The files under `.git/objects/` directory are hardlinked - to save space when possible. This is now the default when - the source repository is specified with `/path/to/repo` - syntax, so it essentially is a no-op option. To force - copying instead of hardlinking (which may be desirable - if you are trying to make a back-up of your repository), - but still avoid the usual "git aware" transport - mechanism, `--no-hardlinks` can be used. + to save space when possible. ++ +If the repository is specified as a local path (e.g., `/path/to/repo`), +this is the default, and --local is essentially a no-op. If the +repository is specified as a URL, then this flag is ignored (and we +never use the local optimizations). Specifying `--no-local` will +override the default when `/path/to/repo` is given, using the regular +git transport instead. ++ +To force copying instead of hardlinking (which may be desirable if you +are trying to make a back-up of your repository), but still avoid the +usual "git aware" transport mechanism, `--no-hardlinks` can be used. --no-hardlinks:: Optimize the cloning process from a repository on a diff --git a/Documentation/git-column.txt b/Documentation/git-column.txt index 9be16eea0e..5d6f1cc464 100644 --- a/Documentation/git-column.txt +++ b/Documentation/git-column.txt @@ -9,7 +9,7 @@ SYNOPSIS -------- [verse] 'git column' [--command=<name>] [--[raw-]mode=<mode>] [--width=<width>] - [--indent=<string>] [--nl=<string>] [--pading=<n>] + [--indent=<string>] [--nl=<string>] [--padding=<n>] DESCRIPTION ----------- diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt index eb8ee9999e..ff73286509 100644 --- a/Documentation/git-commit-tree.txt +++ b/Documentation/git-commit-tree.txt @@ -10,7 +10,7 @@ SYNOPSIS -------- [verse] 'git commit-tree' <tree> [(-p <parent>)...] < changelog -'git commit-tree' [(-p <parent>)...] [(-m <message>)...] [(-F <file>)...] <tree> +'git commit-tree' <tree> [(-p <parent>)...] [(-m <message>)...] [(-F <file>)...] DESCRIPTION ----------- @@ -45,7 +45,7 @@ OPTIONS Each '-p' indicates the id of a parent commit object. -m <message>:: - A paragraph in the commig log message. This can be given more than + A paragraph in the commit log message. This can be given more than once and each <message> becomes its own paragraph. -F <file>:: diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 2d695f619c..f400835921 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -101,12 +101,16 @@ OPTIONS When doing a dry-run, give the output in the short-format. See linkgit:git-status[1] for details. Implies `--dry-run`. +--branch:: + Show the branch and tracking info even in short-format. + --porcelain:: When doing a dry-run, give the output in a porcelain-ready format. See linkgit:git-status[1] for details. Implies `--dry-run`. -z:: +--null:: When showing `short` or `porcelain` status output, terminate entries in the status output with NUL, instead of LF. If no format is given, implies the `--porcelain` output format. @@ -189,6 +193,10 @@ OPTIONS current tip -- if it was a merge, it will have the parents of the current tip as parents -- so the current top commit is discarded. + +--no-post-rewrite:: + Bypass the post-rewrite hook. + + -- It is a rough equivalent for: diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 9e488c0aad..fbbbcb282c 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -140,7 +140,7 @@ update:: checkout the commit specified in the index of the containing repository. This will make the submodules HEAD be detached unless `--rebase` or `--merge` is specified or the key `submodule.$name.update` is set to - `rebase`, `merge` or `none`. `none` can be overriden by specifying + `rebase`, `merge` or `none`. `none` can be overridden by specifying `--checkout`. + If the submodule is not yet initialized, and you just want to use the diff --git a/Documentation/git.txt b/Documentation/git.txt index 55e405d644..d58fad71bd 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -44,9 +44,16 @@ 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.10.4/git.html[documentation for release 1.7.10.4] +* link:v1.7.11.1/git.html[documentation for release 1.7.11.1] * release notes for + link:RelNotes/1.7.11.1.txt[1.7.11.1], + link:RelNotes/1.7.11.txt[1.7.11]. + +* link:v1.7.10.5/git.html[documentation for release 1.7.10.5] + +* release notes for + link:RelNotes/1.7.10.5.txt[1.7.10.5], link:RelNotes/1.7.10.4.txt[1.7.10.4], link:RelNotes/1.7.10.3.txt[1.7.10.3], link:RelNotes/1.7.10.2.txt[1.7.10.2], @@ -728,7 +735,7 @@ other 'GIT_EDITOR':: This environment variable overrides `$EDITOR` and `$VISUAL`. - It is used by several git comands when, on interactive mode, + It is used by several git commands when, on interactive mode, an editor is to be launched. See also linkgit:git-var[1] and the `core.editor` option in linkgit:git-config[1]. diff --git a/Documentation/gitweb.conf.txt b/Documentation/gitweb.conf.txt index b9dd56753a..49474557d8 100644 --- a/Documentation/gitweb.conf.txt +++ b/Documentation/gitweb.conf.txt @@ -244,7 +244,7 @@ $highlight_bin:: By default set to 'highlight'; set it to full path to highlight executable if it is not installed on your web server's PATH. Note that 'highlight' feature must be set for gitweb to actually - use syntax hightlighting. + use syntax highlighting. + *NOTE*: if you want to add support for new file type (supported by "highlight" but not used by gitweb), you need to modify `%highlight_ext` diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 1ae3c899ef..84e34b1aba 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -622,6 +622,7 @@ These options are mostly targeted for packing of git repositories. --no-walk:: Only show the given revs, but do not traverse their ancestors. + This has no effect if a range is specified. --do-walk:: diff --git a/Documentation/technical/api-credentials.txt b/Documentation/technical/api-credentials.txt index 21ca6a2553..adb6f0c896 100644 --- a/Documentation/technical/api-credentials.txt +++ b/Documentation/technical/api-credentials.txt @@ -6,8 +6,52 @@ password credentials from the user (even though credentials in the wider world can take many forms, in this document the word "credential" always refers to a username and password pair). +This document describes two interfaces: the C API that the credential +subsystem provides to the rest of git, and the protocol that git uses to +communicate with system-specific "credential helpers". If you are +writing git code that wants to look up or prompt for credentials, see +the section "C API" below. If you want to write your own helper, see +the section on "Credential Helpers" below. + +Typical setup +------------- + +------------ ++-----------------------+ +| git code (C) |--- to server requiring ---> +| | authentication +|.......................| +| C credential API |--- prompt ---> User ++-----------------------+ + ^ | + | pipe | + | v ++-----------------------+ +| git credential helper | ++-----------------------+ +------------ + +The git code (typically a remote-helper) will call the C API to obtain +credential data like a login/password pair (credential_fill). The +API will itself call a remote helper (e.g. "git credential-cache" or +"git credential-store") that may retrieve credential data from a +store. If the credential helper cannot find the information, the C API +will prompt the user. Then, the caller of the API takes care of +contacting the server, and does the actual authentication. + +C API +----- + +The credential C API is meant to be called by git code which needs to +acquire or store a credential. It is centered around an object +representing a single credential and provides three basic operations: +fill (acquire credentials by calling helpers and/or prompting the user), +approve (mark a credential as successfully used so that it can be stored +for later use), and reject (mark a credential as unsuccessful so that it +can be erased from any persistent storage). + Data Structures ---------------- +~~~~~~~~~~~~~~~ `struct credential`:: @@ -21,14 +65,17 @@ Data Structures The `helpers` member of the struct is a `string_list` of helpers. Each string specifies an external helper which will be run, in order, to either acquire or store credentials. See the section on credential -helpers below. +helpers below. This list is filled-in by the API functions +according to the corresponding configuration variables before +consulting helpers, so there usually is no need for a caller to +modify the helpers field at all. + This struct should always be initialized with `CREDENTIAL_INIT` or `credential_init`. Functions ---------- +~~~~~~~~~ `credential_init`:: @@ -72,7 +119,7 @@ Functions Parse a URL into broken-down credential fields. Example -------- +~~~~~~~ The example below shows how the functions of the credential API could be used to login to a fictitious "foo" service on a remote host: @@ -135,8 +182,10 @@ credentials from and to long-term storage (where "long-term" is simply longer than a single git process; e.g., credentials may be stored in-memory for a few minutes, or indefinitely on disk). -Each helper is specified by a single string. The string is transformed -by git into a command to be executed using these rules: +Each helper is specified by a single string in the configuration +variable `credential.helper` (and others, see linkgit:git-config[1]). +The string is transformed by git into a command to be executed using +these rules: 1. If the helper string begins with "!", it is considered a shell snippet, and everything after the "!" becomes the command. @@ -243,3 +292,10 @@ request. If a helper receives any other operation, it should silently ignore the request. This leaves room for future operations to be added (older helpers will just ignore the new requests). + +See also +-------- + +linkgit:gitcredentials[7] + +linkgit:git-config[5] (See configuration variables `credential.*`) diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 1b942074b6..02ed5668e1 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1600,7 +1600,7 @@ dangling tree b24c2473f1fd3d91352a624795be026d64c8841f You will see informational messages on dangling objects. They are objects that still exist in the repository but are no longer referenced by any of your branches, and can (and will) be removed after a while with "gc". -You can run `git fsck --no-dangling` to supress these messages, and still +You can run `git fsck --no-dangling` to suppress these messages, and still view real errors. [[recovering-lost-changes]] diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 955b02b480..fde74a68d5 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.11-rc1 +DEF_VER=v1.7.11.GIT LF=' ' @@ -203,8 +203,6 @@ all:: # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks # field that counts the on-disk footprint in 512-byte blocks. # -# Define ASCIIDOC7 if you want to format documentation with AsciiDoc 7 -# # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72 # (not v1.73 or v1.71). # @@ -296,6 +294,13 @@ all:: # the diff algorithm. It gives a nice speedup if your processor has # fast unaligned word loads. Does NOT work on big-endian systems! # Enabled by default on x86_64. +# +# Define GIT_USER_AGENT if you want to change how git identifies itself during +# network interactions. The default is "git/$(GIT_VERSION)". +# +# Define DEFAULT_HELP_FORMAT to "man", "info" or "html" +# (defaults to "man") if you want to have a different default when +# "git help" is called without a parameter specifying the format. GIT-VERSION-FILE: FORCE @$(SHELL_PATH) ./GIT-VERSION-GEN @@ -799,6 +804,7 @@ LIB_OBJS += usage.o LIB_OBJS += userdiff.o LIB_OBJS += utf8.o LIB_OBJS += varint.o +LIB_OBJS += version.o LIB_OBJS += walker.o LIB_OBJS += wrapper.o LIB_OBJS += write_or_die.o @@ -904,6 +910,8 @@ BUILTIN_OBJS += builtin/write-tree.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) EXTLIBS = +GIT_USER_AGENT = git/$(GIT_VERSION) + # # Platform specific tweaks # @@ -1236,6 +1244,7 @@ ifeq ($(uname_S),Windows) BLK_SHA1 = YesPlease NO_POSIX_GOODIES = UnfortunatelyYes NATIVE_CRLF = YesPlease + DEFAULT_HELP_FORMAT = html CC = compat/vcbuild/scripts/clink.pl AR = compat/vcbuild/scripts/lib.pl @@ -1834,10 +1843,6 @@ ifndef V endif endif -ifdef ASCIIDOC7 - export ASCIIDOC7 -endif - ifdef NO_INSTALL_HARDLINKS export NO_INSTALL_HARDLINKS endif @@ -1915,6 +1920,15 @@ SHELL_PATH_CQ_SQ = $(subst ','\'',$(SHELL_PATH_CQ)) BASIC_CFLAGS += -DSHELL_PATH='$(SHELL_PATH_CQ_SQ)' endif +GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT)) +GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))" +GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ)) +BASIC_CFLAGS += -DGIT_USER_AGENT='$(GIT_USER_AGENT_CQ_SQ)' + +ifdef DEFAULT_HELP_FORMAT +BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"' +endif + ALL_CFLAGS += $(BASIC_CFLAGS) ALL_LDFLAGS += $(BASIC_LDFLAGS) @@ -1962,7 +1976,7 @@ strip: $(PROGRAMS) git$X $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X git.o: common-cmds.h -git.sp git.s git.o: EXTRA_CPPFLAGS = -DGIT_VERSION='"$(GIT_VERSION)"' \ +git.sp git.s git.o: EXTRA_CPPFLAGS = \ '-DGIT_HTML_PATH="$(htmldir_SQ)"' \ '-DGIT_MAN_PATH="$(mandir_SQ)"' \ '-DGIT_INFO_PATH="$(infodir_SQ)"' @@ -1979,6 +1993,9 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \ '-DGIT_MAN_PATH="$(mandir_SQ)"' \ '-DGIT_INFO_PATH="$(infodir_SQ)"' +version.sp version.s version.o: EXTRA_CPPFLAGS = \ + '-DGIT_VERSION="$(GIT_VERSION)"' + $(BUILT_INS): git$X $(QUIET_BUILT_IN)$(RM) $@ && \ ln git$X $@ 2>/dev/null || \ @@ -1996,6 +2013,7 @@ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \ -e 's|@@DIFF@@|$(DIFF_SQ)|' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ + -e 's|@@GIT_USER_AGENT@@|$(GIT_USER_AGENT_SQ)|g' \ -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \ -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \ @@ -2089,7 +2107,7 @@ configure: configure.ac $(RM) $<+ # These can record GIT_VERSION -git.o git.spec http.o \ +version.o git.spec \ $(patsubst %.sh,%,$(SCRIPT_SH)) \ $(patsubst %.perl,%,$(SCRIPT_PERL)) \ : GIT-VERSION-FILE @@ -2259,9 +2277,6 @@ attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \ gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \ -DGIT_LOCALE_PATH='"$(localedir_SQ)"' -http.sp http.s http.o: EXTRA_CPPFLAGS = \ - -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"' - ifdef NO_EXPAT http-walker.sp http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT endif @@ -1 +1 @@ -Documentation/RelNotes/1.7.11.txt
\ No newline at end of file +Documentation/RelNotes/1.7.12.txt
\ No newline at end of file diff --git a/archive-tar.c b/archive-tar.c index dc91c6b50d..0ba3f25cf5 100644 --- a/archive-tar.c +++ b/archive-tar.c @@ -139,13 +139,13 @@ static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword, static unsigned int ustar_header_chksum(const struct ustar_header *header) { - const char *p = (const char *)header; + const unsigned char *p = (const unsigned char *)header; unsigned int chksum = 0; - while (p < header->chksum) + while (p < (const unsigned char *)header->chksum) chksum += *p++; chksum += sizeof(header->chksum) * ' '; p += sizeof(header->chksum); - while (p < (const char *)header + sizeof(struct ustar_header)) + while (p < (const unsigned char *)header + sizeof(struct ustar_header)) chksum += *p++; return chksum; } @@ -74,25 +74,33 @@ void install_branch_config(int flag, const char *local, const char *origin, cons strbuf_addf(&key, "branch.%s.rebase", local); git_config_set(key.buf, "true"); } + strbuf_release(&key); if (flag & BRANCH_CONFIG_VERBOSE) { - strbuf_reset(&key); - - strbuf_addstr(&key, origin ? "remote" : "local"); - - /* Are we tracking a proper "branch"? */ - if (remote_is_branch) { - strbuf_addf(&key, " branch %s", shortname); - if (origin) - strbuf_addf(&key, " from %s", origin); - } + if (remote_is_branch && origin) + printf(rebasing ? + "Branch %s set up to track remote branch %s from %s by rebasing.\n" : + "Branch %s set up to track remote branch %s from %s.\n", + local, shortname, origin); + else if (remote_is_branch && !origin) + printf(rebasing ? + "Branch %s set up to track local branch %s by rebasing.\n" : + "Branch %s set up to track local branch %s.\n", + local, shortname); + else if (!remote_is_branch && origin) + printf(rebasing ? + "Branch %s set up to track remote ref %s by rebasing.\n" : + "Branch %s set up to track remote ref %s.\n", + local, remote); + else if (!remote_is_branch && !origin) + printf(rebasing ? + "Branch %s set up to track local ref %s by rebasing.\n" : + "Branch %s set up to track local ref %s.\n", + local, remote); else - strbuf_addf(&key, " ref %s", remote); - printf("Branch %s set up to track %s%s.\n", - local, key.buf, - rebasing ? " by rebasing" : ""); + die("BUG: impossible combination of %d and %p", + remote_is_branch, origin); } - strbuf_release(&key); } /* @@ -9,7 +9,6 @@ #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[]; @@ -41,6 +40,8 @@ int copy_note_for_rewrite(struct notes_rewrite_cfg *c, void finish_copy_notes_for_rewrite(struct notes_rewrite_cfg *c); extern int check_pager_config(const char *cmd); +struct diff_options; +extern void setup_diff_pager(struct diff_options *); extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, char **buf, unsigned long *buf_size); @@ -83,7 +84,6 @@ extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix extern int cmd_grep(int argc, const char **argv, const char *prefix); extern int cmd_hash_object(int argc, const char **argv, const char *prefix); extern int cmd_help(int argc, const char **argv, const char *prefix); -extern int cmd_http_fetch(int argc, const char **argv, const char *prefix); extern int cmd_index_pack(int argc, const char **argv, const char *prefix); extern int cmd_init_db(int argc, const char **argv, const char *prefix); extern int cmd_log(int argc, const char **argv, const char *prefix); @@ -108,7 +108,6 @@ extern int cmd_notes(int argc, const char **argv, const char *prefix); extern int cmd_pack_objects(int argc, const char **argv, const char *prefix); extern int cmd_pack_redundant(int argc, const char **argv, const char *prefix); extern int cmd_patch_id(int argc, const char **argv, const char *prefix); -extern int cmd_pickaxe(int argc, const char **argv, const char *prefix); extern int cmd_prune(int argc, const char **argv, const char *prefix); extern int cmd_prune_packed(int argc, const char **argv, const char *prefix); extern int cmd_push(int argc, const char **argv, const char *prefix); @@ -141,7 +140,6 @@ extern int cmd_update_ref(int argc, const char **argv, const char *prefix); extern int cmd_update_server_info(int argc, const char **argv, const char *prefix); extern int cmd_upload_archive(int argc, const char **argv, const char *prefix); extern int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix); -extern int cmd_upload_tar(int argc, const char **argv, const char *prefix); extern int cmd_var(int argc, const char **argv, const char *prefix); extern int cmd_verify_tag(int argc, const char **argv, const char *prefix); extern int cmd_version(int argc, const char **argv, const char *prefix); diff --git a/builtin/add.c b/builtin/add.c index b79336d712..87446cf92a 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -443,6 +443,9 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (pathspec) { int i; + struct path_exclude_check check; + + path_exclude_check_init(&check, &dir); if (!seen) seen = find_used_pathspec(pathspec); for (i = 0; pathspec[i]; i++) { @@ -450,7 +453,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) && !file_exists(pathspec[i])) { if (ignore_missing) { int dtype = DT_UNKNOWN; - if (excluded(&dir, pathspec[i], &dtype)) + if (path_excluded(&check, pathspec[i], -1, &dtype)) dir_add_ignored(&dir, pathspec[i], strlen(pathspec[i])); } else die(_("pathspec '%s' did not match any files"), @@ -458,6 +461,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) } } free(seen); + path_exclude_check_clear(&check); } plug_bulk_checkin(); diff --git a/builtin/clone.c b/builtin/clone.c index a4d8d25ee3..7f3b9823ce 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -38,7 +38,7 @@ static const char * const builtin_clone_usage[] = { }; static int option_no_checkout, option_bare, option_mirror, option_single_branch = -1; -static int option_local, option_no_hardlinks, option_shared, option_recursive; +static int option_local = -1, option_no_hardlinks, option_shared, option_recursive; static char *option_template, *option_depth; static char *option_origin = NULL; static char *option_branch = NULL; @@ -70,8 +70,8 @@ static struct option builtin_clone_options[] = { PARSE_OPT_NOARG | PARSE_OPT_HIDDEN }, OPT_BOOLEAN(0, "mirror", &option_mirror, "create a mirror repository (implies bare)"), - OPT_BOOLEAN('l', "local", &option_local, - "to clone from a local repository"), + OPT_BOOL('l', "local", &option_local, + "to clone from a local repository"), OPT_BOOLEAN(0, "no-hardlinks", &option_no_hardlinks, "don't use local hardlinks, always copy"), OPT_BOOLEAN('s', "shared", &option_shared, @@ -342,7 +342,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest, if (!option_no_hardlinks) { if (!link(src->buf, dest->buf)) continue; - if (option_local) + if (option_local > 0) die_errno(_("failed to create link '%s'"), dest->buf); option_no_hardlinks = 1; } @@ -668,7 +668,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) die(_("repository '%s' does not exist"), repo_name); else repo = repo_name; - is_local = path && !is_bundle; + is_local = option_local != 0 && path && !is_bundle; if (is_local && option_depth) warning(_("--depth is ignored in local clones; use file:// instead.")); diff --git a/builtin/diff.c b/builtin/diff.c index 9069dc41be..da8f6aac2b 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -304,13 +304,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix) DIFF_OPT_SET(&rev.diffopt, RECURSIVE); - /* - * If the user asked for our exit code then don't start a - * pager or we would end up reporting its exit code instead. - */ - if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS) && - check_pager_config("diff") != 0) - setup_pager(); + setup_diff_pager(&rev.diffopt); /* * Do we have --cached and not have a pending object, then @@ -421,3 +415,19 @@ int cmd_diff(int argc, const char **argv, const char *prefix) refresh_index_quietly(); return result; } + +void setup_diff_pager(struct diff_options *opt) +{ + /* + * If the user asked for our exit code, then either they want --quiet + * or --exit-code. We should definitely not bother with a pager in the + * former case, as we will generate no output. Since we still properly + * report our exit code even when a pager is run, we _could_ run a + * pager with --exit-code. But since we have not done so historically, + * and because it is easy to find people oneline advising "git diff + * --exit-code" in hooks and other scripts, we do not do so. + */ + if (!DIFF_OPT_TST(opt, EXIT_WITH_STATUS) && + check_pager_config("diff") != 0) + setup_pager(); +} diff --git a/builtin/fast-export.c b/builtin/fast-export.c index 19509ea754..ef7c012094 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -610,7 +610,7 @@ static void import_marks(char *input_file) die ("Could not read blob %s", sha1_to_hex(sha1)); if (object->flags & SHOWN) - error("Object %s already has a mark", sha1); + error("Object %s already has a mark", sha1_to_hex(sha1)); mark_object(object, mark); if (last_idnum < mark) diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index bf93b043b7..2c4d435da1 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -286,10 +286,10 @@ static void credit_people(struct strbuf *out, const char *me; if (kind == 'a') { - label = "\nBy "; + label = "\n# By "; me = git_author_info(IDENT_NO_DATE); } else { - label = "\nvia "; + label = "\n# Via "; me = git_committer_info(IDENT_NO_DATE); } diff --git a/builtin/grep.c b/builtin/grep.c index fe1726f5ef..29adb0ac93 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -928,7 +928,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (!seen_dashdash) { int j; for (j = i; j < argc; j++) - verify_filename(prefix, argv[j]); + verify_filename(prefix, argv[j], j == i); } paths = get_pathspec(prefix, argv + i); diff --git a/builtin/help.c b/builtin/help.c index 43d3c84449..8f9cd60548 100644 --- a/builtin/help.c +++ b/builtin/help.c @@ -12,6 +12,10 @@ #include "column.h" #include "help.h" +#ifndef DEFAULT_HELP_FORMAT +#define DEFAULT_HELP_FORMAT "man" +#endif + static struct man_viewer_list { struct man_viewer_list *next; char name[FLEX_ARRAY]; @@ -447,6 +451,8 @@ int cmd_help(int argc, const char **argv, const char *prefix) if (parsed_help_format != HELP_FORMAT_NONE) help_format = parsed_help_format; + if (help_format == HELP_FORMAT_NONE) + help_format = parse_help_format(DEFAULT_HELP_FORMAT); alias = alias_lookup(argv[0]); if (alias && !is_git_command(argv[0])) { diff --git a/builtin/index-pack.c b/builtin/index-pack.c index dc2cfe6e6f..8b5c1eb33e 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -9,6 +9,7 @@ #include "progress.h" #include "fsck.h" #include "exec_cmd.h" +#include "streaming.h" #include "thread-utils.h" static const char index_pack_usage[] = @@ -384,30 +385,62 @@ static void unlink_base_data(struct base_data *c) free_base_data(c); } -static void *unpack_entry_data(unsigned long offset, unsigned long size) +static int is_delta_type(enum object_type type) +{ + return (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA); +} + +static void *unpack_entry_data(unsigned long offset, unsigned long size, + enum object_type type, unsigned char *sha1) { + static char fixed_buf[8192]; int status; git_zstream stream; - void *buf = xmalloc(size); + void *buf; + git_SHA_CTX c; + char hdr[32]; + int hdrlen; + + if (!is_delta_type(type)) { + hdrlen = sprintf(hdr, "%s %lu", typename(type), size) + 1; + git_SHA1_Init(&c); + git_SHA1_Update(&c, hdr, hdrlen); + } else + sha1 = NULL; + if (type == OBJ_BLOB && size > big_file_threshold) + buf = fixed_buf; + else + buf = xmalloc(size); memset(&stream, 0, sizeof(stream)); git_inflate_init(&stream); stream.next_out = buf; - stream.avail_out = size; + stream.avail_out = buf == fixed_buf ? sizeof(fixed_buf) : size; do { + unsigned char *last_out = stream.next_out; stream.next_in = fill(1); stream.avail_in = input_len; status = git_inflate(&stream, 0); use(input_len - stream.avail_in); + if (sha1) + git_SHA1_Update(&c, last_out, stream.next_out - last_out); + if (buf == fixed_buf) { + stream.next_out = buf; + stream.avail_out = sizeof(fixed_buf); + } } while (status == Z_OK); if (stream.total_out != size || status != Z_STREAM_END) bad_object(offset, _("inflate returned %d"), status); git_inflate_end(&stream); - return buf; + if (sha1) + git_SHA1_Final(sha1, &c); + return buf == fixed_buf ? NULL : buf; } -static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_base) +static void *unpack_raw_entry(struct object_entry *obj, + union delta_base *delta_base, + unsigned char *sha1) { unsigned char *p; unsigned long size, c; @@ -467,12 +500,14 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_ } obj->hdr_size = consumed_bytes - obj->idx.offset; - data = unpack_entry_data(obj->idx.offset, obj->size); + data = unpack_entry_data(obj->idx.offset, obj->size, obj->type, sha1); obj->idx.crc32 = input_crc32; return data; } -static void *get_data_from_pack(struct object_entry *obj) +static void *unpack_data(struct object_entry *obj, + int (*consume)(const unsigned char *, unsigned long, void *), + void *cb_data) { off_t from = obj[0].idx.offset + obj[0].hdr_size; unsigned long len = obj[1].idx.offset - from; @@ -480,15 +515,16 @@ static void *get_data_from_pack(struct object_entry *obj) git_zstream stream; int status; - data = xmalloc(obj->size); + data = xmalloc(consume ? 64*1024 : obj->size); inbuf = xmalloc((len < 64*1024) ? len : 64*1024); memset(&stream, 0, sizeof(stream)); git_inflate_init(&stream); stream.next_out = data; - stream.avail_out = obj->size; + stream.avail_out = consume ? 64*1024 : obj->size; do { + unsigned char *last_out = stream.next_out; ssize_t n = (len < 64*1024) ? len : 64*1024; n = pread(pack_fd, inbuf, n, from); if (n < 0) @@ -503,6 +539,15 @@ static void *get_data_from_pack(struct object_entry *obj) stream.next_in = inbuf; stream.avail_in = n; status = git_inflate(&stream, 0); + if (consume) { + if (consume(last_out, stream.next_out - last_out, cb_data)) { + free(inbuf); + free(data); + return NULL; + } + stream.next_out = data; + stream.avail_out = 64*1024; + } } while (len && status == Z_OK && !stream.avail_in); /* This has been inflated OK when first encountered, so... */ @@ -511,9 +556,18 @@ static void *get_data_from_pack(struct object_entry *obj) git_inflate_end(&stream); free(inbuf); + if (consume) { + free(data); + data = NULL; + } return data; } +static void *get_data_from_pack(struct object_entry *obj) +{ + return unpack_data(obj, NULL, NULL); +} + static int compare_delta_bases(const union delta_base *base1, const union delta_base *base2, enum object_type type1, @@ -568,25 +622,102 @@ static void find_delta_children(const union delta_base *base, *last_index = last; } -static void sha1_object(const void *data, unsigned long size, - enum object_type type, unsigned char *sha1) +struct compare_data { + struct object_entry *entry; + struct git_istream *st; + unsigned char *buf; + unsigned long buf_size; +}; + +static int compare_objects(const unsigned char *buf, unsigned long size, + void *cb_data) +{ + struct compare_data *data = cb_data; + + if (data->buf_size < size) { + free(data->buf); + data->buf = xmalloc(size); + data->buf_size = size; + } + + while (size) { + ssize_t len = read_istream(data->st, data->buf, size); + if (len == 0) + die(_("SHA1 COLLISION FOUND WITH %s !"), + sha1_to_hex(data->entry->idx.sha1)); + if (len < 0) + die(_("unable to read %s"), + sha1_to_hex(data->entry->idx.sha1)); + if (memcmp(buf, data->buf, len)) + die(_("SHA1 COLLISION FOUND WITH %s !"), + sha1_to_hex(data->entry->idx.sha1)); + size -= len; + buf += len; + } + return 0; +} + +static int check_collison(struct object_entry *entry) +{ + struct compare_data data; + enum object_type type; + unsigned long size; + + if (entry->size <= big_file_threshold || entry->type != OBJ_BLOB) + return -1; + + memset(&data, 0, sizeof(data)); + data.entry = entry; + data.st = open_istream(entry->idx.sha1, &type, &size, NULL); + if (!data.st) + return -1; + if (size != entry->size || type != entry->type) + die(_("SHA1 COLLISION FOUND WITH %s !"), + sha1_to_hex(entry->idx.sha1)); + unpack_data(entry, compare_objects, &data); + close_istream(data.st); + free(data.buf); + return 0; +} + +static void sha1_object(const void *data, struct object_entry *obj_entry, + unsigned long size, enum object_type type, + const unsigned char *sha1) { - hash_sha1_file(data, size, typename(type), sha1); + void *new_data = NULL; + int collision_test_needed; + + assert(data || obj_entry); + read_lock(); - if (has_sha1_file(sha1)) { + collision_test_needed = has_sha1_file(sha1); + read_unlock(); + + if (collision_test_needed && !data) { + read_lock(); + if (!check_collison(obj_entry)) + collision_test_needed = 0; + read_unlock(); + } + if (collision_test_needed) { void *has_data; enum object_type has_type; unsigned long has_size; + read_lock(); + has_type = sha1_object_info(sha1, &has_size); + if (has_type != type || has_size != size) + die(_("SHA1 COLLISION FOUND WITH %s !"), sha1_to_hex(sha1)); has_data = read_sha1_file(sha1, &has_type, &has_size); read_unlock(); + if (!data) + data = new_data = get_data_from_pack(obj_entry); if (!has_data) die(_("cannot read existing object %s"), sha1_to_hex(sha1)); if (size != has_size || type != has_type || memcmp(data, has_data, size) != 0) die(_("SHA1 COLLISION FOUND WITH %s !"), sha1_to_hex(sha1)); free(has_data); - } else - read_unlock(); + } if (strict) { read_lock(); @@ -601,6 +732,9 @@ static void sha1_object(const void *data, unsigned long size, int eaten; void *buf = (void *) data; + if (!buf) + buf = new_data = get_data_from_pack(obj_entry); + /* * we do not need to free the memory here, as the * buf is deleted by the caller. @@ -625,11 +759,8 @@ static void sha1_object(const void *data, unsigned long size, } read_unlock(); } -} -static int is_delta_type(enum object_type type) -{ - return (type == OBJ_REF_DELTA || type == OBJ_OFS_DELTA); + free(new_data); } /* @@ -711,7 +842,9 @@ static void resolve_delta(struct object_entry *delta_obj, free(delta_data); if (!result->data) bad_object(delta_obj->idx.offset, _("failed to apply delta")); - sha1_object(result->data, result->size, delta_obj->real_type, + hash_sha1_file(result->data, result->size, + typename(delta_obj->real_type), delta_obj->idx.sha1); + sha1_object(result->data, NULL, result->size, delta_obj->real_type, delta_obj->idx.sha1); counter_lock(); nr_resolved_deltas++; @@ -841,7 +974,7 @@ static void *threaded_second_pass(void *data) */ static void parse_pack_objects(unsigned char *sha1) { - int i; + int i, nr_delays = 0; struct delta_entry *delta = deltas; struct stat st; @@ -851,14 +984,18 @@ static void parse_pack_objects(unsigned char *sha1) nr_objects); for (i = 0; i < nr_objects; i++) { struct object_entry *obj = &objects[i]; - void *data = unpack_raw_entry(obj, &delta->base); + void *data = unpack_raw_entry(obj, &delta->base, obj->idx.sha1); obj->real_type = obj->type; if (is_delta_type(obj->type)) { nr_deltas++; delta->obj_no = i; delta++; + } else if (!data) { + /* large blobs, check later */ + obj->real_type = OBJ_BAD; + nr_delays++; } else - sha1_object(data, obj->size, obj->type, obj->idx.sha1); + sha1_object(data, NULL, obj->size, obj->type, obj->idx.sha1); free(data); display_progress(progress, i+1); } @@ -878,6 +1015,17 @@ static void parse_pack_objects(unsigned char *sha1) if (S_ISREG(st.st_mode) && lseek(input_fd, 0, SEEK_CUR) - input_len != st.st_size) die(_("pack has junk at the end")); + + for (i = 0; i < nr_objects; i++) { + struct object_entry *obj = &objects[i]; + if (obj->real_type != OBJ_BAD) + continue; + obj->real_type = obj->type; + sha1_object(NULL, obj, obj->size, obj->type, obj->idx.sha1); + nr_delays--; + } + if (nr_delays) + die(_("confusion beyond insanity in parse_pack_objects()")); } /* diff --git a/builtin/log.c b/builtin/log.c index 906dca475a..4f1b42a685 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -21,6 +21,7 @@ #include "parse-options.h" #include "branch.h" #include "streaming.h" +#include "version.h" /* Set a default date-time format for git log ("log.date" config variable) */ static const char *default_date_mode = NULL; diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 7cff175745..31b3f2d900 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -200,9 +200,19 @@ static void show_ru_info(void) } } +static int ce_excluded(struct path_exclude_check *check, struct cache_entry *ce) +{ + int dtype = ce_to_dtype(ce); + return path_excluded(check, ce->name, ce_namelen(ce), &dtype); +} + static void show_files(struct dir_struct *dir) { int i; + struct path_exclude_check check; + + if ((dir->flags & DIR_SHOW_IGNORED)) + path_exclude_check_init(&check, dir); /* For cached/deleted files we don't need to even do the readdir */ if (show_others || show_killed) { @@ -215,9 +225,8 @@ static void show_files(struct dir_struct *dir) if (show_cached | show_stage) { for (i = 0; i < active_nr; i++) { struct cache_entry *ce = active_cache[i]; - int dtype = ce_to_dtype(ce); - if (dir->flags & DIR_SHOW_IGNORED && - !excluded(dir, ce->name, &dtype)) + if ((dir->flags & DIR_SHOW_IGNORED) && + !ce_excluded(&check, ce)) continue; if (show_unmerged && !ce_stage(ce)) continue; @@ -232,9 +241,8 @@ static void show_files(struct dir_struct *dir) struct cache_entry *ce = active_cache[i]; struct stat st; int err; - int dtype = ce_to_dtype(ce); - if (dir->flags & DIR_SHOW_IGNORED && - !excluded(dir, ce->name, &dtype)) + if ((dir->flags & DIR_SHOW_IGNORED) && + !ce_excluded(&check, ce)) continue; if (ce->ce_flags & CE_UPDATE) continue; @@ -247,6 +255,9 @@ static void show_files(struct dir_struct *dir) show_ce_entry(tag_modified, ce); } } + + if ((dir->flags & DIR_SHOW_IGNORED)) + path_exclude_check_clear(&check); } /* diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index ccfcbad146..f3348208d8 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -16,6 +16,7 @@ #include "list-objects.h" #include "progress.h" #include "refs.h" +#include "streaming.h" #include "thread-utils.h" static const char *pack_usage[] = { @@ -150,6 +151,46 @@ static unsigned long do_compress(void **pptr, unsigned long size) return stream.total_out; } +static unsigned long write_large_blob_data(struct git_istream *st, struct sha1file *f, + const unsigned char *sha1) +{ + git_zstream stream; + unsigned char ibuf[1024 * 16]; + unsigned char obuf[1024 * 16]; + unsigned long olen = 0; + + memset(&stream, 0, sizeof(stream)); + git_deflate_init(&stream, pack_compression_level); + + for (;;) { + ssize_t readlen; + int zret = Z_OK; + readlen = read_istream(st, ibuf, sizeof(ibuf)); + if (readlen == -1) + die(_("unable to read %s"), sha1_to_hex(sha1)); + + stream.next_in = ibuf; + stream.avail_in = readlen; + while ((stream.avail_in || readlen == 0) && + (zret == Z_OK || zret == Z_BUF_ERROR)) { + stream.next_out = obuf; + stream.avail_out = sizeof(obuf); + zret = git_deflate(&stream, readlen ? 0 : Z_FINISH); + sha1write(f, obuf, stream.next_out - obuf); + olen += stream.next_out - obuf; + } + if (stream.avail_in) + die(_("deflate error (%d)"), zret); + if (readlen == 0) { + if (zret != Z_STREAM_END) + die(_("deflate error (%d)"), zret); + break; + } + } + git_deflate_end(&stream); + return olen; +} + /* * we are going to reuse the existing object data as is. make * sure it is not corrupt. @@ -208,11 +249,18 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent unsigned hdrlen; enum object_type type; void *buf; + struct git_istream *st = NULL; if (!usable_delta) { - buf = read_sha1_file(entry->idx.sha1, &type, &size); - if (!buf) - die("unable to read %s", sha1_to_hex(entry->idx.sha1)); + if (entry->type == OBJ_BLOB && + entry->size > big_file_threshold && + (st = open_istream(entry->idx.sha1, &type, &size, NULL)) != NULL) + buf = NULL; + else { + buf = read_sha1_file(entry->idx.sha1, &type, &size); + if (!buf) + die(_("unable to read %s"), sha1_to_hex(entry->idx.sha1)); + } /* * make sure no cached delta data remains from a * previous attempt before a pack split occurred. @@ -233,7 +281,9 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent OBJ_OFS_DELTA : OBJ_REF_DELTA; } - if (entry->z_delta_size) + if (st) /* large blob case, just assume we don't compress well */ + datalen = size; + else if (entry->z_delta_size) datalen = entry->z_delta_size; else datalen = do_compress(&buf, size); @@ -256,6 +306,8 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent while (ofs >>= 7) dheader[--pos] = 128 | (--ofs & 127); if (limit && hdrlen + sizeof(dheader) - pos + datalen + 20 >= limit) { + if (st) + close_istream(st); free(buf); return 0; } @@ -268,6 +320,8 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent * an additional 20 bytes for the base sha1. */ if (limit && hdrlen + 20 + datalen + 20 >= limit) { + if (st) + close_istream(st); free(buf); return 0; } @@ -276,13 +330,20 @@ static unsigned long write_no_reuse_object(struct sha1file *f, struct object_ent hdrlen += 20; } else { if (limit && hdrlen + datalen + 20 >= limit) { + if (st) + close_istream(st); free(buf); return 0; } sha1write(f, header, hdrlen); } - sha1write(f, buf, datalen); - free(buf); + if (st) { + datalen = write_large_blob_data(st, f, entry->idx.sha1); + close_istream(st); + } else { + sha1write(f, buf, datalen); + free(buf); + } return hdrlen + datalen; } diff --git a/builtin/reflog.c b/builtin/reflog.c index 062d7dad1b..b3c9e27bde 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -330,8 +330,10 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1, printf("keep %s", message); return 0; prune: - if (!cb->newlog || cb->cmd->verbose) - printf("%sprune %s", cb->newlog ? "" : "would ", message); + if (!cb->newlog) + printf("would prune %s", message); + else if (cb->cmd->verbose) + printf("prune %s", message); return 0; } diff --git a/builtin/reset.c b/builtin/reset.c index 8c2c1d52a2..4cc34c9084 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -285,7 +285,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) rev = argv[i++]; } else { /* Otherwise we treat this as a filename */ - verify_filename(prefix, argv[i]); + verify_filename(prefix, argv[i], 1); } } diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 733f626f6c..13495b88f5 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -486,7 +486,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) if (as_is) { if (show_file(arg) && as_is < 2) - verify_filename(prefix, arg); + verify_filename(prefix, arg, 0); continue; } if (!strcmp(arg,"-n")) { @@ -734,7 +734,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) as_is = 1; if (!show_file(arg)) continue; - verify_filename(prefix, arg); + verify_filename(prefix, arg, 1); } if (verify) { if (revs_count == 1) { diff --git a/builtin/update-index.c b/builtin/update-index.c index 5f038d64da..5a4e9ea55a 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -211,12 +211,6 @@ static int process_path(const char *path) if (S_ISDIR(st.st_mode)) return process_directory(path, len, &st); - /* - * Process a regular file - */ - if (ce && S_ISGITLINK(ce->ce_mode)) - return error("%s is already a gitlink, not replacing", path); - return add_one_path(ce, path, len, &st); } @@ -188,12 +188,16 @@ int verify_bundle(struct bundle_header *header, int verbose) r->nr), r->nr); list_refs(r, 0, NULL); - r = &header->prerequisites; - printf_ln(Q_("The bundle requires this ref", - "The bundle requires these %d refs", - r->nr), - r->nr); - list_refs(r, 0, NULL); + if (!r->nr) { + printf_ln(_("The bundle records a complete history.")); + } else { + r = &header->prerequisites; + printf_ln(Q_("The bundle requires this ref", + "The bundle requires these %d refs", + r->nr), + r->nr); + list_refs(r, 0, NULL); + } } return ret; } @@ -409,7 +409,9 @@ extern const char *setup_git_directory(void); extern char *prefix_path(const char *prefix, int len, const char *path); extern const char *prefix_filename(const char *prefix, int len, const char *path); extern int check_filename(const char *prefix, const char *name); -extern void verify_filename(const char *prefix, const char *name); +extern void verify_filename(const char *prefix, + const char *name, + int diagnose_misspelt_rev); extern void verify_non_filename(const char *prefix, const char *name); #define INIT_DB_QUIET 0x0001 diff --git a/compat/nedmalloc/Readme.txt b/compat/nedmalloc/Readme.txt index 876365646e..e46d8f112c 100644 --- a/compat/nedmalloc/Readme.txt +++ b/compat/nedmalloc/Readme.txt @@ -100,7 +100,7 @@ v1.04alpha_svn915 7th October 2006: Thanks to Dmitry Chichkov for reporting this. Futher thanks to Aleksey Sanin. * Fixed realloc(0, <size>) segfaulting. Thanks to Dmitry Chichkov for reporting this. - * Made config defines #ifndef so they can be overriden by the build system. + * Made config defines #ifndef so they can be overridden by the build system. Thanks to Aleksey Sanin for suggesting this. * Fixed deadlock in nedprealloc() due to unnecessary locking of preferred thread mspace when mspace_realloc() always uses the original block's mspace diff --git a/config.mak.in b/config.mak.in index b2ba7104eb..802d34223a 100644 --- a/config.mak.in +++ b/config.mak.in @@ -28,7 +28,6 @@ VPATH = @srcdir@ export exec_prefix mandir export srcdir VPATH -ASCIIDOC7=@ASCIIDOC7@ NEEDS_SSL_WITH_CRYPTO=@NEEDS_SSL_WITH_CRYPTO@ NO_OPENSSL=@NO_OPENSSL@ NO_CURL=@NO_CURL@ diff --git a/configure.ac b/configure.ac index e1255506a6..4e9012f49b 100644 --- a/configure.ac +++ b/configure.ac @@ -437,21 +437,14 @@ if test -n "$ASCIIDOC"; then AC_MSG_CHECKING([for asciidoc version]) asciidoc_version=`$ASCIIDOC --version 2>/dev/null` case "${asciidoc_version}" in - asciidoc' '7*) - ASCIIDOC7=YesPlease - AC_MSG_RESULT([${asciidoc_version} > 7]) - ;; asciidoc' '8*) - ASCIIDOC7= AC_MSG_RESULT([${asciidoc_version}]) ;; *) - ASCIIDOC7= AC_MSG_RESULT([${asciidoc_version} (unknown)]) ;; esac fi -AC_SUBST(ASCIIDOC7) ## Checks for libraries. @@ -536,7 +536,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig, * Add support for ssh port: ssh://host.xy:<port>/... */ if (protocol == PROTO_SSH && host != url) - port = get_port(host); + port = get_port(end); if (protocol == PROTO_GIT) { /* These underlying connection commands die() if they diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 1689f99539..2e1b5e14b9 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -846,6 +846,8 @@ __git_list_porcelain_commands () checkout-index) : plumbing;; commit-tree) : plumbing;; count-objects) : infrequent;; + credential-cache) : credentials helper;; + credential-store) : credentials helper;; cvsexportcommit) : export;; cvsimport) : import;; cvsserver) : daemon;; @@ -2597,7 +2599,7 @@ _git_whatchanged () _git_log } -_main_git () +__git_main () { local i c=1 command __git_dir @@ -2648,7 +2650,7 @@ _main_git () fi } -_main_gitk () +__gitk_main () { __git_has_doubledash && return @@ -2703,22 +2705,22 @@ __git_complete () # wrapper for backwards compatibility _git () { - __git_wrap_main_git + __git_wrap__git_main } # wrapper for backwards compatibility _gitk () { - __git_wrap_main_gitk + __git_wrap__gitk_main } -__git_complete git _main_git -__git_complete gitk _main_gitk +__git_complete git __git_main +__git_complete gitk __gitk_main # The following are necessary only for Cygwin, and only are needed # when the user has tab-completed the executable name and consequently # included the '.exe' suffix. # if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then -__git_complete git.exe _main_git +__git_complete git.exe __git_main fi diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el index d351cfb6e7..e671f6c1c6 100644 --- a/contrib/emacs/git-blame.el +++ b/contrib/emacs/git-blame.el @@ -304,7 +304,7 @@ See also function `git-blame-mode'." (defun git-blame-cleanup () "Remove all blame properties" - (mapcar 'delete-overlay git-blame-overlays) + (mapc 'delete-overlay git-blame-overlays) (setq git-blame-overlays nil) (remove-git-blame-text-properties (point-min) (point-max))) @@ -337,16 +337,16 @@ See also function `git-blame-mode'." (defvar in-blame-filter nil) (defun git-blame-filter (proc str) - (save-excursion - (set-buffer (process-buffer proc)) - (goto-char (process-mark proc)) - (insert-before-markers str) - (goto-char 0) - (unless in-blame-filter - (let ((more t) - (in-blame-filter t)) - (while more - (setq more (git-blame-parse))))))) + (with-current-buffer (process-buffer proc) + (save-excursion + (goto-char (process-mark proc)) + (insert-before-markers str) + (goto-char (point-min)) + (unless in-blame-filter + (let ((more t) + (in-blame-filter t)) + (while more + (setq more (git-blame-parse)))))))) (defun git-blame-parse () (cond ((looking-at "\\([0-9a-f]\\{40\\}\\) \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\)\n") @@ -385,32 +385,33 @@ See also function `git-blame-mode'." info)))) (defun git-blame-create-overlay (info start-line num-lines) - (save-excursion - (set-buffer git-blame-file) - (let ((inhibit-point-motion-hooks t) - (inhibit-modification-hooks t)) - (goto-line start-line) - (let* ((start (point)) - (end (progn (forward-line num-lines) (point))) - (ovl (make-overlay start end)) - (hash (car info)) - (spec `((?h . ,(substring hash 0 6)) - (?H . ,hash) - (?a . ,(git-blame-get-info info 'author)) - (?A . ,(git-blame-get-info info 'author-mail)) - (?c . ,(git-blame-get-info info 'committer)) - (?C . ,(git-blame-get-info info 'committer-mail)) - (?s . ,(git-blame-get-info info 'summary))))) - (push ovl git-blame-overlays) - (overlay-put ovl 'git-blame info) - (overlay-put ovl 'help-echo - (format-spec git-blame-mouseover-format spec)) - (if git-blame-use-colors - (overlay-put ovl 'face (list :background - (cdr (assq 'color (cdr info)))))) - (overlay-put ovl 'line-prefix - (propertize (format-spec git-blame-prefix-format spec) - 'face 'git-blame-prefix-face)))))) + (with-current-buffer git-blame-file + (save-excursion + (let ((inhibit-point-motion-hooks t) + (inhibit-modification-hooks t)) + (goto-char (point-min)) + (forward-line (1- start-line)) + (let* ((start (point)) + (end (progn (forward-line num-lines) (point))) + (ovl (make-overlay start end)) + (hash (car info)) + (spec `((?h . ,(substring hash 0 6)) + (?H . ,hash) + (?a . ,(git-blame-get-info info 'author)) + (?A . ,(git-blame-get-info info 'author-mail)) + (?c . ,(git-blame-get-info info 'committer)) + (?C . ,(git-blame-get-info info 'committer-mail)) + (?s . ,(git-blame-get-info info 'summary))))) + (push ovl git-blame-overlays) + (overlay-put ovl 'git-blame info) + (overlay-put ovl 'help-echo + (format-spec git-blame-mouseover-format spec)) + (if git-blame-use-colors + (overlay-put ovl 'face (list :background + (cdr (assq 'color (cdr info)))))) + (overlay-put ovl 'line-prefix + (propertize (format-spec git-blame-prefix-format spec) + 'face 'git-blame-prefix-face))))))) (defun git-blame-add-info (info key value) (nconc info (list (cons (intern key) value)))) diff --git a/contrib/persistent-https/LICENSE b/contrib/persistent-https/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/contrib/persistent-https/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/contrib/persistent-https/Makefile b/contrib/persistent-https/Makefile new file mode 100644 index 0000000000..92baa3beee --- /dev/null +++ b/contrib/persistent-https/Makefile @@ -0,0 +1,38 @@ +# Copyright 2012 Google Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +BUILD_LABEL=$(shell date +"%s") +TAR_OUT=$(shell go env GOOS)_$(shell go env GOARCH).tar.gz + +all: git-remote-persistent-https git-remote-persistent-https--proxy \ + git-remote-persistent-http + +git-remote-persistent-https--proxy: git-remote-persistent-https + ln -f -s git-remote-persistent-https git-remote-persistent-https--proxy + +git-remote-persistent-http: git-remote-persistent-https + ln -f -s git-remote-persistent-https git-remote-persistent-http + +git-remote-persistent-https: + go build -o git-remote-persistent-https \ + -ldflags "-X main._BUILD_EMBED_LABEL $(BUILD_LABEL)" + +clean: + rm -f git-remote-persistent-http* *.tar.gz + +tar: clean all + @chmod 555 git-remote-persistent-https + @tar -czf $(TAR_OUT) git-remote-persistent-http* README LICENSE + @echo + @echo "Created $(TAR_OUT)" diff --git a/contrib/persistent-https/README b/contrib/persistent-https/README new file mode 100644 index 0000000000..f784dd2e66 --- /dev/null +++ b/contrib/persistent-https/README @@ -0,0 +1,62 @@ +git-remote-persistent-https + +The git-remote-persistent-https binary speeds up SSL operations +by running a daemon job (git-remote-persistent-https--proxy) that +keeps a connection open to a server. + + +PRE-BUILT BINARIES + +Darwin amd64: +https://commondatastorage.googleapis.com/git-remote-persistent-https/darwin_amd64.tar.gz + +Linux amd64: +https://commondatastorage.googleapis.com/git-remote-persistent-https/linux_amd64.tar.gz + + +INSTALLING + +Move all of the git-remote-persistent-http* binaries to a directory +in PATH. + + +USAGE + +HTTPS requests can be delegated to the proxy by using the +"persistent-https" scheme, e.g. + +git clone persistent-https://kernel.googlesource.com/pub/scm/git/git + +Likewise, .gitconfig can be updated as follows to rewrite https urls +to use persistent-https: + +[url "persistent-https"] + insteadof = https +[url "persistent-http"] + insteadof = http + + +##################################################################### +# BUILDING FROM SOURCE +##################################################################### + +LOCATION + +The source is available in the contrib/persistent-https directory of +the Git source repository. The Git source repository is available at +git://git.kernel.org/pub/scm/git/git.git/ +https://kernel.googlesource.com/pub/scm/git/git + + +PREREQUISITES + +The code is written in Go (http://golang.org/) and the Go compiler is +required. Currently, the compiler must be built and installed from tip +of source, in order to include a fix in the reverse http proxy: +http://code.google.com/p/go/source/detail?r=a615b796570a2cd8591884767a7d67ede74f6648 + + +BUILDING + +Run "make" to build the binaries. See the section on +INSTALLING above. diff --git a/contrib/persistent-https/client.go b/contrib/persistent-https/client.go new file mode 100644 index 0000000000..71125b5832 --- /dev/null +++ b/contrib/persistent-https/client.go @@ -0,0 +1,189 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "bufio" + "errors" + "fmt" + "net" + "net/url" + "os" + "os/exec" + "strings" + "syscall" + "time" +) + +type Client struct { + ProxyBin string + Args []string + + insecure bool +} + +func (c *Client) Run() error { + if err := c.resolveArgs(); err != nil { + return fmt.Errorf("resolveArgs() got error: %v", err) + } + + // Connect to the proxy. + uconn, hconn, addr, err := c.connect() + if err != nil { + return fmt.Errorf("connect() got error: %v", err) + } + // Keep the unix socket connection open for the duration of the request. + defer uconn.Close() + // Keep a connection to the HTTP server open, so no other user can + // bind on the same address so long as the process is running. + defer hconn.Close() + + // Start the git-remote-http subprocess. + cargs := []string{"-c", fmt.Sprintf("http.proxy=%v", addr), "remote-http"} + cargs = append(cargs, c.Args...) + cmd := exec.Command("git", cargs...) + + for _, v := range os.Environ() { + if !strings.HasPrefix(v, "GIT_PERSISTENT_HTTPS_SECURE=") { + cmd.Env = append(cmd.Env, v) + } + } + // Set the GIT_PERSISTENT_HTTPS_SECURE environment variable when + // the proxy is using a SSL connection. This allows credential helpers + // to identify secure proxy connections, despite being passed an HTTP + // scheme. + if !c.insecure { + cmd.Env = append(cmd.Env, "GIT_PERSISTENT_HTTPS_SECURE=1") + } + + cmd.Stdin = os.Stdin + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + if eerr, ok := err.(*exec.ExitError); ok { + if stat, ok := eerr.ProcessState.Sys().(syscall.WaitStatus); ok && stat.ExitStatus() != 0 { + os.Exit(stat.ExitStatus()) + } + } + return fmt.Errorf("git-remote-http subprocess got error: %v", err) + } + return nil +} + +func (c *Client) connect() (uconn net.Conn, hconn net.Conn, addr string, err error) { + uconn, err = DefaultSocket.Dial() + if err != nil { + if e, ok := err.(*net.OpError); ok && (os.IsNotExist(e.Err) || e.Err == syscall.ECONNREFUSED) { + if err = c.startProxy(); err == nil { + uconn, err = DefaultSocket.Dial() + } + } + if err != nil { + return + } + } + + if addr, err = c.readAddr(uconn); err != nil { + return + } + + // Open a tcp connection to the proxy. + if hconn, err = net.Dial("tcp", addr); err != nil { + return + } + + // Verify the address hasn't changed ownership. + var addr2 string + if addr2, err = c.readAddr(uconn); err != nil { + return + } else if addr != addr2 { + err = fmt.Errorf("address changed after connect. got %q, want %q", addr2, addr) + return + } + return +} + +func (c *Client) readAddr(conn net.Conn) (string, error) { + conn.SetDeadline(time.Now().Add(5 * time.Second)) + data := make([]byte, 100) + n, err := conn.Read(data) + if err != nil { + return "", fmt.Errorf("error reading unix socket: %v", err) + } else if n == 0 { + return "", errors.New("empty data response") + } + conn.Write([]byte{1}) // Ack + + var addr string + if addrs := strings.Split(string(data[:n]), "\n"); len(addrs) != 2 { + return "", fmt.Errorf("got %q, wanted 2 addresses", data[:n]) + } else if c.insecure { + addr = addrs[1] + } else { + addr = addrs[0] + } + return addr, nil +} + +func (c *Client) startProxy() error { + cmd := exec.Command(c.ProxyBin) + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + defer stdout.Close() + if err := cmd.Start(); err != nil { + return err + } + result := make(chan error) + go func() { + bytes, _, err := bufio.NewReader(stdout).ReadLine() + if line := string(bytes); err == nil && line != "OK" { + err = fmt.Errorf("proxy returned %q, want \"OK\"", line) + } + result <- err + }() + select { + case err := <-result: + return err + case <-time.After(5 * time.Second): + return errors.New("timeout waiting for proxy to start") + } + panic("not reachable") +} + +func (c *Client) resolveArgs() error { + if nargs := len(c.Args); nargs == 0 { + return errors.New("remote needed") + } else if nargs > 2 { + return fmt.Errorf("want at most 2 args, got %v", c.Args) + } + + // Rewrite the url scheme to be http. + idx := len(c.Args) - 1 + rawurl := c.Args[idx] + rurl, err := url.Parse(rawurl) + if err != nil { + return fmt.Errorf("invalid remote: %v", err) + } + c.insecure = rurl.Scheme == "persistent-http" + rurl.Scheme = "http" + c.Args[idx] = rurl.String() + if idx != 0 && c.Args[0] == rawurl { + c.Args[0] = c.Args[idx] + } + return nil +} diff --git a/contrib/persistent-https/main.go b/contrib/persistent-https/main.go new file mode 100644 index 0000000000..fd1b107743 --- /dev/null +++ b/contrib/persistent-https/main.go @@ -0,0 +1,82 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// The git-remote-persistent-https binary speeds up SSL operations by running +// a daemon job that keeps a connection open to a Git server. This ensures the +// git-remote-persistent-https--proxy is running and delegating execution +// to the git-remote-http binary with the http_proxy set to the daemon job. +// A unix socket is used to authenticate the proxy and discover the +// HTTP address. Note, both the client and proxy are included in the same +// binary. +package main + +import ( + "flag" + "fmt" + "log" + "os" + "strings" + "time" +) + +var ( + forceProxy = flag.Bool("proxy", false, "Whether to start the binary in proxy mode") + proxyBin = flag.String("proxy_bin", "git-remote-persistent-https--proxy", "Path to the proxy binary") + printLabel = flag.Bool("print_label", false, "Prints the build label for the binary") + + // Variable that should be defined through the -X linker flag. + _BUILD_EMBED_LABEL string +) + +const ( + defaultMaxIdleDuration = 24 * time.Hour + defaultPollUpdateInterval = 15 * time.Minute +) + +func main() { + flag.Parse() + if *printLabel { + // Short circuit execution to print the build label + fmt.Println(buildLabel()) + return + } + + var err error + if *forceProxy || strings.HasSuffix(os.Args[0], "--proxy") { + log.SetPrefix("git-remote-persistent-https--proxy: ") + proxy := &Proxy{ + BuildLabel: buildLabel(), + MaxIdleDuration: defaultMaxIdleDuration, + PollUpdateInterval: defaultPollUpdateInterval, + } + err = proxy.Run() + } else { + log.SetPrefix("git-remote-persistent-https: ") + client := &Client{ + ProxyBin: *proxyBin, + Args: flag.Args(), + } + err = client.Run() + } + if err != nil { + log.Fatalln(err) + } +} + +func buildLabel() string { + if _BUILD_EMBED_LABEL == "" { + log.Println(`unlabeled build; build with "make" to label`) + } + return _BUILD_EMBED_LABEL +} diff --git a/contrib/persistent-https/proxy.go b/contrib/persistent-https/proxy.go new file mode 100644 index 0000000000..bb0cdba386 --- /dev/null +++ b/contrib/persistent-https/proxy.go @@ -0,0 +1,190 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "log" + "net" + "net/http" + "net/http/httputil" + "os" + "os/exec" + "os/signal" + "sync" + "syscall" + "time" +) + +type Proxy struct { + BuildLabel string + MaxIdleDuration time.Duration + PollUpdateInterval time.Duration + + ul net.Listener + httpAddr string + httpsAddr string +} + +func (p *Proxy) Run() error { + hl, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + return fmt.Errorf("http listen failed: %v", err) + } + defer hl.Close() + + hsl, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + return fmt.Errorf("https listen failed: %v", err) + } + defer hsl.Close() + + p.ul, err = DefaultSocket.Listen() + if err != nil { + c, derr := DefaultSocket.Dial() + if derr == nil { + c.Close() + fmt.Println("OK\nA proxy is already running... exiting") + return nil + } else if e, ok := derr.(*net.OpError); ok && e.Err == syscall.ECONNREFUSED { + // Nothing is listening on the socket, unlink it and try again. + syscall.Unlink(DefaultSocket.Path()) + p.ul, err = DefaultSocket.Listen() + } + if err != nil { + return fmt.Errorf("unix listen failed on %v: %v", DefaultSocket.Path(), err) + } + } + defer p.ul.Close() + go p.closeOnSignal() + go p.closeOnUpdate() + + p.httpAddr = hl.Addr().String() + p.httpsAddr = hsl.Addr().String() + fmt.Printf("OK\nListening on unix socket=%v http=%v https=%v\n", + p.ul.Addr(), p.httpAddr, p.httpsAddr) + + result := make(chan error, 2) + go p.serveUnix(result) + go func() { + result <- http.Serve(hl, &httputil.ReverseProxy{ + FlushInterval: 500 * time.Millisecond, + Director: func(r *http.Request) {}, + }) + }() + go func() { + result <- http.Serve(hsl, &httputil.ReverseProxy{ + FlushInterval: 500 * time.Millisecond, + Director: func(r *http.Request) { + r.URL.Scheme = "https" + }, + }) + }() + return <-result +} + +type socketContext struct { + sync.WaitGroup + mutex sync.Mutex + last time.Time +} + +func (sc *socketContext) Done() { + sc.mutex.Lock() + defer sc.mutex.Unlock() + sc.last = time.Now() + sc.WaitGroup.Done() +} + +func (p *Proxy) serveUnix(result chan<- error) { + sockCtx := &socketContext{} + go p.closeOnIdle(sockCtx) + + var err error + for { + var uconn net.Conn + uconn, err = p.ul.Accept() + if err != nil { + err = fmt.Errorf("accept failed: %v", err) + break + } + sockCtx.Add(1) + go p.handleUnixConn(sockCtx, uconn) + } + sockCtx.Wait() + result <- err +} + +func (p *Proxy) handleUnixConn(sockCtx *socketContext, uconn net.Conn) { + defer sockCtx.Done() + defer uconn.Close() + data := []byte(fmt.Sprintf("%v\n%v", p.httpsAddr, p.httpAddr)) + uconn.SetDeadline(time.Now().Add(5 * time.Second)) + for i := 0; i < 2; i++ { + if n, err := uconn.Write(data); err != nil { + log.Printf("error sending http addresses: %+v\n", err) + return + } else if n != len(data) { + log.Printf("sent %d data bytes, wanted %d\n", n, len(data)) + return + } + if _, err := uconn.Read([]byte{0, 0, 0, 0}); err != nil { + log.Printf("error waiting for Ack: %+v\n", err) + return + } + } + // Wait without a deadline for the client to finish via EOF + uconn.SetDeadline(time.Time{}) + uconn.Read([]byte{0, 0, 0, 0}) +} + +func (p *Proxy) closeOnIdle(sockCtx *socketContext) { + for d := p.MaxIdleDuration; d > 0; { + time.Sleep(d) + sockCtx.Wait() + sockCtx.mutex.Lock() + if d = sockCtx.last.Add(p.MaxIdleDuration).Sub(time.Now()); d <= 0 { + log.Println("graceful shutdown from idle timeout") + p.ul.Close() + } + sockCtx.mutex.Unlock() + } +} + +func (p *Proxy) closeOnUpdate() { + for { + time.Sleep(p.PollUpdateInterval) + if out, err := exec.Command(os.Args[0], "--print_label").Output(); err != nil { + log.Printf("error polling for updated binary: %v\n", err) + } else if s := string(out[:len(out)-1]); p.BuildLabel != s { + log.Printf("graceful shutdown from updated binary: %q --> %q\n", p.BuildLabel, s) + p.ul.Close() + break + } + } +} + +func (p *Proxy) closeOnSignal() { + ch := make(chan os.Signal, 10) + signal.Notify(ch, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM), os.Signal(syscall.SIGHUP)) + sig := <-ch + p.ul.Close() + switch sig { + case os.Signal(syscall.SIGHUP): + log.Printf("graceful shutdown from signal: %v\n", sig) + default: + log.Fatalf("exiting from signal: %v\n", sig) + } +} diff --git a/contrib/persistent-https/socket.go b/contrib/persistent-https/socket.go new file mode 100644 index 0000000000..193b911dd1 --- /dev/null +++ b/contrib/persistent-https/socket.go @@ -0,0 +1,97 @@ +// Copyright 2012 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "log" + "net" + "os" + "path/filepath" + "syscall" +) + +// A Socket is a wrapper around a Unix socket that verifies directory +// permissions. +type Socket struct { + Dir string +} + +func defaultDir() string { + sockPath := ".git-credential-cache" + if home := os.Getenv("HOME"); home != "" { + return filepath.Join(home, sockPath) + } + log.Printf("socket: cannot find HOME path. using relative directory %q for socket", sockPath) + return sockPath +} + +// DefaultSocket is a Socket in the $HOME/.git-credential-cache directory. +var DefaultSocket = Socket{Dir: defaultDir()} + +// Listen announces the local network address of the unix socket. The +// permissions on the socket directory are verified before attempting +// the actual listen. +func (s Socket) Listen() (net.Listener, error) { + network, addr := "unix", s.Path() + if err := s.mkdir(); err != nil { + return nil, &net.OpError{Op: "listen", Net: network, Addr: &net.UnixAddr{Name: addr, Net: network}, Err: err} + } + return net.Listen(network, addr) +} + +// Dial connects to the unix socket. The permissions on the socket directory +// are verified before attempting the actual dial. +func (s Socket) Dial() (net.Conn, error) { + network, addr := "unix", s.Path() + if err := s.checkPermissions(); err != nil { + return nil, &net.OpError{Op: "dial", Net: network, Addr: &net.UnixAddr{Name: addr, Net: network}, Err: err} + } + return net.Dial(network, addr) +} + +// Path returns the fully specified file name of the unix socket. +func (s Socket) Path() string { + return filepath.Join(s.Dir, "persistent-https-proxy-socket") +} + +func (s Socket) mkdir() error { + if err := s.checkPermissions(); err == nil { + return nil + } else if !os.IsNotExist(err) { + return err + } + if err := os.MkdirAll(s.Dir, 0700); err != nil { + return err + } + return s.checkPermissions() +} + +func (s Socket) checkPermissions() error { + fi, err := os.Stat(s.Dir) + if err != nil { + return err + } + if !fi.IsDir() { + return fmt.Errorf("socket: got file, want directory for %q", s.Dir) + } + if fi.Mode().Perm() != 0700 { + return fmt.Errorf("socket: got perm %o, want 700 for %q", fi.Mode().Perm(), s.Dir) + } + if st := fi.Sys().(*syscall.Stat_t); int(st.Uid) != os.Getuid() { + return fmt.Errorf("socket: got uid %d, want %d for %q", st.Uid, os.Getuid(), s.Dir) + } + return nil +} diff --git a/diff-no-index.c b/diff-no-index.c index f0b0010aed..77667b810d 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -224,13 +224,6 @@ void diff_no_index(struct rev_info *revs, } } - /* - * If the user asked for our exit code then don't start a - * pager or we would end up reporting its exit code instead. - */ - if (!DIFF_OPT_TST(&revs->diffopt, EXIT_WITH_STATUS)) - setup_pager(); - if (prefix) { int len = strlen(prefix); const char *paths[3]; @@ -255,13 +248,15 @@ void diff_no_index(struct rev_info *revs, if (!revs->diffopt.output_format) revs->diffopt.output_format = DIFF_FORMAT_PATCH; - DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS); DIFF_OPT_SET(&revs->diffopt, NO_INDEX); revs->max_count = -2; if (diff_setup_done(&revs->diffopt) < 0) die("diff_setup_done failed"); + setup_diff_pager(&revs->diffopt); + DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS); + if (queue_diff(&revs->diffopt, revs->diffopt.pathspec.raw[0], revs->diffopt.pathspec.raw[1])) exit(1); @@ -1700,7 +1700,7 @@ static void show_shortstats(struct diffstat_t *data, struct diff_options *option continue; if (!data->files[i]->is_renamed && (added + deleted == 0)) { total_files--; - } else { + } else if (!data->files[i]->is_binary) { /* don't count bytes */ adds += added; dels += deleted; } @@ -288,9 +288,24 @@ int match_pathspec_depth(const struct pathspec *ps, return retval; } +/* + * Return the length of the "simple" part of a path match limiter. + */ +static int simple_length(const char *match) +{ + int len = -1; + + for (;;) { + unsigned char c = *match++; + len++; + if (c == '\0' || is_glob_special(c)) + return len; + } +} + static int no_wildcard(const char *string) { - return string[strcspn(string, "*?[{\\")] == '\0'; + return string[simple_length(string)] == '\0'; } void add_exclude(const char *string, const char *base, @@ -326,8 +341,7 @@ void add_exclude(const char *string, const char *base, x->flags = flags; if (!strchr(string, '/')) x->flags |= EXC_FLAG_NODIR; - if (no_wildcard(string)) - x->flags |= EXC_FLAG_NOWILDCARD; + x->nowildcardlen = simple_length(string); if (*string == '*' && no_wildcard(string+1)) x->flags |= EXC_FLAG_ENDSWITH; ALLOC_GROW(which->excludes, which->nr + 1, which->alloc); @@ -498,62 +512,74 @@ int excluded_from_list(const char *pathname, { int i; - if (el->nr) { - for (i = el->nr - 1; 0 <= i; i--) { - struct exclude *x = el->excludes[i]; - const char *exclude = x->pattern; - int to_exclude = x->to_exclude; - - if (x->flags & EXC_FLAG_MUSTBEDIR) { - if (*dtype == DT_UNKNOWN) - *dtype = get_dtype(NULL, pathname, pathlen); - if (*dtype != DT_DIR) - continue; - } + if (!el->nr) + return -1; /* undefined */ - if (x->flags & EXC_FLAG_NODIR) { - /* match basename */ - if (x->flags & EXC_FLAG_NOWILDCARD) { - if (!strcmp_icase(exclude, basename)) - return to_exclude; - } else if (x->flags & EXC_FLAG_ENDSWITH) { - if (x->patternlen - 1 <= pathlen && - !strcmp_icase(exclude + 1, pathname + pathlen - x->patternlen + 1)) - return to_exclude; - } else { - if (fnmatch_icase(exclude, basename, 0) == 0) - return to_exclude; - } - } - else { - /* match with FNM_PATHNAME: - * exclude has base (baselen long) implicitly - * in front of it. - */ - int baselen = x->baselen; - if (*exclude == '/') - exclude++; - - if (pathlen < baselen || - (baselen && pathname[baselen-1] != '/') || - strncmp_icase(pathname, x->base, baselen)) - continue; - - if (x->flags & EXC_FLAG_NOWILDCARD) { - if (!strcmp_icase(exclude, pathname + baselen)) - return to_exclude; - } else { - if (fnmatch_icase(exclude, pathname+baselen, - FNM_PATHNAME) == 0) - return to_exclude; - } + for (i = el->nr - 1; 0 <= i; i--) { + struct exclude *x = el->excludes[i]; + const char *name, *exclude = x->pattern; + int to_exclude = x->to_exclude; + int namelen, prefix = x->nowildcardlen; + + if (x->flags & EXC_FLAG_MUSTBEDIR) { + if (*dtype == DT_UNKNOWN) + *dtype = get_dtype(NULL, pathname, pathlen); + if (*dtype != DT_DIR) + continue; + } + + if (x->flags & EXC_FLAG_NODIR) { + /* match basename */ + if (prefix == x->patternlen) { + if (!strcmp_icase(exclude, basename)) + return to_exclude; + } else if (x->flags & EXC_FLAG_ENDSWITH) { + if (x->patternlen - 1 <= pathlen && + !strcmp_icase(exclude + 1, pathname + pathlen - x->patternlen + 1)) + return to_exclude; + } else { + if (fnmatch_icase(exclude, basename, 0) == 0) + return to_exclude; } + continue; + } + + /* match with FNM_PATHNAME: + * exclude has base (baselen long) implicitly in front of it. + */ + if (*exclude == '/') { + exclude++; + prefix--; + } + + if (pathlen < x->baselen || + (x->baselen && pathname[x->baselen-1] != '/') || + strncmp_icase(pathname, x->base, x->baselen)) + continue; + + namelen = x->baselen ? pathlen - x->baselen : pathlen; + name = pathname + pathlen - namelen; + + /* if the non-wildcard part is longer than the + remaining pathname, surely it cannot match */ + if (prefix > namelen) + continue; + + if (prefix) { + if (strncmp_icase(exclude, name, prefix)) + continue; + exclude += prefix; + name += prefix; + namelen -= prefix; } + + if (!namelen || !fnmatch_icase(exclude, name, FNM_PATHNAME)) + return to_exclude; } return -1; /* undecided */ } -int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p) +static int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p) { int pathlen = strlen(pathname); int st; @@ -573,6 +599,64 @@ int excluded(struct dir_struct *dir, const char *pathname, int *dtype_p) return 0; } +void path_exclude_check_init(struct path_exclude_check *check, + struct dir_struct *dir) +{ + check->dir = dir; + strbuf_init(&check->path, 256); +} + +void path_exclude_check_clear(struct path_exclude_check *check) +{ + strbuf_release(&check->path); +} + +/* + * Is this name excluded? This is for a caller like show_files() that + * do not honor directory hierarchy and iterate through paths that are + * possibly in an ignored directory. + * + * A path to a directory known to be excluded is left in check->path to + * optimize for repeated checks for files in the same excluded directory. + */ +int path_excluded(struct path_exclude_check *check, + const char *name, int namelen, int *dtype) +{ + int i; + struct strbuf *path = &check->path; + + /* + * we allow the caller to pass namelen as an optimization; it + * must match the length of the name, as we eventually call + * excluded() on the whole name string. + */ + if (namelen < 0) + namelen = strlen(name); + + if (path->len && + path->len <= namelen && + !memcmp(name, path->buf, path->len) && + (!name[path->len] || name[path->len] == '/')) + return 1; + + strbuf_setlen(path, 0); + for (i = 0; name[i]; i++) { + int ch = name[i]; + + if (ch == '/') { + int dt = DT_DIR; + if (excluded(check->dir, path->buf, &dt)) + return 1; + } + strbuf_addch(path, ch); + } + + /* An entry in the index; cannot be a directory with subentries */ + strbuf_setlen(path, 0); + + return excluded(check->dir, name, dtype); +} + static struct dir_entry *dir_entry_new(const char *pathname, int len) { struct dir_entry *ent; @@ -997,21 +1081,6 @@ static int cmp_name(const void *p1, const void *p2) e2->name, e2->len); } -/* - * Return the length of the "simple" part of a path match limiter. - */ -static int simple_length(const char *match) -{ - int len = -1; - - for (;;) { - unsigned char c = *match++; - len++; - if (c == '\0' || is_glob_special(c)) - return len; - } -} - static struct path_simplify *create_simplify(const char **pathspec) { int nr, alloc = 0; @@ -1,13 +1,14 @@ #ifndef DIR_H #define DIR_H +#include "strbuf.h" + struct dir_entry { unsigned int len; char name[FLEX_ARRAY]; /* more */ }; #define EXC_FLAG_NODIR 1 -#define EXC_FLAG_NOWILDCARD 2 #define EXC_FLAG_ENDSWITH 4 #define EXC_FLAG_MUSTBEDIR 8 @@ -17,6 +18,7 @@ struct exclude_list { struct exclude { const char *pattern; int patternlen; + int nowildcardlen; const char *base; int baselen; int to_exclude; @@ -76,8 +78,22 @@ extern int read_directory(struct dir_struct *, const char *path, int len, const extern int excluded_from_list(const char *pathname, int pathlen, const char *basename, int *dtype, struct exclude_list *el); -extern int excluded(struct dir_struct *, const char *, int *); struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len); + +/* + * The excluded() API is meant for callers that check each level of leading + * directory hierarchies with excluded() to avoid recursing into excluded + * directories. Callers that do not do so should use this API instead. + */ +struct path_exclude_check { + struct dir_struct *dir; + struct strbuf path; +}; +extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *); +extern void path_exclude_check_clear(struct path_exclude_check *); +extern int path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype); + + extern int add_excludes_from_file_to_list(const char *fname, const char *base, int baselen, char **buf_p, struct exclude_list *which, int check_index); extern void add_excludes_from_file(struct dir_struct *, const char *fname); diff --git a/git-add--interactive.perl b/git-add--interactive.perl index d948aa88db..710764abb1 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1067,7 +1067,6 @@ EOF } sub diff_applies { - my $fh; return run_git_apply($patch_mode_flavour{APPLY_CHECK} . ' --check', map { @{$_->{TEXT}} } @_); } @@ -1514,7 +1513,6 @@ sub patch_update_file { } if (@result) { - my $fh; my @patch = reassemble_patch($head->{TEXT}, @result); my $apply_routine = $patch_mode_flavour{APPLY}; &$apply_routine(@patch); diff --git a/git-request-pull.sh b/git-request-pull.sh index e6438e24c7..d566015975 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -57,9 +57,13 @@ headrev=$(git rev-parse --verify "$head"^0) || exit merge_base=$(git merge-base $baserev $headrev) || die "fatal: No commits in common between $base and $head" -# $head is the token given from the command line. If a ref with that -# name exists at the remote and their values match, we should use it. -# Otherwise find a ref that matches $headrev. +# $head is the token given from the command line, and $tag_name, if +# exists, is the tag we are going to show the commit information for. +# If that tag exists at the remote and it points at the commit, use it. +# Otherwise, if a branch with the same name as $head exists at the remote +# and their values match, use that instead. +# +# Otherwise find a random ref that matches $headrev. find_matching_ref=' sub abbr { my $ref = shift; @@ -70,24 +74,29 @@ find_matching_ref=' } } - my ($exact, $found); + my ($tagged, $branch, $found); while (<STDIN>) { my ($sha1, $ref, $deref) = /^(\S+)\s+(\S+?)(\^\{\})?$/; next unless ($sha1 eq $ARGV[1]); $found = abbr($ref); + if ($deref && $ref eq "tags/$ARGV[2]") { + $tagged = $found; + last; + } if ($ref =~ m|/\Q$ARGV[0]\E$|) { $exact = $found; - last; } } - if ($exact) { + if ($tagged) { + print "$tagged\n"; + } elsif ($exact) { print "$exact\n"; } elsif ($found) { print "$found\n"; } ' -ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev") +ref=$(git ls-remote "$url" | perl -e "$find_matching_ref" "$head" "$headrev" "$tag_name") url=$(git ls-remote --get-url "$url") @@ -114,6 +123,12 @@ fi && if test -n "$tag_name" then + if test -z "$ref" || test "$ref" != "tags/$tag_name" + then + echo >&2 "warn: You locally have $tag_name but it does not (yet)" + echo >&2 "warn: appear to be at $url" + echo >&2 "warn: Do you want to push it there, perhaps?" + fi git cat-file tag "$tag_name" | sed -n -e '1,/^$/d' -e '/^-----BEGIN PGP /q' -e p echo diff --git a/git-submodule.sh b/git-submodule.sh index 5c61ae2b43..fbf2fafaaf 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# git-submodules.sh: add, init, update or list git submodules +# git-submodule.sh: add, init, update or list git submodules # # Copyright (c) 2007 Lars Hjemli diff --git a/git-svn.perl b/git-svn.perl index 7870cc15c1..0b074c4c63 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -67,8 +67,6 @@ sub _req_svn { } } my $can_compress = eval { require Compress::Zlib; 1}; -push @Git::SVN::Ra::ISA, 'SVN::Ra'; -push @Git::SVN::Editor::ISA, 'SVN::Delta::Editor'; use Carp qw/croak/; use Digest::MD5; use IO::File qw//; @@ -79,7 +77,9 @@ use File::Find; use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/; use IPC::Open3; use Git; +use Git::SVN::Editor qw//; use Git::SVN::Fetcher qw//; +use Git::SVN::Ra qw//; use Git::SVN::Prompt qw//; use Memoize; # core since 5.8.0, Jul 2002 @@ -89,8 +89,7 @@ BEGIN { foreach (qw/command command_oneline command_noisy command_output_pipe command_input_pipe command_close_pipe command_bidi_pipe command_close_bidi_pipe/) { - for my $package ( qw(Git::SVN::Editor - Git::SVN::Migration Git::SVN::Log Git::SVN), + for my $package ( qw(Git::SVN::Migration Git::SVN::Log Git::SVN), __PACKAGE__) { *{"${package}::$_"} = \&{"Git::$_"}; } @@ -1066,7 +1065,6 @@ sub cmd_branch { " with the --destination argument.\n"; } foreach my $g (@{$allglobs}) { - # Git::SVN::Editor could probably be moved to Git.pm.. my $re = Git::SVN::Editor::glob2pat($g->{path}->{left}); if ($_branch_dest =~ /$re/) { $glob = $g; @@ -2057,6 +2055,10 @@ use Time::Local; use Memoize; # core since 5.8.0, Jul 2002 use Memoize::Storable; use POSIX qw(:signal_h); +my $can_use_yaml; +BEGIN { + $can_use_yaml = eval { require Git::SVN::Memoize::YAML; 1}; +} my ($_gc_nr, $_gc_period); @@ -3579,6 +3581,17 @@ sub has_no_changes { command_oneline("rev-parse", "$commit~1^{tree}")); } +sub tie_for_persistent_memoization { + my $hash = shift; + my $path = shift; + + if ($can_use_yaml) { + tie %$hash => 'Git::SVN::Memoize::YAML', "$path.yaml"; + } else { + tie %$hash => 'Memoize::Storable', "$path.db", 'nstore'; + } +} + # The GIT_DIR environment variable is not always set until after the command # line arguments are processed, so we can't memoize in a BEGIN block. { @@ -3591,22 +3604,26 @@ sub has_no_changes { my $cache_path = "$ENV{GIT_DIR}/svn/.caches/"; mkpath([$cache_path]) unless -d $cache_path; - tie my %lookup_svn_merge_cache => 'Memoize::Storable', - "$cache_path/lookup_svn_merge.db", 'nstore'; + my %lookup_svn_merge_cache; + my %check_cherry_pick_cache; + my %has_no_changes_cache; + + tie_for_persistent_memoization(\%lookup_svn_merge_cache, + "$cache_path/lookup_svn_merge"); memoize 'lookup_svn_merge', SCALAR_CACHE => 'FAULT', LIST_CACHE => ['HASH' => \%lookup_svn_merge_cache], ; - tie my %check_cherry_pick_cache => 'Memoize::Storable', - "$cache_path/check_cherry_pick.db", 'nstore'; + tie_for_persistent_memoization(\%check_cherry_pick_cache, + "$cache_path/check_cherry_pick"); memoize 'check_cherry_pick', SCALAR_CACHE => 'FAULT', LIST_CACHE => ['HASH' => \%check_cherry_pick_cache], ; - tie my %has_no_changes_cache => 'Memoize::Storable', - "$cache_path/has_no_changes.db", 'nstore'; + tie_for_persistent_memoization(\%has_no_changes_cache, + "$cache_path/has_no_changes"); memoize 'has_no_changes', SCALAR_CACHE => ['HASH' => \%has_no_changes_cache], LIST_CACHE => 'FAULT', @@ -4328,1082 +4345,6 @@ sub remove_username { $_[0] =~ s{^([^:]*://)[^@]+@}{$1}; } -package Git::SVN::Editor; -use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/; -use strict; -use warnings; -use Carp qw/croak/; -use IO::File; - -sub new { - my ($class, $opts) = @_; - foreach (qw/svn_path r ra tree_a tree_b log editor_cb/) { - die "$_ required!\n" unless (defined $opts->{$_}); - } - - my $pool = SVN::Pool->new; - my $mods = generate_diff($opts->{tree_a}, $opts->{tree_b}); - my $types = check_diff_paths($opts->{ra}, $opts->{svn_path}, - $opts->{r}, $mods); - - # $opts->{ra} functions should not be used after this: - my @ce = $opts->{ra}->get_commit_editor($opts->{log}, - $opts->{editor_cb}, $pool); - my $self = SVN::Delta::Editor->new(@ce, $pool); - bless $self, $class; - foreach (qw/svn_path r tree_a tree_b/) { - $self->{$_} = $opts->{$_}; - } - $self->{url} = $opts->{ra}->{url}; - $self->{mods} = $mods; - $self->{types} = $types; - $self->{pool} = $pool; - $self->{bat} = { '' => $self->open_root($self->{r}, $self->{pool}) }; - $self->{rm} = { }; - $self->{path_prefix} = length $self->{svn_path} ? - "$self->{svn_path}/" : ''; - $self->{config} = $opts->{config}; - $self->{mergeinfo} = $opts->{mergeinfo}; - return $self; -} - -sub generate_diff { - my ($tree_a, $tree_b) = @_; - my @diff_tree = qw(diff-tree -z -r); - if ($_cp_similarity) { - push @diff_tree, "-C$_cp_similarity"; - } else { - push @diff_tree, '-C'; - } - push @diff_tree, '--find-copies-harder' if $_find_copies_harder; - push @diff_tree, "-l$_rename_limit" if defined $_rename_limit; - push @diff_tree, $tree_a, $tree_b; - my ($diff_fh, $ctx) = command_output_pipe(@diff_tree); - local $/ = "\0"; - my $state = 'meta'; - my @mods; - while (<$diff_fh>) { - chomp $_; # this gets rid of the trailing "\0" - if ($state eq 'meta' && /^:(\d{6})\s(\d{6})\s - ($::sha1)\s($::sha1)\s - ([MTCRAD])\d*$/xo) { - push @mods, { mode_a => $1, mode_b => $2, - sha1_a => $3, sha1_b => $4, - chg => $5 }; - if ($5 =~ /^(?:C|R)$/) { - $state = 'file_a'; - } else { - $state = 'file_b'; - } - } elsif ($state eq 'file_a') { - my $x = $mods[$#mods] or croak "Empty array\n"; - if ($x->{chg} !~ /^(?:C|R)$/) { - croak "Error parsing $_, $x->{chg}\n"; - } - $x->{file_a} = $_; - $state = 'file_b'; - } elsif ($state eq 'file_b') { - my $x = $mods[$#mods] or croak "Empty array\n"; - if (exists $x->{file_a} && $x->{chg} !~ /^(?:C|R)$/) { - croak "Error parsing $_, $x->{chg}\n"; - } - if (!exists $x->{file_a} && $x->{chg} =~ /^(?:C|R)$/) { - croak "Error parsing $_, $x->{chg}\n"; - } - $x->{file_b} = $_; - $state = 'meta'; - } else { - croak "Error parsing $_\n"; - } - } - command_close_pipe($diff_fh, $ctx); - \@mods; -} - -sub check_diff_paths { - my ($ra, $pfx, $rev, $mods) = @_; - my %types; - $pfx .= '/' if length $pfx; - - sub type_diff_paths { - my ($ra, $types, $path, $rev) = @_; - my @p = split m#/+#, $path; - my $c = shift @p; - unless (defined $types->{$c}) { - $types->{$c} = $ra->check_path($c, $rev); - } - while (@p) { - $c .= '/' . shift @p; - next if defined $types->{$c}; - $types->{$c} = $ra->check_path($c, $rev); - } - } - - foreach my $m (@$mods) { - foreach my $f (qw/file_a file_b/) { - next unless defined $m->{$f}; - my ($dir) = ($m->{$f} =~ m#^(.*?)/?(?:[^/]+)$#); - if (length $pfx.$dir && ! defined $types{$dir}) { - type_diff_paths($ra, \%types, $pfx.$dir, $rev); - } - } - } - \%types; -} - -sub split_path { - return ($_[0] =~ m#^(.*?)/?([^/]+)$#); -} - -sub repo_path { - my ($self, $path) = @_; - if (my $enc = $self->{pathnameencoding}) { - require Encode; - Encode::from_to($path, $enc, 'UTF-8'); - } - $self->{path_prefix}.(defined $path ? $path : ''); -} - -sub url_path { - my ($self, $path) = @_; - if ($self->{url} =~ m#^https?://#) { - $path =~ s!([^~a-zA-Z0-9_./-])!uc sprintf("%%%02x",ord($1))!eg; - } - $self->{url} . '/' . $self->repo_path($path); -} - -sub rmdirs { - my ($self) = @_; - my $rm = $self->{rm}; - delete $rm->{''}; # we never delete the url we're tracking - return unless %$rm; - - foreach (keys %$rm) { - my @d = split m#/#, $_; - my $c = shift @d; - $rm->{$c} = 1; - while (@d) { - $c .= '/' . shift @d; - $rm->{$c} = 1; - } - } - delete $rm->{$self->{svn_path}}; - delete $rm->{''}; # we never delete the url we're tracking - return unless %$rm; - - my ($fh, $ctx) = command_output_pipe(qw/ls-tree --name-only -r -z/, - $self->{tree_b}); - local $/ = "\0"; - while (<$fh>) { - chomp; - my @dn = split m#/#, $_; - while (pop @dn) { - delete $rm->{join '/', @dn}; - } - unless (%$rm) { - close $fh; - return; - } - } - command_close_pipe($fh, $ctx); - - my ($r, $p, $bat) = ($self->{r}, $self->{pool}, $self->{bat}); - foreach my $d (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$rm) { - $self->close_directory($bat->{$d}, $p); - my ($dn) = ($d =~ m#^(.*?)/?(?:[^/]+)$#); - print "\tD+\t$d/\n" unless $::_q; - $self->SUPER::delete_entry($d, $r, $bat->{$dn}, $p); - delete $bat->{$d}; - } -} - -sub open_or_add_dir { - my ($self, $full_path, $baton, $deletions) = @_; - my $t = $self->{types}->{$full_path}; - if (!defined $t) { - die "$full_path not known in r$self->{r} or we have a bug!\n"; - } - { - no warnings 'once'; - # SVN::Node::none and SVN::Node::file are used only once, - # so we're shutting up Perl's warnings about them. - if ($t == $SVN::Node::none || defined($deletions->{$full_path})) { - return $self->add_directory($full_path, $baton, - undef, -1, $self->{pool}); - } elsif ($t == $SVN::Node::dir) { - return $self->open_directory($full_path, $baton, - $self->{r}, $self->{pool}); - } # no warnings 'once' - print STDERR "$full_path already exists in repository at ", - "r$self->{r} and it is not a directory (", - ($t == $SVN::Node::file ? 'file' : 'unknown'),"/$t)\n"; - } # no warnings 'once' - exit 1; -} - -sub ensure_path { - my ($self, $path, $deletions) = @_; - my $bat = $self->{bat}; - my $repo_path = $self->repo_path($path); - return $bat->{''} unless (length $repo_path); - - my @p = split m#/+#, $repo_path; - my $c = shift @p; - $bat->{$c} ||= $self->open_or_add_dir($c, $bat->{''}, $deletions); - while (@p) { - my $c0 = $c; - $c .= '/' . shift @p; - $bat->{$c} ||= $self->open_or_add_dir($c, $bat->{$c0}, $deletions); - } - return $bat->{$c}; -} - -# Subroutine to convert a globbing pattern to a regular expression. -# From perl cookbook. -sub glob2pat { - my $globstr = shift; - my %patmap = ('*' => '.*', '?' => '.', '[' => '[', ']' => ']'); - $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; - return '^' . $globstr . '$'; -} - -sub check_autoprop { - my ($self, $pattern, $properties, $file, $fbat) = @_; - # Convert the globbing pattern to a regular expression. - my $regex = glob2pat($pattern); - # Check if the pattern matches the file name. - if($file =~ m/($regex)/) { - # Parse the list of properties to set. - my @props = split(/;/, $properties); - foreach my $prop (@props) { - # Parse 'name=value' syntax and set the property. - if ($prop =~ /([^=]+)=(.*)/) { - my ($n,$v) = ($1,$2); - for ($n, $v) { - s/^\s+//; s/\s+$//; - } - $self->change_file_prop($fbat, $n, $v); - } - } - } -} - -sub apply_autoprops { - my ($self, $file, $fbat) = @_; - my $conf_t = ${$self->{config}}{'config'}; - no warnings 'once'; - # Check [miscellany]/enable-auto-props in svn configuration. - if (SVN::_Core::svn_config_get_bool( - $conf_t, - $SVN::_Core::SVN_CONFIG_SECTION_MISCELLANY, - $SVN::_Core::SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, - 0)) { - # Auto-props are enabled. Enumerate them to look for matches. - my $callback = sub { - $self->check_autoprop($_[0], $_[1], $file, $fbat); - }; - SVN::_Core::svn_config_enumerate( - $conf_t, - $SVN::_Core::SVN_CONFIG_SECTION_AUTO_PROPS, - $callback); - } -} - -sub A { - my ($self, $m, $deletions) = @_; - my ($dir, $file) = split_path($m->{file_b}); - my $pbat = $self->ensure_path($dir, $deletions); - my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, - undef, -1); - print "\tA\t$m->{file_b}\n" unless $::_q; - $self->apply_autoprops($file, $fbat); - $self->chg_file($fbat, $m); - $self->close_file($fbat,undef,$self->{pool}); -} - -sub C { - my ($self, $m, $deletions) = @_; - my ($dir, $file) = split_path($m->{file_b}); - my $pbat = $self->ensure_path($dir, $deletions); - my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, - $self->url_path($m->{file_a}), $self->{r}); - print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q; - $self->chg_file($fbat, $m); - $self->close_file($fbat,undef,$self->{pool}); -} - -sub delete_entry { - my ($self, $path, $pbat) = @_; - my $rpath = $self->repo_path($path); - my ($dir, $file) = split_path($rpath); - $self->{rm}->{$dir} = 1; - $self->SUPER::delete_entry($rpath, $self->{r}, $pbat, $self->{pool}); -} - -sub R { - my ($self, $m, $deletions) = @_; - my ($dir, $file) = split_path($m->{file_b}); - my $pbat = $self->ensure_path($dir, $deletions); - my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, - $self->url_path($m->{file_a}), $self->{r}); - print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q; - $self->apply_autoprops($file, $fbat); - $self->chg_file($fbat, $m); - $self->close_file($fbat,undef,$self->{pool}); - - ($dir, $file) = split_path($m->{file_a}); - $pbat = $self->ensure_path($dir, $deletions); - $self->delete_entry($m->{file_a}, $pbat); -} - -sub M { - my ($self, $m, $deletions) = @_; - my ($dir, $file) = split_path($m->{file_b}); - my $pbat = $self->ensure_path($dir, $deletions); - my $fbat = $self->open_file($self->repo_path($m->{file_b}), - $pbat,$self->{r},$self->{pool}); - print "\t$m->{chg}\t$m->{file_b}\n" unless $::_q; - $self->chg_file($fbat, $m); - $self->close_file($fbat,undef,$self->{pool}); -} - -sub T { shift->M(@_) } - -sub change_file_prop { - my ($self, $fbat, $pname, $pval) = @_; - $self->SUPER::change_file_prop($fbat, $pname, $pval, $self->{pool}); -} - -sub change_dir_prop { - my ($self, $pbat, $pname, $pval) = @_; - $self->SUPER::change_dir_prop($pbat, $pname, $pval, $self->{pool}); -} - -sub _chg_file_get_blob ($$$$) { - my ($self, $fbat, $m, $which) = @_; - my $fh = $::_repository->temp_acquire("git_blob_$which"); - if ($m->{"mode_$which"} =~ /^120/) { - print $fh 'link ' or croak $!; - $self->change_file_prop($fbat,'svn:special','*'); - } elsif ($m->{mode_a} =~ /^120/ && $m->{"mode_$which"} !~ /^120/) { - $self->change_file_prop($fbat,'svn:special',undef); - } - my $blob = $m->{"sha1_$which"}; - return ($fh,) if ($blob =~ /^0{40}$/); - my $size = $::_repository->cat_blob($blob, $fh); - croak "Failed to read object $blob" if ($size < 0); - $fh->flush == 0 or croak $!; - seek $fh, 0, 0 or croak $!; - - my $exp = ::md5sum($fh); - seek $fh, 0, 0 or croak $!; - return ($fh, $exp); -} - -sub chg_file { - my ($self, $fbat, $m) = @_; - if ($m->{mode_b} =~ /755$/ && $m->{mode_a} !~ /755$/) { - $self->change_file_prop($fbat,'svn:executable','*'); - } elsif ($m->{mode_b} !~ /755$/ && $m->{mode_a} =~ /755$/) { - $self->change_file_prop($fbat,'svn:executable',undef); - } - my ($fh_a, $exp_a) = _chg_file_get_blob $self, $fbat, $m, 'a'; - my ($fh_b, $exp_b) = _chg_file_get_blob $self, $fbat, $m, 'b'; - my $pool = SVN::Pool->new; - my $atd = $self->apply_textdelta($fbat, $exp_a, $pool); - if (-s $fh_a) { - my $txstream = SVN::TxDelta::new ($fh_a, $fh_b, $pool); - my $res = SVN::TxDelta::send_txstream($txstream, @$atd, $pool); - if (defined $res) { - die "Unexpected result from send_txstream: $res\n", - "(SVN::Core::VERSION: $SVN::Core::VERSION)\n"; - } - } else { - my $got = SVN::TxDelta::send_stream($fh_b, @$atd, $pool); - die "Checksum mismatch\nexpected: $exp_b\ngot: $got\n" - if ($got ne $exp_b); - } - Git::temp_release($fh_b, 1); - Git::temp_release($fh_a, 1); - $pool->clear; -} - -sub D { - my ($self, $m, $deletions) = @_; - my ($dir, $file) = split_path($m->{file_b}); - my $pbat = $self->ensure_path($dir, $deletions); - print "\tD\t$m->{file_b}\n" unless $::_q; - $self->delete_entry($m->{file_b}, $pbat); -} - -sub close_edit { - my ($self) = @_; - my ($p,$bat) = ($self->{pool}, $self->{bat}); - foreach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) { - next if $_ eq ''; - $self->close_directory($bat->{$_}, $p); - } - $self->close_directory($bat->{''}, $p); - $self->SUPER::close_edit($p); - $p->clear; -} - -sub abort_edit { - my ($self) = @_; - $self->SUPER::abort_edit($self->{pool}); -} - -sub DESTROY { - my $self = shift; - $self->SUPER::DESTROY(@_); - $self->{pool}->clear; -} - -# this drives the editor -sub apply_diff { - my ($self) = @_; - my $mods = $self->{mods}; - my %o = ( D => 0, C => 1, R => 2, A => 3, M => 4, T => 5 ); - my %deletions; - - foreach my $m (@$mods) { - if ($m->{chg} eq "D") { - $deletions{$m->{file_b}} = 1; - } - } - - foreach my $m (sort { $o{$a->{chg}} <=> $o{$b->{chg}} } @$mods) { - my $f = $m->{chg}; - if (defined $o{$f}) { - $self->$f($m, \%deletions); - } else { - fatal("Invalid change type: $f"); - } - } - - if (defined($self->{mergeinfo})) { - $self->change_dir_prop($self->{bat}{''}, "svn:mergeinfo", - $self->{mergeinfo}); - } - $self->rmdirs if $_rmdir; - if (@$mods == 0 && !defined($self->{mergeinfo})) { - $self->abort_edit; - } else { - $self->close_edit; - } - return scalar @$mods; -} - -package Git::SVN::Ra; -use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/; -use strict; -use warnings; -my ($ra_invalid, $can_do_switch, %ignored_err, $RA); - -BEGIN { - # enforce temporary pool usage for some simple functions - no strict 'refs'; - for my $f (qw/rev_proplist get_latest_revnum get_uuid get_repos_root - get_file/) { - my $SUPER = "SUPER::$f"; - *$f = sub { - my $self = shift; - my $pool = SVN::Pool->new; - my @ret = $self->$SUPER(@_,$pool); - $pool->clear; - wantarray ? @ret : $ret[0]; - }; - } -} - -sub _auth_providers () { - my @rv = ( - SVN::Client::get_simple_provider(), - SVN::Client::get_ssl_server_trust_file_provider(), - SVN::Client::get_simple_prompt_provider( - \&Git::SVN::Prompt::simple, 2), - SVN::Client::get_ssl_client_cert_file_provider(), - SVN::Client::get_ssl_client_cert_prompt_provider( - \&Git::SVN::Prompt::ssl_client_cert, 2), - SVN::Client::get_ssl_client_cert_pw_file_provider(), - SVN::Client::get_ssl_client_cert_pw_prompt_provider( - \&Git::SVN::Prompt::ssl_client_cert_pw, 2), - SVN::Client::get_username_provider(), - SVN::Client::get_ssl_server_trust_prompt_provider( - \&Git::SVN::Prompt::ssl_server_trust), - SVN::Client::get_username_prompt_provider( - \&Git::SVN::Prompt::username, 2) - ); - - # earlier 1.6.x versions would segfault, and <= 1.5.x didn't have - # this function - if (::compare_svn_version('1.6.12') > 0) { - my $config = SVN::Core::config_get_config($config_dir); - my ($p, @a); - # config_get_config returns all config files from - # ~/.subversion, auth_get_platform_specific_client_providers - # just wants the config "file". - @a = ($config->{'config'}, undef); - $p = SVN::Core::auth_get_platform_specific_client_providers(@a); - # Insert the return value from - # auth_get_platform_specific_providers - unshift @rv, @$p; - } - \@rv; -} - -sub escape_uri_only { - my ($uri) = @_; - my @tmp; - foreach (split m{/}, $uri) { - s/([^~\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg; - push @tmp, $_; - } - join('/', @tmp); -} - -sub escape_url { - my ($url) = @_; - if ($url =~ m#^(https?)://([^/]+)(.*)$#) { - my ($scheme, $domain, $uri) = ($1, $2, escape_uri_only($3)); - $url = "$scheme://$domain$uri"; - } - $url; -} - -sub new { - my ($class, $url) = @_; - $url =~ s!/+$!!; - return $RA if ($RA && $RA->{url} eq $url); - - ::_req_svn(); - - SVN::_Core::svn_config_ensure($config_dir, undef); - my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers); - my $config = SVN::Core::config_get_config($config_dir); - $RA = undef; - my $dont_store_passwords = 1; - my $conf_t = ${$config}{'config'}; - { - no warnings 'once'; - # The usage of $SVN::_Core::SVN_CONFIG_* variables - # produces warnings that variables are used only once. - # I had not found the better way to shut them up, so - # the warnings of type 'once' are disabled in this block. - if (SVN::_Core::svn_config_get_bool($conf_t, - $SVN::_Core::SVN_CONFIG_SECTION_AUTH, - $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS, - 1) == 0) { - SVN::_Core::svn_auth_set_parameter($baton, - $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, - bless (\$dont_store_passwords, "_p_void")); - } - if (SVN::_Core::svn_config_get_bool($conf_t, - $SVN::_Core::SVN_CONFIG_SECTION_AUTH, - $SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS, - 1) == 0) { - $Git::SVN::Prompt::_no_auth_cache = 1; - } - } # no warnings 'once' - my $self = SVN::Ra->new(url => escape_url($url), auth => $baton, - config => $config, - pool => SVN::Pool->new, - auth_provider_callbacks => $callbacks); - $self->{url} = $url; - $self->{svn_path} = $url; - $self->{repos_root} = $self->get_repos_root; - $self->{svn_path} =~ s#^\Q$self->{repos_root}\E(/|$)##; - $self->{cache} = { check_path => { r => 0, data => {} }, - get_dir => { r => 0, data => {} } }; - $RA = bless $self, $class; -} - -sub check_path { - my ($self, $path, $r) = @_; - my $cache = $self->{cache}->{check_path}; - if ($r == $cache->{r} && exists $cache->{data}->{$path}) { - return $cache->{data}->{$path}; - } - my $pool = SVN::Pool->new; - my $t = $self->SUPER::check_path($path, $r, $pool); - $pool->clear; - if ($r != $cache->{r}) { - %{$cache->{data}} = (); - $cache->{r} = $r; - } - $cache->{data}->{$path} = $t; -} - -sub get_dir { - my ($self, $dir, $r) = @_; - my $cache = $self->{cache}->{get_dir}; - if ($r == $cache->{r}) { - if (my $x = $cache->{data}->{$dir}) { - return wantarray ? @$x : $x->[0]; - } - } - my $pool = SVN::Pool->new; - my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool); - my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d; - $pool->clear; - if ($r != $cache->{r}) { - %{$cache->{data}} = (); - $cache->{r} = $r; - } - $cache->{data}->{$dir} = [ \%dirents, $r, $props ]; - wantarray ? (\%dirents, $r, $props) : \%dirents; -} - -sub DESTROY { - # do not call the real DESTROY since we store ourselves in $RA -} - -# get_log(paths, start, end, limit, -# discover_changed_paths, strict_node_history, receiver) -sub get_log { - my ($self, @args) = @_; - my $pool = SVN::Pool->new; - - # svn_log_changed_path_t objects passed to get_log are likely to be - # overwritten even if only the refs are copied to an external variable, - # so we should dup the structures in their entirety. Using an - # externally passed pool (instead of our temporary and quickly cleared - # pool in Git::SVN::Ra) does not help matters at all... - my $receiver = pop @args; - my $prefix = "/".$self->{svn_path}; - $prefix =~ s#/+($)##; - my $prefix_regex = qr#^\Q$prefix\E#; - push(@args, sub { - my ($paths) = $_[0]; - return &$receiver(@_) unless $paths; - $_[0] = (); - foreach my $p (keys %$paths) { - my $i = $paths->{$p}; - # Make path relative to our url, not repos_root - $p =~ s/$prefix_regex//; - my %s = map { $_ => $i->$_; } - qw/copyfrom_path copyfrom_rev action/; - if ($s{'copyfrom_path'}) { - $s{'copyfrom_path'} =~ s/$prefix_regex//; - } - $_[0]{$p} = \%s; - } - &$receiver(@_); - }); - - - # the limit parameter was not supported in SVN 1.1.x, so we - # drop it. Therefore, the receiver callback passed to it - # is made aware of this limitation by being wrapped if - # the limit passed to is being wrapped. - if (::compare_svn_version('1.2.0') <= 0) { - my $limit = splice(@args, 3, 1); - if ($limit > 0) { - my $receiver = pop @args; - push(@args, sub { &$receiver(@_) if (--$limit >= 0) }); - } - } - my $ret = $self->SUPER::get_log(@args, $pool); - $pool->clear; - $ret; -} - -sub trees_match { - my ($self, $url1, $rev1, $url2, $rev2) = @_; - my $ctx = SVN::Client->new(auth => _auth_providers); - my $out = IO::File->new_tmpfile; - - # older SVN (1.1.x) doesn't take $pool as the last parameter for - # $ctx->diff(), so we'll create a default one - my $pool = SVN::Pool->new_default_sub; - - $ra_invalid = 1; # this will open a new SVN::Ra connection to $url1 - $ctx->diff([], $url1, $rev1, $url2, $rev2, 1, 1, 0, $out, $out); - $out->flush; - my $ret = (($out->stat)[7] == 0); - close $out or croak $!; - - $ret; -} - -sub get_commit_editor { - my ($self, $log, $cb, $pool) = @_; - - my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef, 0) : (); - $self->SUPER::get_commit_editor($log, $cb, @lock, $pool); -} - -sub gs_do_update { - my ($self, $rev_a, $rev_b, $gs, $editor) = @_; - my $new = ($rev_a == $rev_b); - my $path = $gs->{path}; - - if ($new && -e $gs->{index}) { - unlink $gs->{index} or die - "Couldn't unlink index: $gs->{index}: $!\n"; - } - my $pool = SVN::Pool->new; - $editor->set_path_strip($path); - my (@pc) = split m#/#, $path; - my $reporter = $self->do_update($rev_b, (@pc ? shift @pc : ''), - 1, $editor, $pool); - my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : (); - - # Since we can't rely on svn_ra_reparent being available, we'll - # just have to do some magic with set_path to make it so - # we only want a partial path. - my $sp = ''; - my $final = join('/', @pc); - while (@pc) { - $reporter->set_path($sp, $rev_b, 0, @lock, $pool); - $sp .= '/' if length $sp; - $sp .= shift @pc; - } - die "BUG: '$sp' != '$final'\n" if ($sp ne $final); - - $reporter->set_path($sp, $rev_a, $new, @lock, $pool); - - $reporter->finish_report($pool); - $pool->clear; - $editor->{git_commit_ok}; -} - -# this requires SVN 1.4.3 or later (do_switch didn't work before 1.4.3, and -# svn_ra_reparent didn't work before 1.4) -sub gs_do_switch { - my ($self, $rev_a, $rev_b, $gs, $url_b, $editor) = @_; - my $path = $gs->{path}; - my $pool = SVN::Pool->new; - - my $full_url = $self->{url}; - my $old_url = $full_url; - $full_url .= '/' . $path if length $path; - my ($ra, $reparented); - - if ($old_url =~ m#^svn(\+ssh)?://# || - ($full_url =~ m#^https?://# && - escape_url($full_url) ne $full_url)) { - $_[0] = undef; - $self = undef; - $RA = undef; - $ra = Git::SVN::Ra->new($full_url); - $ra_invalid = 1; - } elsif ($old_url ne $full_url) { - SVN::_Ra::svn_ra_reparent($self->{session}, $full_url, $pool); - $self->{url} = $full_url; - $reparented = 1; - } - - $ra ||= $self; - $url_b = escape_url($url_b); - my $reporter = $ra->do_switch($rev_b, '', 1, $url_b, $editor, $pool); - my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : (); - $reporter->set_path('', $rev_a, 0, @lock, $pool); - $reporter->finish_report($pool); - - if ($reparented) { - SVN::_Ra::svn_ra_reparent($self->{session}, $old_url, $pool); - $self->{url} = $old_url; - } - - $pool->clear; - $editor->{git_commit_ok}; -} - -sub longest_common_path { - my ($gsv, $globs) = @_; - my %common; - my $common_max = scalar @$gsv; - - foreach my $gs (@$gsv) { - my @tmp = split m#/#, $gs->{path}; - my $p = ''; - foreach (@tmp) { - $p .= length($p) ? "/$_" : $_; - $common{$p} ||= 0; - $common{$p}++; - } - } - $globs ||= []; - $common_max += scalar @$globs; - foreach my $glob (@$globs) { - my @tmp = split m#/#, $glob->{path}->{left}; - my $p = ''; - foreach (@tmp) { - $p .= length($p) ? "/$_" : $_; - $common{$p} ||= 0; - $common{$p}++; - } - } - - my $longest_path = ''; - foreach (sort {length $b <=> length $a} keys %common) { - if ($common{$_} == $common_max) { - $longest_path = $_; - last; - } - } - $longest_path; -} - -sub gs_fetch_loop_common { - my ($self, $base, $head, $gsv, $globs) = @_; - return if ($base > $head); - my $inc = $_log_window_size; - my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc); - my $longest_path = longest_common_path($gsv, $globs); - my $ra_url = $self->{url}; - my $find_trailing_edge; - while (1) { - my %revs; - my $err; - my $err_handler = $SVN::Error::handler; - $SVN::Error::handler = sub { - ($err) = @_; - skip_unknown_revs($err); - }; - sub _cb { - my ($paths, $r, $author, $date, $log) = @_; - [ $paths, - { author => $author, date => $date, log => $log } ]; - } - $self->get_log([$longest_path], $min, $max, 0, 1, 1, - sub { $revs{$_[1]} = _cb(@_) }); - if ($err) { - print "Checked through r$max\r"; - } else { - $find_trailing_edge = 1; - } - if ($err and $find_trailing_edge) { - print STDERR "Path '$longest_path' ", - "was probably deleted:\n", - $err->expanded_message, - "\nWill attempt to follow ", - "revisions r$min .. r$max ", - "committed before the deletion\n"; - my $hi = $max; - while (--$hi >= $min) { - my $ok; - $self->get_log([$longest_path], $min, $hi, - 0, 1, 1, sub { - $ok = $_[1]; - $revs{$_[1]} = _cb(@_) }); - if ($ok) { - print STDERR "r$min .. r$ok OK\n"; - last; - } - } - $find_trailing_edge = 0; - } - $SVN::Error::handler = $err_handler; - - my %exists = map { $_->{path} => $_ } @$gsv; - foreach my $r (sort {$a <=> $b} keys %revs) { - my ($paths, $logged) = @{$revs{$r}}; - - foreach my $gs ($self->match_globs(\%exists, $paths, - $globs, $r)) { - if ($gs->rev_map_max >= $r) { - next; - } - next unless $gs->match_paths($paths, $r); - $gs->{logged_rev_props} = $logged; - if (my $last_commit = $gs->last_commit) { - $gs->assert_index_clean($last_commit); - } - my $log_entry = $gs->do_fetch($paths, $r); - if ($log_entry) { - $gs->do_git_commit($log_entry); - } - $INDEX_FILES{$gs->{index}} = 1; - } - foreach my $g (@$globs) { - my $k = "svn-remote.$g->{remote}." . - "$g->{t}-maxRev"; - Git::SVN::tmp_config($k, $r); - } - if ($ra_invalid) { - $_[0] = undef; - $self = undef; - $RA = undef; - $self = Git::SVN::Ra->new($ra_url); - $ra_invalid = undef; - } - } - # pre-fill the .rev_db since it'll eventually get filled in - # with '0' x40 if something new gets committed - foreach my $gs (@$gsv) { - next if $gs->rev_map_max >= $max; - next if defined $gs->rev_map_get($max); - $gs->rev_map_set($max, 0 x40); - } - foreach my $g (@$globs) { - my $k = "svn-remote.$g->{remote}.$g->{t}-maxRev"; - Git::SVN::tmp_config($k, $max); - } - last if $max >= $head; - $min = $max + 1; - $max += $inc; - $max = $head if ($max > $head); - } - Git::SVN::gc(); -} - -sub get_dir_globbed { - my ($self, $left, $depth, $r) = @_; - - my @x = eval { $self->get_dir($left, $r) }; - return unless scalar @x == 3; - my $dirents = $x[0]; - my @finalents; - foreach my $de (keys %$dirents) { - next if $dirents->{$de}->{kind} != $SVN::Node::dir; - if ($depth > 1) { - my @args = ("$left/$de", $depth - 1, $r); - foreach my $dir ($self->get_dir_globbed(@args)) { - push @finalents, "$de/$dir"; - } - } else { - push @finalents, $de; - } - } - @finalents; -} - -# return value: 0 -- don't ignore, 1 -- ignore -sub is_ref_ignored { - my ($g, $p) = @_; - my $refname = $g->{ref}->full_path($p); - return 1 if defined($g->{ignore_refs_regex}) && - $refname =~ m!$g->{ignore_refs_regex}!; - return 0 unless defined($_ignore_refs_regex); - return 1 if $refname =~ m!$_ignore_refs_regex!o; - return 0; -} - -sub match_globs { - my ($self, $exists, $paths, $globs, $r) = @_; - - sub get_dir_check { - my ($self, $exists, $g, $r) = @_; - - my @dirs = $self->get_dir_globbed($g->{path}->{left}, - $g->{path}->{depth}, - $r); - - foreach my $de (@dirs) { - my $p = $g->{path}->full_path($de); - next if $exists->{$p}; - next if (length $g->{path}->{right} && - ($self->check_path($p, $r) != - $SVN::Node::dir)); - next unless $p =~ /$g->{path}->{regex}/; - $exists->{$p} = Git::SVN->init($self->{url}, $p, undef, - $g->{ref}->full_path($de), 1); - } - } - foreach my $g (@$globs) { - if (my $path = $paths->{"/$g->{path}->{left}"}) { - if ($path->{action} =~ /^[AR]$/) { - get_dir_check($self, $exists, $g, $r); - } - } - foreach (keys %$paths) { - if (/$g->{path}->{left_regex}/ && - !/$g->{path}->{regex}/) { - next if $paths->{$_}->{action} !~ /^[AR]$/; - get_dir_check($self, $exists, $g, $r); - } - next unless /$g->{path}->{regex}/; - my $p = $1; - my $pathname = $g->{path}->full_path($p); - next if is_ref_ignored($g, $p); - next if $exists->{$pathname}; - next if ($self->check_path($pathname, $r) != - $SVN::Node::dir); - $exists->{$pathname} = Git::SVN->init( - $self->{url}, $pathname, undef, - $g->{ref}->full_path($p), 1); - } - my $c = ''; - foreach (split m#/#, $g->{path}->{left}) { - $c .= "/$_"; - next unless ($paths->{$c} && - ($paths->{$c}->{action} =~ /^[AR]$/)); - get_dir_check($self, $exists, $g, $r); - } - } - values %$exists; -} - -sub minimize_url { - my ($self) = @_; - return $self->{url} if ($self->{url} eq $self->{repos_root}); - my $url = $self->{repos_root}; - my @components = split(m!/!, $self->{svn_path}); - my $c = ''; - do { - $url .= "/$c" if length $c; - eval { - my $ra = (ref $self)->new($url); - my $latest = $ra->get_latest_revnum; - $ra->get_log("", $latest, 0, 1, 0, 1, sub {}); - }; - } while ($@ && ($c = shift @components)); - $url; -} - -sub can_do_switch { - my $self = shift; - unless (defined $can_do_switch) { - my $pool = SVN::Pool->new; - my $rep = eval { - $self->do_switch(1, '', 0, $self->{url}, - SVN::Delta::Editor->new, $pool); - }; - if ($@) { - $can_do_switch = 0; - } else { - $rep->abort_report($pool); - $can_do_switch = 1; - } - $pool->clear; - } - $can_do_switch; -} - -sub skip_unknown_revs { - my ($err) = @_; - my $errno = $err->apr_err(); - # Maybe the branch we're tracking didn't - # exist when the repo started, so it's - # not an error if it doesn't, just continue - # - # Wonderfully consistent library, eh? - # 160013 - svn:// and file:// - # 175002 - http(s):// - # 175007 - http(s):// (this repo required authorization, too...) - # More codes may be discovered later... - if ($errno == 175007 || $errno == 175002 || $errno == 160013) { - my $err_key = $err->expanded_message; - # revision numbers change every time, filter them out - $err_key =~ s/\d+/\0/g; - $err_key = "$errno\0$err_key"; - unless ($ignored_err{$err_key}) { - warn "W: Ignoring error from SVN, path probably ", - "does not exist: ($errno): ", - $err->expanded_message,"\n"; - warn "W: Do not be alarmed at the above message ", - "git-svn is just searching aggressively for ", - "old history.\n", - "This may take a while on large repositories\n"; - $ignored_err{$err_key} = 1; - } - return; - } - die "Error from SVN, ($errno): ", $err->expanded_message,"\n"; -} - package Git::SVN::Log; use strict; use warnings; @@ -256,8 +256,6 @@ static int handle_alias(int *argcp, const char ***argv) return ret; } -const char git_version_string[] = GIT_VERSION; - #define RUN_SETUP (1<<0) #define RUN_SETUP_GENTLY (1<<1) #define USE_PAGER (1<<2) @@ -6,6 +6,7 @@ #include "common-cmds.h" #include "string-list.h" #include "column.h" +#include "version.h" void add_cmdname(struct cmdnames *cmds, const char *name, int len) { @@ -4,6 +4,7 @@ #include "run-command.h" #include "url.h" #include "credential.h" +#include "version.h" int active_requests; int http_is_verbose; @@ -299,7 +300,7 @@ static CURL *get_curl_handle(void) curl_easy_setopt(result, CURLOPT_VERBOSE, 1); curl_easy_setopt(result, CURLOPT_USERAGENT, - user_agent ? user_agent : GIT_HTTP_USER_AGENT); + user_agent ? user_agent : git_user_agent()); if (curl_ftp_no_epsv) curl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0); diff --git a/notes-merge.c b/notes-merge.c index 74aa77ce4b..29c6411fc6 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -524,8 +524,10 @@ static int merge_from_diffs(struct notes_merge_options *o, free(changes); if (o->verbosity >= 4) - printf("Merge result: %i unmerged notes and a %s notes tree\n", - conflicts, t->dirty ? "dirty" : "clean"); + printf(t->dirty ? + "Merge result: %i unmerged notes and a dirty notes tree\n" : + "Merge result: %i unmerged notes and a clean notes tree\n", + conflicts); return conflicts ? -1 : 1; } diff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm new file mode 100644 index 0000000000..755092fdff --- /dev/null +++ b/perl/Git/SVN/Editor.pm @@ -0,0 +1,536 @@ +package Git::SVN::Editor; +use vars qw/@ISA $_rmdir $_cp_similarity $_find_copies_harder $_rename_limit/; +use strict; +use warnings; +use SVN::Core; +use SVN::Delta; +use Carp qw/croak/; +use IO::File; +use Git qw/command command_oneline command_noisy command_output_pipe + command_input_pipe command_close_pipe + command_bidi_pipe command_close_bidi_pipe/; +BEGIN { + @ISA = qw(SVN::Delta::Editor); +} + +sub new { + my ($class, $opts) = @_; + foreach (qw/svn_path r ra tree_a tree_b log editor_cb/) { + die "$_ required!\n" unless (defined $opts->{$_}); + } + + my $pool = SVN::Pool->new; + my $mods = generate_diff($opts->{tree_a}, $opts->{tree_b}); + my $types = check_diff_paths($opts->{ra}, $opts->{svn_path}, + $opts->{r}, $mods); + + # $opts->{ra} functions should not be used after this: + my @ce = $opts->{ra}->get_commit_editor($opts->{log}, + $opts->{editor_cb}, $pool); + my $self = SVN::Delta::Editor->new(@ce, $pool); + bless $self, $class; + foreach (qw/svn_path r tree_a tree_b/) { + $self->{$_} = $opts->{$_}; + } + $self->{url} = $opts->{ra}->{url}; + $self->{mods} = $mods; + $self->{types} = $types; + $self->{pool} = $pool; + $self->{bat} = { '' => $self->open_root($self->{r}, $self->{pool}) }; + $self->{rm} = { }; + $self->{path_prefix} = length $self->{svn_path} ? + "$self->{svn_path}/" : ''; + $self->{config} = $opts->{config}; + $self->{mergeinfo} = $opts->{mergeinfo}; + return $self; +} + +sub generate_diff { + my ($tree_a, $tree_b) = @_; + my @diff_tree = qw(diff-tree -z -r); + if ($_cp_similarity) { + push @diff_tree, "-C$_cp_similarity"; + } else { + push @diff_tree, '-C'; + } + push @diff_tree, '--find-copies-harder' if $_find_copies_harder; + push @diff_tree, "-l$_rename_limit" if defined $_rename_limit; + push @diff_tree, $tree_a, $tree_b; + my ($diff_fh, $ctx) = command_output_pipe(@diff_tree); + local $/ = "\0"; + my $state = 'meta'; + my @mods; + while (<$diff_fh>) { + chomp $_; # this gets rid of the trailing "\0" + if ($state eq 'meta' && /^:(\d{6})\s(\d{6})\s + ($::sha1)\s($::sha1)\s + ([MTCRAD])\d*$/xo) { + push @mods, { mode_a => $1, mode_b => $2, + sha1_a => $3, sha1_b => $4, + chg => $5 }; + if ($5 =~ /^(?:C|R)$/) { + $state = 'file_a'; + } else { + $state = 'file_b'; + } + } elsif ($state eq 'file_a') { + my $x = $mods[$#mods] or croak "Empty array\n"; + if ($x->{chg} !~ /^(?:C|R)$/) { + croak "Error parsing $_, $x->{chg}\n"; + } + $x->{file_a} = $_; + $state = 'file_b'; + } elsif ($state eq 'file_b') { + my $x = $mods[$#mods] or croak "Empty array\n"; + if (exists $x->{file_a} && $x->{chg} !~ /^(?:C|R)$/) { + croak "Error parsing $_, $x->{chg}\n"; + } + if (!exists $x->{file_a} && $x->{chg} =~ /^(?:C|R)$/) { + croak "Error parsing $_, $x->{chg}\n"; + } + $x->{file_b} = $_; + $state = 'meta'; + } else { + croak "Error parsing $_\n"; + } + } + command_close_pipe($diff_fh, $ctx); + \@mods; +} + +sub check_diff_paths { + my ($ra, $pfx, $rev, $mods) = @_; + my %types; + $pfx .= '/' if length $pfx; + + sub type_diff_paths { + my ($ra, $types, $path, $rev) = @_; + my @p = split m#/+#, $path; + my $c = shift @p; + unless (defined $types->{$c}) { + $types->{$c} = $ra->check_path($c, $rev); + } + while (@p) { + $c .= '/' . shift @p; + next if defined $types->{$c}; + $types->{$c} = $ra->check_path($c, $rev); + } + } + + foreach my $m (@$mods) { + foreach my $f (qw/file_a file_b/) { + next unless defined $m->{$f}; + my ($dir) = ($m->{$f} =~ m#^(.*?)/?(?:[^/]+)$#); + if (length $pfx.$dir && ! defined $types{$dir}) { + type_diff_paths($ra, \%types, $pfx.$dir, $rev); + } + } + } + \%types; +} + +sub split_path { + return ($_[0] =~ m#^(.*?)/?([^/]+)$#); +} + +sub repo_path { + my ($self, $path) = @_; + if (my $enc = $self->{pathnameencoding}) { + require Encode; + Encode::from_to($path, $enc, 'UTF-8'); + } + $self->{path_prefix}.(defined $path ? $path : ''); +} + +sub url_path { + my ($self, $path) = @_; + if ($self->{url} =~ m#^https?://#) { + $path =~ s!([^~a-zA-Z0-9_./-])!uc sprintf("%%%02x",ord($1))!eg; + } + $self->{url} . '/' . $self->repo_path($path); +} + +sub rmdirs { + my ($self) = @_; + my $rm = $self->{rm}; + delete $rm->{''}; # we never delete the url we're tracking + return unless %$rm; + + foreach (keys %$rm) { + my @d = split m#/#, $_; + my $c = shift @d; + $rm->{$c} = 1; + while (@d) { + $c .= '/' . shift @d; + $rm->{$c} = 1; + } + } + delete $rm->{$self->{svn_path}}; + delete $rm->{''}; # we never delete the url we're tracking + return unless %$rm; + + my ($fh, $ctx) = command_output_pipe(qw/ls-tree --name-only -r -z/, + $self->{tree_b}); + local $/ = "\0"; + while (<$fh>) { + chomp; + my @dn = split m#/#, $_; + while (pop @dn) { + delete $rm->{join '/', @dn}; + } + unless (%$rm) { + close $fh; + return; + } + } + command_close_pipe($fh, $ctx); + + my ($r, $p, $bat) = ($self->{r}, $self->{pool}, $self->{bat}); + foreach my $d (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$rm) { + $self->close_directory($bat->{$d}, $p); + my ($dn) = ($d =~ m#^(.*?)/?(?:[^/]+)$#); + print "\tD+\t$d/\n" unless $::_q; + $self->SUPER::delete_entry($d, $r, $bat->{$dn}, $p); + delete $bat->{$d}; + } +} + +sub open_or_add_dir { + my ($self, $full_path, $baton, $deletions) = @_; + my $t = $self->{types}->{$full_path}; + if (!defined $t) { + die "$full_path not known in r$self->{r} or we have a bug!\n"; + } + { + no warnings 'once'; + # SVN::Node::none and SVN::Node::file are used only once, + # so we're shutting up Perl's warnings about them. + if ($t == $SVN::Node::none || defined($deletions->{$full_path})) { + return $self->add_directory($full_path, $baton, + undef, -1, $self->{pool}); + } elsif ($t == $SVN::Node::dir) { + return $self->open_directory($full_path, $baton, + $self->{r}, $self->{pool}); + } # no warnings 'once' + print STDERR "$full_path already exists in repository at ", + "r$self->{r} and it is not a directory (", + ($t == $SVN::Node::file ? 'file' : 'unknown'),"/$t)\n"; + } # no warnings 'once' + exit 1; +} + +sub ensure_path { + my ($self, $path, $deletions) = @_; + my $bat = $self->{bat}; + my $repo_path = $self->repo_path($path); + return $bat->{''} unless (length $repo_path); + + my @p = split m#/+#, $repo_path; + my $c = shift @p; + $bat->{$c} ||= $self->open_or_add_dir($c, $bat->{''}, $deletions); + while (@p) { + my $c0 = $c; + $c .= '/' . shift @p; + $bat->{$c} ||= $self->open_or_add_dir($c, $bat->{$c0}, $deletions); + } + return $bat->{$c}; +} + +# Subroutine to convert a globbing pattern to a regular expression. +# From perl cookbook. +sub glob2pat { + my $globstr = shift; + my %patmap = ('*' => '.*', '?' => '.', '[' => '[', ']' => ']'); + $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; + return '^' . $globstr . '$'; +} + +sub check_autoprop { + my ($self, $pattern, $properties, $file, $fbat) = @_; + # Convert the globbing pattern to a regular expression. + my $regex = glob2pat($pattern); + # Check if the pattern matches the file name. + if($file =~ m/($regex)/) { + # Parse the list of properties to set. + my @props = split(/;/, $properties); + foreach my $prop (@props) { + # Parse 'name=value' syntax and set the property. + if ($prop =~ /([^=]+)=(.*)/) { + my ($n,$v) = ($1,$2); + for ($n, $v) { + s/^\s+//; s/\s+$//; + } + $self->change_file_prop($fbat, $n, $v); + } + } + } +} + +sub apply_autoprops { + my ($self, $file, $fbat) = @_; + my $conf_t = ${$self->{config}}{'config'}; + no warnings 'once'; + # Check [miscellany]/enable-auto-props in svn configuration. + if (SVN::_Core::svn_config_get_bool( + $conf_t, + $SVN::_Core::SVN_CONFIG_SECTION_MISCELLANY, + $SVN::_Core::SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS, + 0)) { + # Auto-props are enabled. Enumerate them to look for matches. + my $callback = sub { + $self->check_autoprop($_[0], $_[1], $file, $fbat); + }; + SVN::_Core::svn_config_enumerate( + $conf_t, + $SVN::_Core::SVN_CONFIG_SECTION_AUTO_PROPS, + $callback); + } +} + +sub A { + my ($self, $m, $deletions) = @_; + my ($dir, $file) = split_path($m->{file_b}); + my $pbat = $self->ensure_path($dir, $deletions); + my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, + undef, -1); + print "\tA\t$m->{file_b}\n" unless $::_q; + $self->apply_autoprops($file, $fbat); + $self->chg_file($fbat, $m); + $self->close_file($fbat,undef,$self->{pool}); +} + +sub C { + my ($self, $m, $deletions) = @_; + my ($dir, $file) = split_path($m->{file_b}); + my $pbat = $self->ensure_path($dir, $deletions); + my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, + $self->url_path($m->{file_a}), $self->{r}); + print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q; + $self->chg_file($fbat, $m); + $self->close_file($fbat,undef,$self->{pool}); +} + +sub delete_entry { + my ($self, $path, $pbat) = @_; + my $rpath = $self->repo_path($path); + my ($dir, $file) = split_path($rpath); + $self->{rm}->{$dir} = 1; + $self->SUPER::delete_entry($rpath, $self->{r}, $pbat, $self->{pool}); +} + +sub R { + my ($self, $m, $deletions) = @_; + my ($dir, $file) = split_path($m->{file_b}); + my $pbat = $self->ensure_path($dir, $deletions); + my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat, + $self->url_path($m->{file_a}), $self->{r}); + print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q; + $self->apply_autoprops($file, $fbat); + $self->chg_file($fbat, $m); + $self->close_file($fbat,undef,$self->{pool}); + + ($dir, $file) = split_path($m->{file_a}); + $pbat = $self->ensure_path($dir, $deletions); + $self->delete_entry($m->{file_a}, $pbat); +} + +sub M { + my ($self, $m, $deletions) = @_; + my ($dir, $file) = split_path($m->{file_b}); + my $pbat = $self->ensure_path($dir, $deletions); + my $fbat = $self->open_file($self->repo_path($m->{file_b}), + $pbat,$self->{r},$self->{pool}); + print "\t$m->{chg}\t$m->{file_b}\n" unless $::_q; + $self->chg_file($fbat, $m); + $self->close_file($fbat,undef,$self->{pool}); +} + +sub T { shift->M(@_) } + +sub change_file_prop { + my ($self, $fbat, $pname, $pval) = @_; + $self->SUPER::change_file_prop($fbat, $pname, $pval, $self->{pool}); +} + +sub change_dir_prop { + my ($self, $pbat, $pname, $pval) = @_; + $self->SUPER::change_dir_prop($pbat, $pname, $pval, $self->{pool}); +} + +sub _chg_file_get_blob ($$$$) { + my ($self, $fbat, $m, $which) = @_; + my $fh = $::_repository->temp_acquire("git_blob_$which"); + if ($m->{"mode_$which"} =~ /^120/) { + print $fh 'link ' or croak $!; + $self->change_file_prop($fbat,'svn:special','*'); + } elsif ($m->{mode_a} =~ /^120/ && $m->{"mode_$which"} !~ /^120/) { + $self->change_file_prop($fbat,'svn:special',undef); + } + my $blob = $m->{"sha1_$which"}; + return ($fh,) if ($blob =~ /^0{40}$/); + my $size = $::_repository->cat_blob($blob, $fh); + croak "Failed to read object $blob" if ($size < 0); + $fh->flush == 0 or croak $!; + seek $fh, 0, 0 or croak $!; + + my $exp = ::md5sum($fh); + seek $fh, 0, 0 or croak $!; + return ($fh, $exp); +} + +sub chg_file { + my ($self, $fbat, $m) = @_; + if ($m->{mode_b} =~ /755$/ && $m->{mode_a} !~ /755$/) { + $self->change_file_prop($fbat,'svn:executable','*'); + } elsif ($m->{mode_b} !~ /755$/ && $m->{mode_a} =~ /755$/) { + $self->change_file_prop($fbat,'svn:executable',undef); + } + my ($fh_a, $exp_a) = _chg_file_get_blob $self, $fbat, $m, 'a'; + my ($fh_b, $exp_b) = _chg_file_get_blob $self, $fbat, $m, 'b'; + my $pool = SVN::Pool->new; + my $atd = $self->apply_textdelta($fbat, $exp_a, $pool); + if (-s $fh_a) { + my $txstream = SVN::TxDelta::new ($fh_a, $fh_b, $pool); + my $res = SVN::TxDelta::send_txstream($txstream, @$atd, $pool); + if (defined $res) { + die "Unexpected result from send_txstream: $res\n", + "(SVN::Core::VERSION: $SVN::Core::VERSION)\n"; + } + } else { + my $got = SVN::TxDelta::send_stream($fh_b, @$atd, $pool); + die "Checksum mismatch\nexpected: $exp_b\ngot: $got\n" + if ($got ne $exp_b); + } + Git::temp_release($fh_b, 1); + Git::temp_release($fh_a, 1); + $pool->clear; +} + +sub D { + my ($self, $m, $deletions) = @_; + my ($dir, $file) = split_path($m->{file_b}); + my $pbat = $self->ensure_path($dir, $deletions); + print "\tD\t$m->{file_b}\n" unless $::_q; + $self->delete_entry($m->{file_b}, $pbat); +} + +sub close_edit { + my ($self) = @_; + my ($p,$bat) = ($self->{pool}, $self->{bat}); + foreach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) { + next if $_ eq ''; + $self->close_directory($bat->{$_}, $p); + } + $self->close_directory($bat->{''}, $p); + $self->SUPER::close_edit($p); + $p->clear; +} + +sub abort_edit { + my ($self) = @_; + $self->SUPER::abort_edit($self->{pool}); +} + +sub DESTROY { + my $self = shift; + $self->SUPER::DESTROY(@_); + $self->{pool}->clear; +} + +# this drives the editor +sub apply_diff { + my ($self) = @_; + my $mods = $self->{mods}; + my %o = ( D => 0, C => 1, R => 2, A => 3, M => 4, T => 5 ); + my %deletions; + + foreach my $m (@$mods) { + if ($m->{chg} eq "D") { + $deletions{$m->{file_b}} = 1; + } + } + + foreach my $m (sort { $o{$a->{chg}} <=> $o{$b->{chg}} } @$mods) { + my $f = $m->{chg}; + if (defined $o{$f}) { + $self->$f($m, \%deletions); + } else { + fatal("Invalid change type: $f"); + } + } + + if (defined($self->{mergeinfo})) { + $self->change_dir_prop($self->{bat}{''}, "svn:mergeinfo", + $self->{mergeinfo}); + } + $self->rmdirs if $_rmdir; + if (@$mods == 0 && !defined($self->{mergeinfo})) { + $self->abort_edit; + } else { + $self->close_edit; + } + return scalar @$mods; +} + +1; +__END__ + +Git::SVN::Editor - commit driver for "git svn set-tree" and dcommit + +=head1 SYNOPSIS + + use Git::SVN::Editor; + use Git::SVN::Ra; + + my $ra = Git::SVN::Ra->new($url); + my %opts = ( + r => 19, + log => "log message", + ra => $ra, + config => SVN::Core::config_get_config($svn_config_dir), + tree_a => "$commit^", + tree_b => "$commit", + editor_cb => sub { print "Committed r$_[0]\n"; }, + mergeinfo => "/branches/foo:1-10", + svn_path => "trunk" + ); + Git::SVN::Editor->new(\%opts)->apply_diff or print "No changes\n"; + + my $re = Git::SVN::Editor::glob2pat("trunk/*"); + if ($branchname =~ /$re/) { + print "matched!\n"; + } + +=head1 DESCRIPTION + +This module is an implementation detail of the "git svn" command. +Do not use it unless you are developing git-svn. + +This module adapts the C<SVN::Delta::Editor> object returned by +C<SVN::Delta::get_commit_editor> and drives it to convey the +difference between two git tree objects to a remote Subversion +repository. + +The interface will change as git-svn evolves. + +=head1 DEPENDENCIES + +Subversion perl bindings, +the core L<Carp> and L<IO::File> modules, +and git's L<Git> helper module. + +C<Git::SVN::Editor> has not been tested using callers other than +B<git-svn> itself. + +=head1 SEE ALSO + +L<SVN::Delta>, +L<Git::SVN::Fetcher>. + +=head1 INCOMPATIBILITIES + +None reported. + +=head1 BUGS + +None. diff --git a/perl/Git/SVN/Fetcher.pm b/perl/Git/SVN/Fetcher.pm index 4e9c77d757..ef8e9ed2a5 100644 --- a/perl/Git/SVN/Fetcher.pm +++ b/perl/Git/SVN/Fetcher.pm @@ -591,7 +591,8 @@ B<git-svn> itself. =head1 SEE ALSO -L<SVN::Delta>. +L<SVN::Delta>, +L<Git::SVN::Editor>. =head1 INCOMPATIBILITIES diff --git a/perl/Git/SVN/Memoize/YAML.pm b/perl/Git/SVN/Memoize/YAML.pm new file mode 100644 index 0000000000..9676b8f2f7 --- /dev/null +++ b/perl/Git/SVN/Memoize/YAML.pm @@ -0,0 +1,93 @@ +package Git::SVN::Memoize::YAML; +use warnings; +use strict; +use YAML::Any (); + +# based on Memoize::Storable. + +sub TIEHASH { + my $package = shift; + my $filename = shift; + my $truehash = (-e $filename) ? YAML::Any::LoadFile($filename) : {}; + my $self = {FILENAME => $filename, H => $truehash}; + bless $self => $package; +} + +sub STORE { + my $self = shift; + $self->{H}{$_[0]} = $_[1]; +} + +sub FETCH { + my $self = shift; + $self->{H}{$_[0]}; +} + +sub EXISTS { + my $self = shift; + exists $self->{H}{$_[0]}; +} + +sub DESTROY { + my $self = shift; + YAML::Any::DumpFile($self->{FILENAME}, $self->{H}); +} + +sub SCALAR { + my $self = shift; + scalar(%{$self->{H}}); +} + +sub FIRSTKEY { + 'Fake hash from Git::SVN::Memoize::YAML'; +} + +sub NEXTKEY { + undef; +} + +1; +__END__ + +=head1 NAME + +Git::SVN::Memoize::YAML - store Memoized data in YAML format + +=head1 SYNOPSIS + + use Memoize; + use Git::SVN::Memoize::YAML; + + tie my %cache => 'Git::SVN::Memoize::YAML', $filename; + memoize('slow_function', SCALAR_CACHE => [HASH => \%cache]); + slow_function(arguments); + +=head1 DESCRIPTION + +This module provides a class that can be used to tie a hash to a +YAML file. The file is read when the hash is initialized and +rewritten when the hash is destroyed. + +The intent is to allow L<Memoize> to back its cache with a file in +YAML format, just like L<Memoize::Storable> allows L<Memoize> to +back its cache with a file in Storable format. Unlike the Storable +format, the YAML format is platform-independent and fairly stable. + +Carps on error. + +=head1 DIAGNOSTICS + +See L<YAML::Any>. + +=head1 DEPENDENCIES + +L<YAML::Any> from CPAN. + +=head1 INCOMPATIBILITIES + +None reported. + +=head1 BUGS + +The entire cache is read into a Perl hash when loading the file, +so this is not very scalable. diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm new file mode 100644 index 0000000000..23ff43e86b --- /dev/null +++ b/perl/Git/SVN/Ra.pm @@ -0,0 +1,658 @@ +package Git::SVN::Ra; +use vars qw/@ISA $config_dir $_ignore_refs_regex $_log_window_size/; +use strict; +use warnings; +use SVN::Client; +use SVN::Ra; +BEGIN { + @ISA = qw(SVN::Ra); +} + +my ($ra_invalid, $can_do_switch, %ignored_err, $RA); + +BEGIN { + # enforce temporary pool usage for some simple functions + no strict 'refs'; + for my $f (qw/rev_proplist get_latest_revnum get_uuid get_repos_root + get_file/) { + my $SUPER = "SUPER::$f"; + *$f = sub { + my $self = shift; + my $pool = SVN::Pool->new; + my @ret = $self->$SUPER(@_,$pool); + $pool->clear; + wantarray ? @ret : $ret[0]; + }; + } +} + +sub _auth_providers () { + my @rv = ( + SVN::Client::get_simple_provider(), + SVN::Client::get_ssl_server_trust_file_provider(), + SVN::Client::get_simple_prompt_provider( + \&Git::SVN::Prompt::simple, 2), + SVN::Client::get_ssl_client_cert_file_provider(), + SVN::Client::get_ssl_client_cert_prompt_provider( + \&Git::SVN::Prompt::ssl_client_cert, 2), + SVN::Client::get_ssl_client_cert_pw_file_provider(), + SVN::Client::get_ssl_client_cert_pw_prompt_provider( + \&Git::SVN::Prompt::ssl_client_cert_pw, 2), + SVN::Client::get_username_provider(), + SVN::Client::get_ssl_server_trust_prompt_provider( + \&Git::SVN::Prompt::ssl_server_trust), + SVN::Client::get_username_prompt_provider( + \&Git::SVN::Prompt::username, 2) + ); + + # earlier 1.6.x versions would segfault, and <= 1.5.x didn't have + # this function + if (::compare_svn_version('1.6.15') >= 0) { + my $config = SVN::Core::config_get_config($config_dir); + my ($p, @a); + # config_get_config returns all config files from + # ~/.subversion, auth_get_platform_specific_client_providers + # just wants the config "file". + @a = ($config->{'config'}, undef); + $p = SVN::Core::auth_get_platform_specific_client_providers(@a); + # Insert the return value from + # auth_get_platform_specific_providers + unshift @rv, @$p; + } + \@rv; +} + +sub escape_uri_only { + my ($uri) = @_; + my @tmp; + foreach (split m{/}, $uri) { + s/([^~\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg; + push @tmp, $_; + } + join('/', @tmp); +} + +sub escape_url { + my ($url) = @_; + if ($url =~ m#^(https?)://([^/]+)(.*)$#) { + my ($scheme, $domain, $uri) = ($1, $2, escape_uri_only($3)); + $url = "$scheme://$domain$uri"; + } + $url; +} + +sub new { + my ($class, $url) = @_; + $url =~ s!/+$!!; + return $RA if ($RA && $RA->{url} eq $url); + + ::_req_svn(); + + SVN::_Core::svn_config_ensure($config_dir, undef); + my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers); + my $config = SVN::Core::config_get_config($config_dir); + $RA = undef; + my $dont_store_passwords = 1; + my $conf_t = ${$config}{'config'}; + { + no warnings 'once'; + # The usage of $SVN::_Core::SVN_CONFIG_* variables + # produces warnings that variables are used only once. + # I had not found the better way to shut them up, so + # the warnings of type 'once' are disabled in this block. + if (SVN::_Core::svn_config_get_bool($conf_t, + $SVN::_Core::SVN_CONFIG_SECTION_AUTH, + $SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS, + 1) == 0) { + SVN::_Core::svn_auth_set_parameter($baton, + $SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS, + bless (\$dont_store_passwords, "_p_void")); + } + if (SVN::_Core::svn_config_get_bool($conf_t, + $SVN::_Core::SVN_CONFIG_SECTION_AUTH, + $SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS, + 1) == 0) { + $Git::SVN::Prompt::_no_auth_cache = 1; + } + } # no warnings 'once' + my $self = SVN::Ra->new(url => escape_url($url), auth => $baton, + config => $config, + pool => SVN::Pool->new, + auth_provider_callbacks => $callbacks); + $self->{url} = $url; + $self->{svn_path} = $url; + $self->{repos_root} = $self->get_repos_root; + $self->{svn_path} =~ s#^\Q$self->{repos_root}\E(/|$)##; + $self->{cache} = { check_path => { r => 0, data => {} }, + get_dir => { r => 0, data => {} } }; + $RA = bless $self, $class; +} + +sub check_path { + my ($self, $path, $r) = @_; + my $cache = $self->{cache}->{check_path}; + if ($r == $cache->{r} && exists $cache->{data}->{$path}) { + return $cache->{data}->{$path}; + } + my $pool = SVN::Pool->new; + my $t = $self->SUPER::check_path($path, $r, $pool); + $pool->clear; + if ($r != $cache->{r}) { + %{$cache->{data}} = (); + $cache->{r} = $r; + } + $cache->{data}->{$path} = $t; +} + +sub get_dir { + my ($self, $dir, $r) = @_; + my $cache = $self->{cache}->{get_dir}; + if ($r == $cache->{r}) { + if (my $x = $cache->{data}->{$dir}) { + return wantarray ? @$x : $x->[0]; + } + } + my $pool = SVN::Pool->new; + my ($d, undef, $props) = $self->SUPER::get_dir($dir, $r, $pool); + my %dirents = map { $_ => { kind => $d->{$_}->kind } } keys %$d; + $pool->clear; + if ($r != $cache->{r}) { + %{$cache->{data}} = (); + $cache->{r} = $r; + } + $cache->{data}->{$dir} = [ \%dirents, $r, $props ]; + wantarray ? (\%dirents, $r, $props) : \%dirents; +} + +sub DESTROY { + # do not call the real DESTROY since we store ourselves in $RA +} + +# get_log(paths, start, end, limit, +# discover_changed_paths, strict_node_history, receiver) +sub get_log { + my ($self, @args) = @_; + my $pool = SVN::Pool->new; + + # svn_log_changed_path_t objects passed to get_log are likely to be + # overwritten even if only the refs are copied to an external variable, + # so we should dup the structures in their entirety. Using an + # externally passed pool (instead of our temporary and quickly cleared + # pool in Git::SVN::Ra) does not help matters at all... + my $receiver = pop @args; + my $prefix = "/".$self->{svn_path}; + $prefix =~ s#/+($)##; + my $prefix_regex = qr#^\Q$prefix\E#; + push(@args, sub { + my ($paths) = $_[0]; + return &$receiver(@_) unless $paths; + $_[0] = (); + foreach my $p (keys %$paths) { + my $i = $paths->{$p}; + # Make path relative to our url, not repos_root + $p =~ s/$prefix_regex//; + my %s = map { $_ => $i->$_; } + qw/copyfrom_path copyfrom_rev action/; + if ($s{'copyfrom_path'}) { + $s{'copyfrom_path'} =~ s/$prefix_regex//; + } + $_[0]{$p} = \%s; + } + &$receiver(@_); + }); + + + # the limit parameter was not supported in SVN 1.1.x, so we + # drop it. Therefore, the receiver callback passed to it + # is made aware of this limitation by being wrapped if + # the limit passed to is being wrapped. + if (::compare_svn_version('1.2.0') <= 0) { + my $limit = splice(@args, 3, 1); + if ($limit > 0) { + my $receiver = pop @args; + push(@args, sub { &$receiver(@_) if (--$limit >= 0) }); + } + } + my $ret = $self->SUPER::get_log(@args, $pool); + $pool->clear; + $ret; +} + +sub trees_match { + my ($self, $url1, $rev1, $url2, $rev2) = @_; + my $ctx = SVN::Client->new(auth => _auth_providers); + my $out = IO::File->new_tmpfile; + + # older SVN (1.1.x) doesn't take $pool as the last parameter for + # $ctx->diff(), so we'll create a default one + my $pool = SVN::Pool->new_default_sub; + + $ra_invalid = 1; # this will open a new SVN::Ra connection to $url1 + $ctx->diff([], $url1, $rev1, $url2, $rev2, 1, 1, 0, $out, $out); + $out->flush; + my $ret = (($out->stat)[7] == 0); + close $out or croak $!; + + $ret; +} + +sub get_commit_editor { + my ($self, $log, $cb, $pool) = @_; + + my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef, 0) : (); + $self->SUPER::get_commit_editor($log, $cb, @lock, $pool); +} + +sub gs_do_update { + my ($self, $rev_a, $rev_b, $gs, $editor) = @_; + my $new = ($rev_a == $rev_b); + my $path = $gs->{path}; + + if ($new && -e $gs->{index}) { + unlink $gs->{index} or die + "Couldn't unlink index: $gs->{index}: $!\n"; + } + my $pool = SVN::Pool->new; + $editor->set_path_strip($path); + my (@pc) = split m#/#, $path; + my $reporter = $self->do_update($rev_b, (@pc ? shift @pc : ''), + 1, $editor, $pool); + my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : (); + + # Since we can't rely on svn_ra_reparent being available, we'll + # just have to do some magic with set_path to make it so + # we only want a partial path. + my $sp = ''; + my $final = join('/', @pc); + while (@pc) { + $reporter->set_path($sp, $rev_b, 0, @lock, $pool); + $sp .= '/' if length $sp; + $sp .= shift @pc; + } + die "BUG: '$sp' != '$final'\n" if ($sp ne $final); + + $reporter->set_path($sp, $rev_a, $new, @lock, $pool); + + $reporter->finish_report($pool); + $pool->clear; + $editor->{git_commit_ok}; +} + +# this requires SVN 1.4.3 or later (do_switch didn't work before 1.4.3, and +# svn_ra_reparent didn't work before 1.4) +sub gs_do_switch { + my ($self, $rev_a, $rev_b, $gs, $url_b, $editor) = @_; + my $path = $gs->{path}; + my $pool = SVN::Pool->new; + + my $full_url = $self->{url}; + my $old_url = $full_url; + $full_url .= '/' . $path if length $path; + my ($ra, $reparented); + + if ($old_url =~ m#^svn(\+ssh)?://# || + ($full_url =~ m#^https?://# && + escape_url($full_url) ne $full_url)) { + $_[0] = undef; + $self = undef; + $RA = undef; + $ra = Git::SVN::Ra->new($full_url); + $ra_invalid = 1; + } elsif ($old_url ne $full_url) { + SVN::_Ra::svn_ra_reparent($self->{session}, $full_url, $pool); + $self->{url} = $full_url; + $reparented = 1; + } + + $ra ||= $self; + $url_b = escape_url($url_b); + my $reporter = $ra->do_switch($rev_b, '', 1, $url_b, $editor, $pool); + my @lock = (::compare_svn_version('1.2.0') >= 0) ? (undef) : (); + $reporter->set_path('', $rev_a, 0, @lock, $pool); + $reporter->finish_report($pool); + + if ($reparented) { + SVN::_Ra::svn_ra_reparent($self->{session}, $old_url, $pool); + $self->{url} = $old_url; + } + + $pool->clear; + $editor->{git_commit_ok}; +} + +sub longest_common_path { + my ($gsv, $globs) = @_; + my %common; + my $common_max = scalar @$gsv; + + foreach my $gs (@$gsv) { + my @tmp = split m#/#, $gs->{path}; + my $p = ''; + foreach (@tmp) { + $p .= length($p) ? "/$_" : $_; + $common{$p} ||= 0; + $common{$p}++; + } + } + $globs ||= []; + $common_max += scalar @$globs; + foreach my $glob (@$globs) { + my @tmp = split m#/#, $glob->{path}->{left}; + my $p = ''; + foreach (@tmp) { + $p .= length($p) ? "/$_" : $_; + $common{$p} ||= 0; + $common{$p}++; + } + } + + my $longest_path = ''; + foreach (sort {length $b <=> length $a} keys %common) { + if ($common{$_} == $common_max) { + $longest_path = $_; + last; + } + } + $longest_path; +} + +sub gs_fetch_loop_common { + my ($self, $base, $head, $gsv, $globs) = @_; + return if ($base > $head); + my $inc = $_log_window_size; + my ($min, $max) = ($base, $head < $base + $inc ? $head : $base + $inc); + my $longest_path = longest_common_path($gsv, $globs); + my $ra_url = $self->{url}; + my $find_trailing_edge; + while (1) { + my %revs; + my $err; + my $err_handler = $SVN::Error::handler; + $SVN::Error::handler = sub { + ($err) = @_; + skip_unknown_revs($err); + }; + sub _cb { + my ($paths, $r, $author, $date, $log) = @_; + [ $paths, + { author => $author, date => $date, log => $log } ]; + } + $self->get_log([$longest_path], $min, $max, 0, 1, 1, + sub { $revs{$_[1]} = _cb(@_) }); + if ($err) { + print "Checked through r$max\r"; + } else { + $find_trailing_edge = 1; + } + if ($err and $find_trailing_edge) { + print STDERR "Path '$longest_path' ", + "was probably deleted:\n", + $err->expanded_message, + "\nWill attempt to follow ", + "revisions r$min .. r$max ", + "committed before the deletion\n"; + my $hi = $max; + while (--$hi >= $min) { + my $ok; + $self->get_log([$longest_path], $min, $hi, + 0, 1, 1, sub { + $ok = $_[1]; + $revs{$_[1]} = _cb(@_) }); + if ($ok) { + print STDERR "r$min .. r$ok OK\n"; + last; + } + } + $find_trailing_edge = 0; + } + $SVN::Error::handler = $err_handler; + + my %exists = map { $_->{path} => $_ } @$gsv; + foreach my $r (sort {$a <=> $b} keys %revs) { + my ($paths, $logged) = @{$revs{$r}}; + + foreach my $gs ($self->match_globs(\%exists, $paths, + $globs, $r)) { + if ($gs->rev_map_max >= $r) { + next; + } + next unless $gs->match_paths($paths, $r); + $gs->{logged_rev_props} = $logged; + if (my $last_commit = $gs->last_commit) { + $gs->assert_index_clean($last_commit); + } + my $log_entry = $gs->do_fetch($paths, $r); + if ($log_entry) { + $gs->do_git_commit($log_entry); + } + $Git::SVN::INDEX_FILES{$gs->{index}} = 1; + } + foreach my $g (@$globs) { + my $k = "svn-remote.$g->{remote}." . + "$g->{t}-maxRev"; + Git::SVN::tmp_config($k, $r); + } + if ($ra_invalid) { + $_[0] = undef; + $self = undef; + $RA = undef; + $self = Git::SVN::Ra->new($ra_url); + $ra_invalid = undef; + } + } + # pre-fill the .rev_db since it'll eventually get filled in + # with '0' x40 if something new gets committed + foreach my $gs (@$gsv) { + next if $gs->rev_map_max >= $max; + next if defined $gs->rev_map_get($max); + $gs->rev_map_set($max, 0 x40); + } + foreach my $g (@$globs) { + my $k = "svn-remote.$g->{remote}.$g->{t}-maxRev"; + Git::SVN::tmp_config($k, $max); + } + last if $max >= $head; + $min = $max + 1; + $max += $inc; + $max = $head if ($max > $head); + } + Git::SVN::gc(); +} + +sub get_dir_globbed { + my ($self, $left, $depth, $r) = @_; + + my @x = eval { $self->get_dir($left, $r) }; + return unless scalar @x == 3; + my $dirents = $x[0]; + my @finalents; + foreach my $de (keys %$dirents) { + next if $dirents->{$de}->{kind} != $SVN::Node::dir; + if ($depth > 1) { + my @args = ("$left/$de", $depth - 1, $r); + foreach my $dir ($self->get_dir_globbed(@args)) { + push @finalents, "$de/$dir"; + } + } else { + push @finalents, $de; + } + } + @finalents; +} + +# return value: 0 -- don't ignore, 1 -- ignore +sub is_ref_ignored { + my ($g, $p) = @_; + my $refname = $g->{ref}->full_path($p); + return 1 if defined($g->{ignore_refs_regex}) && + $refname =~ m!$g->{ignore_refs_regex}!; + return 0 unless defined($_ignore_refs_regex); + return 1 if $refname =~ m!$_ignore_refs_regex!o; + return 0; +} + +sub match_globs { + my ($self, $exists, $paths, $globs, $r) = @_; + + sub get_dir_check { + my ($self, $exists, $g, $r) = @_; + + my @dirs = $self->get_dir_globbed($g->{path}->{left}, + $g->{path}->{depth}, + $r); + + foreach my $de (@dirs) { + my $p = $g->{path}->full_path($de); + next if $exists->{$p}; + next if (length $g->{path}->{right} && + ($self->check_path($p, $r) != + $SVN::Node::dir)); + next unless $p =~ /$g->{path}->{regex}/; + $exists->{$p} = Git::SVN->init($self->{url}, $p, undef, + $g->{ref}->full_path($de), 1); + } + } + foreach my $g (@$globs) { + if (my $path = $paths->{"/$g->{path}->{left}"}) { + if ($path->{action} =~ /^[AR]$/) { + get_dir_check($self, $exists, $g, $r); + } + } + foreach (keys %$paths) { + if (/$g->{path}->{left_regex}/ && + !/$g->{path}->{regex}/) { + next if $paths->{$_}->{action} !~ /^[AR]$/; + get_dir_check($self, $exists, $g, $r); + } + next unless /$g->{path}->{regex}/; + my $p = $1; + my $pathname = $g->{path}->full_path($p); + next if is_ref_ignored($g, $p); + next if $exists->{$pathname}; + next if ($self->check_path($pathname, $r) != + $SVN::Node::dir); + $exists->{$pathname} = Git::SVN->init( + $self->{url}, $pathname, undef, + $g->{ref}->full_path($p), 1); + } + my $c = ''; + foreach (split m#/#, $g->{path}->{left}) { + $c .= "/$_"; + next unless ($paths->{$c} && + ($paths->{$c}->{action} =~ /^[AR]$/)); + get_dir_check($self, $exists, $g, $r); + } + } + values %$exists; +} + +sub minimize_url { + my ($self) = @_; + return $self->{url} if ($self->{url} eq $self->{repos_root}); + my $url = $self->{repos_root}; + my @components = split(m!/!, $self->{svn_path}); + my $c = ''; + do { + $url .= "/$c" if length $c; + eval { + my $ra = (ref $self)->new($url); + my $latest = $ra->get_latest_revnum; + $ra->get_log("", $latest, 0, 1, 0, 1, sub {}); + }; + } while ($@ && ($c = shift @components)); + $url; +} + +sub can_do_switch { + my $self = shift; + unless (defined $can_do_switch) { + my $pool = SVN::Pool->new; + my $rep = eval { + $self->do_switch(1, '', 0, $self->{url}, + SVN::Delta::Editor->new, $pool); + }; + if ($@) { + $can_do_switch = 0; + } else { + $rep->abort_report($pool); + $can_do_switch = 1; + } + $pool->clear; + } + $can_do_switch; +} + +sub skip_unknown_revs { + my ($err) = @_; + my $errno = $err->apr_err(); + # Maybe the branch we're tracking didn't + # exist when the repo started, so it's + # not an error if it doesn't, just continue + # + # Wonderfully consistent library, eh? + # 160013 - svn:// and file:// + # 175002 - http(s):// + # 175007 - http(s):// (this repo required authorization, too...) + # More codes may be discovered later... + if ($errno == 175007 || $errno == 175002 || $errno == 160013) { + my $err_key = $err->expanded_message; + # revision numbers change every time, filter them out + $err_key =~ s/\d+/\0/g; + $err_key = "$errno\0$err_key"; + unless ($ignored_err{$err_key}) { + warn "W: Ignoring error from SVN, path probably ", + "does not exist: ($errno): ", + $err->expanded_message,"\n"; + warn "W: Do not be alarmed at the above message ", + "git-svn is just searching aggressively for ", + "old history.\n", + "This may take a while on large repositories\n"; + $ignored_err{$err_key} = 1; + } + return; + } + die "Error from SVN, ($errno): ", $err->expanded_message,"\n"; +} + +1; +__END__ + +Git::SVN::Ra - Subversion remote access functions for git-svn + +=head1 SYNOPSIS + + use Git::SVN::Ra; + + my $ra = Git::SVN::Ra->new($branchurl); + my ($dirents, $fetched_revnum, $props) = + $ra->get_dir('.', $SVN::Core::INVALID_REVNUM); + +=head1 DESCRIPTION + +This is a wrapper around the L<SVN::Ra> module for use by B<git-svn>. +It fills in some default parameters (such as the authentication +scheme), smooths over incompatibilities between libsvn versions, adds +caching, and implements some functions specific to B<git-svn>. + +Do not use it unless you are developing git-svn. The interface will +change as git-svn evolves. + +=head1 DEPENDENCIES + +Subversion perl bindings, +L<Git::SVN>. + +C<Git::SVN::Ra> has not been tested using callers other than +B<git-svn> itself. + +=head1 SEE ALSO + +L<SVN::Ra>. + +=head1 INCOMPATIBILITIES + +None reported. + +=head1 BUGS + +None. diff --git a/perl/Makefile b/perl/Makefile index 3e21766d8f..fe7a486464 100644 --- a/perl/Makefile +++ b/perl/Makefile @@ -2,6 +2,7 @@ # Makefile for perl support modules and routine # makfile:=perl.mak +modules = PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) prefix_SQ = $(subst ','\'',$(prefix)) @@ -22,19 +23,35 @@ clean: ifdef NO_PERL_MAKEMAKER instdir_SQ = $(subst ','\'',$(prefix)/lib) + +modules += Git +modules += Git/I18N +modules += Git/SVN/Memoize/YAML +modules += Git/SVN/Fetcher +modules += Git/SVN/Editor +modules += Git/SVN/Prompt +modules += Git/SVN/Ra + $(makfile): ../GIT-CFLAGS Makefile echo all: private-Error.pm Git.pm Git/I18N.pm > $@ - echo ' mkdir -p blib/lib/Git' >> $@ - echo ' $(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@ - echo ' $(RM) blib/lib/Git/I18N.pm; cp Git/I18N.pm blib/lib/Git/' >> $@ + echo ' mkdir -p blib/lib/Git/SVN/Memoize' >> $@ + set -e; \ + for i in $(modules); \ + do \ + echo ' $(RM) blib/lib/'$$i'.pm' >> $@; \ + echo ' cp '$$i'.pm blib/lib/'$$i'.pm' >> $@; \ + done echo ' $(RM) blib/lib/Error.pm' >> $@ '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \ echo ' cp private-Error.pm blib/lib/Error.pm' >> $@ echo install: >> $@ - echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@ - echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git"' >> $@ - echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@ - echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Git/I18N.pm"; cp Git/I18N.pm "$$(DESTDIR)$(instdir_SQ)/Git"' >> $@ + echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git/SVN/Memoize"' >> $@ + set -e; \ + for i in $(modules); \ + do \ + echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ + echo ' cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \ + done echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@ '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \ echo ' cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@ diff --git a/perl/Makefile.PL b/perl/Makefile.PL index 424890a1a4..b54b04a619 100644 --- a/perl/Makefile.PL +++ b/perl/Makefile.PL @@ -24,11 +24,18 @@ endif MAKE_FRAG } +# XXX. When editing this list: +# +# * Please update perl/Makefile, too. +# * Don't forget to test with NO_PERL_MAKEMAKER=YesPlease my %pm = ( 'Git.pm' => '$(INST_LIBDIR)/Git.pm', 'Git/I18N.pm' => '$(INST_LIBDIR)/Git/I18N.pm', + 'Git/SVN/Memoize/YAML.pm' => '$(INST_LIBDIR)/Git/SVN/Memoize/YAML.pm', 'Git/SVN/Fetcher.pm' => '$(INST_LIBDIR)/Git/SVN/Fetcher.pm', + 'Git/SVN/Editor.pm' => '$(INST_LIBDIR)/Git/SVN/Editor.pm', 'Git/SVN/Prompt.pm' => '$(INST_LIBDIR)/Git/SVN/Prompt.pm', + 'Git/SVN/Ra.pm' => '$(INST_LIBDIR)/Git/SVN/Ra.pm', ); # We come with our own bundled Error.pm. It's not in the set of default @@ -17,7 +17,8 @@ Leader: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Language: it (Italian) Repository: https://github.com/quizzlo/git-po-it/ -Leader: Marco Paolone <marcopaolone@gmail.com> +Leader: Marco Paolone <marcopaolone AT gmail.com> +Members: Stefano Lattarini <stefano.lattarini AT gmail.com> Language: nl (Dutch) Repository: https://github.com/vfr-nl/git-po/ @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: git 1.7.11\n" "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n" -"POT-Creation-Date: 2012-06-02 07:03+0800\n" +"POT-Creation-Date: 2012-06-08 10:20+0800\n" "PO-Revision-Date: 2012-03-28 18:46+0200\n" "Last-Translator: Ralf Thielow <ralf.thielow@googlemail.com>\n" "Language-Team: German\n" @@ -4929,6 +4929,32 @@ msgstr "" msgid "You need to set your committer info first" msgstr "Du musst zuerst die Informationen des Eintragenden setzen." +#: git-am.sh:95 +msgid "" +"You seem to have moved HEAD since the last 'am' failure.\n" +"Not rewinding to ORIG_HEAD" +msgstr "" +"Du scheinst seit dem letzten gescheiterten 'am' die Zweigspitze (HEAD)\n" +"geändert zu haben.\n" +"Keine Zurücksetzung zu ORIG_HEAD." + +#: git-am.sh:105 +#, sh-format +msgid "" +"When you have resolved this problem run \"$cmdline --resolved\".\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"Wenn du das Problem aufgelöst hast, führe \"$cmdline --resolved\" aus.\n" +"Falls du diesen Patch auslassen möchtest, führe stattdessen " +"\"$cmdline --skip\" aus.\n" +"Um den ursprünglichen Zweig wiederherzustellen und die Anwendung der Patches\n" +"abzubrechen, führe \"$cmdline --abort\" aus." + +#: git-am.sh:121 +msgid "Cannot fall back to three-way merge." +msgstr "Kann nicht zu 3-Wege-Zusammenführung zurückfallen." + #: git-am.sh:137 msgid "Repository lacks necessary blobs to fall back on 3-way merge." msgstr "" @@ -4985,12 +5011,33 @@ msgid "Dirty index: cannot apply patches (dirty: $files)" msgstr "" "Unsaubere Bereitstellung: kann Patches nicht anwenden (unsauber: $files)" +#: git-am.sh:671 +#, sh-format +msgid "" +"Patch is empty. Was it split wrong?\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"Patch ist leer. Wurde er falsch aufgeteilt?\n" +"Wenn du diesen Patch auslassen möchtest, führe stattdessen " +"\"$cmdline --skip\" aus.\n" +"Um den ursprünglichen Zweig wiederherzustellen und die Anwendung der Patches\n" +"abzubrechen, führe \"$cmdline --abort\" aus." + +#: git-am.sh:708 +msgid "Patch does not have a valid e-mail address." +msgstr "Patch enthält keine gültige eMail-Adresse." + #: git-am.sh:755 msgid "cannot be interactive without stdin connected to a terminal." msgstr "" "Kann nicht interaktiv sein, ohne dass die Standard-Eingabe mit einem " "Terminal verbunden ist." +#: git-am.sh:759 +msgid "Commit Body is:" +msgstr "Beschreibung der Eintragung ist:" + #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a] #. in your translation. The program will only accept English #. input at this point. @@ -5003,14 +5050,42 @@ msgstr "Anwenden? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all " msgid "Applying: $FIRSTLINE" msgstr "Wende an: $FIRSTLINE" +#: git-am.sh:823 +msgid "" +"No changes - did you forget to use 'git add'?\n" +"If there is nothing left to stage, chances are that something else\n" +"already introduced the same changes; you might want to skip this patch." +msgstr "" +"Keine Änderungen - hast du vergessen 'git add' zu benutzen?\n" +"Wenn keine Änderungen mehr zum Bereitstellen vorhanden sind, könnten\n" +"diese bereits anderweitig eingefügt worden sein; du könntest diesen Patch\n" +"auslassen." + +#: git-am.sh:831 +msgid "" +"You still have unmerged paths in your index\n" +"did you forget to use 'git add'?" +msgstr "" +"Du hast immer noch nicht zusammengeführte Pfade in der Bereitstellung.\n" +"Hast du vergessen 'git add' zu benutzen?" + #: git-am.sh:847 msgid "No changes -- Patch already applied." msgstr "Keine Änderungen -- Patches bereits angewendet." +#: git-am.sh:857 +#, sh-format +msgid "Patch failed at $msgnum $FIRSTLINE" +msgstr "Anwendung des Patches fehlgeschlagen bei $msgnum $FIRSTLINE" + #: git-am.sh:873 msgid "applying to an empty history" msgstr "wende zu leerer Historie an" +#: git-bisect.sh:48 +msgid "You need to start by \"git bisect start\"" +msgstr "Du musst mit \"git bisect start\" beginnen." + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -5071,6 +5146,12 @@ msgstr "Ungültige Referenz-Eingabe: $rev" msgid "'git bisect bad' can take only one argument." msgstr "'git bisect bad' kann nur ein Argument entgegennehmen." +#. have bad but not good. we could bisect although +#. this is less optimum. +#: git-bisect.sh:273 +msgid "Warning: bisecting only with a bad commit." +msgstr "Warnung: halbiere nur mit einer fehlerhaften Version" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -5078,6 +5159,29 @@ msgstr "'git bisect bad' kann nur ein Argument entgegennehmen." msgid "Are you sure [Y/n]? " msgstr "Bist du sicher [Y/n]? " +#: git-bisect.sh:289 +msgid "" +"You need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"Du musst mindestens eine korrekte und eine fehlerhafte Version angeben.\n" +"(Du kannst dafür \"git bisect bad\" und \"git bisect good\" benutzen.)" + +#: git-bisect.sh:292 +msgid "" +"You need to start by \"git bisect start\".\n" +"You then need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"Du musst mit \"git bisect start\" beginnen.\n" +"Danach musst du mindestens eine korrekte und eine fehlerhafte Version " +"angeben.\n" +"(Du kannst dafür \"git bisect bad\" und \"git bisect good\" benutzen.)" + +#: git-bisect.sh:347 git-bisect.sh:474 +msgid "We are not bisecting." +msgstr "Wir sind nicht beim Halbieren." + #: git-bisect.sh:354 #, sh-format msgid "'$invalid' is not a valid commit" @@ -5105,9 +5209,36 @@ msgstr "kann $file nicht für das Abspielen lesen" msgid "?? what are you talking about?" msgstr "?? Was redest du da?" -#: git-bisect.sh:474 -msgid "We are not bisecting." -msgstr "Wir sind nicht beim Halbieren." +#: git-bisect.sh:420 +#, sh-format +msgid "running $command" +msgstr "führe $command aus" + +#: git-bisect.sh:427 +#, sh-format +msgid "" +"bisect run failed:\n" +"exit code $res from '$command' is < 0 or >= 128" +msgstr "" +"Ausführung der Halbierung fehlgeschlagen:\n" +"Rückkehrwert $res von '$command' ist < 0 oder >= 128" + +#: git-bisect.sh:453 +msgid "bisect run cannot continue any more" +msgstr "Ausführung der Halbierung kann nicht mehr fortgesetzt werden" + +#: git-bisect.sh:459 +#, sh-format +msgid "" +"bisect run failed:\n" +"'bisect_state $state' exited with error code $res" +msgstr "" +"Ausführung der Halbierung fehlgeschlagen:\n" +"'bisect_state $state' wurde mit Fehlerwert $res beendet" + +#: git-bisect.sh:466 +msgid "bisect run success" +msgstr "Halbierung erfolgreich ausgeführt" #: git-pull.sh:21 msgid "" @@ -5130,6 +5261,20 @@ msgstr "" "Aktualisiere eine ungeborenen Zweig mit Änderungen, die zur Bereitstellung " "hinzugefügt wurden" +#. The fetch involved updating the current branch. +#. The working tree and the index file is still based on the +#. $orig_head commit, but we are merging into $curr_head. +#. First update the working tree to match $curr_head. +#: git-pull.sh:228 +#, sh-format +msgid "" +"Warning: fetch updated the current branch head.\n" +"Warning: fast-forwarding your working tree from\n" +"Warning: commit $orig_head." +msgstr "" +"Warnung: Die Anforderung aktualisierte die Spitze des aktuellen Zweiges.\n" +"Warnung: Spule deinen Arbeitszweig von Version $orig_head vor." + #: git-pull.sh:253 msgid "Cannot merge multiple branches into empty head" msgstr "Kann nicht mehrere Zweige in einen ungeborenen Zweig zusammenführen" @@ -5166,6 +5311,26 @@ msgstr "Kann temporäre Bereitstellung nicht entfernen (kann nicht passieren)" msgid "Cannot record working tree state" msgstr "Kann Zustand des Arbeitsbaumes nicht aufzeichnen" +#. TRANSLATORS: $option is an invalid option, like +#. `--blah-blah'. The 7 spaces at the beginning of the +#. second line correspond to "error: ". So you should line +#. up the second line with however many characters the +#. translation of "error: " takes in your language. E.g. in +#. English this is: +#. +#. $ git stash save --blah-blah 2>&1 | head -n 2 +#. error: unknown option for 'stash save': --blah-blah +#. To provide a message, use git stash save -- '--blah-blah' +#: git-stash.sh:202 +#, sh-format +msgid "" +"error: unknown option for 'stash save': $option\n" +" To provide a message, use git stash save -- '$option'" +msgstr "" +"Fehler: unbekannte Option für 'stash save': $option\n" +" Um eine Beschreibung anzugeben, benutze \"git stash save -- " +"'$option'\"" + #: git-stash.sh:223 msgid "No local changes to save" msgstr "Keine lokalen Änderungen zum Speichern" @@ -5227,6 +5392,10 @@ msgstr "Konnte Bereitstellungsbaum nicht speichern" msgid "Cannot unstage modified files" msgstr "Kann geänderte Dateien nicht aus der Bereitstellung herausnehmen" +#: git-stash.sh:474 +msgid "Index was not unstashed." +msgstr "Bereitstellung wurde nicht ausgelagert." + #: git-stash.sh:491 #, sh-format msgid "Dropped ${REV} ($s)" @@ -5277,6 +5446,24 @@ msgstr "repo URL: '$repo' muss absolut sein oder mit ./|../ beginnen" msgid "'$sm_path' already exists in the index" msgstr "'$sm_path' existiert bereits in der Bereitstellung" +#: git-submodule.sh:270 +#, sh-format +msgid "" +"The following path is ignored by one of your .gitignore files:\n" +"$sm_path\n" +"Use -f if you really want to add it." +msgstr "" +"Der folgende Pfad wird durch eine deiner \".gitignore\" Dateien " +"ignoriert:\n" +"$sm_path\n" +"Benutze -f wenn du diesen wirklich hinzufügen möchtest." + +#: git-submodule.sh:281 +#, sh-format +msgid "Adding existing repo at '$sm_path' to the index" +msgstr "Füge existierendes Projektarchiv in '$sm_path' der Bereitstellung " +"hinzu." + #: git-submodule.sh:283 #, sh-format msgid "'$sm_path' already exists and is not a valid git repo" @@ -5385,8 +5572,14 @@ msgid "Failed to recurse into submodule path '$sm_path'" msgstr "Fehler bei Rekursion in Unterprojekt-Pfad '$sm_path'" #: git-submodule.sh:713 -msgid "--" -msgstr "--" +msgid "--cached cannot be used with --files" +msgstr "--cached kann nicht mit --files benutzt werden" + +#. unexpected type +#: git-submodule.sh:753 +#, sh-format +msgid "unexpected mode $mod_dst" +msgstr "unerwarteter Modus $mod_dst" #: git-submodule.sh:771 #, sh-format @@ -5412,11 +5605,22 @@ msgstr "Blob" msgid "submodule" msgstr "Unterprojekt" +#: git-submodule.sh:840 +msgid "# Submodules changed but not updated:" +msgstr "# Unterprojekte geändert, aber nicht aktualisiert:" + +#: git-submodule.sh:842 +msgid "# Submodule changes to be committed:" +msgstr "# Änderungen in Unterprojekt zum Eintragen:" + #: git-submodule.sh:974 #, sh-format msgid "Synchronizing submodule url for '$name'" msgstr "Synchronisiere Unterprojekt-URL für '$name'" +#~ msgid "--" +#~ msgstr "--" + #~ msgid "Could not extract email from committer identity." #~ msgstr "Konnte E-Mail-Adresse des Einreichers nicht extrahieren." diff --git a/po/git.pot b/po/git.pot index 81464cca48..b6665060de 100644 --- a/po/git.pot +++ b/po/git.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n" -"POT-Creation-Date: 2012-06-02 07:03+0800\n" +"POT-Creation-Date: 2012-06-08 10:20+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -4590,6 +4590,24 @@ msgstr "" msgid "You need to set your committer info first" msgstr "" +#: git-am.sh:95 +msgid "" +"You seem to have moved HEAD since the last 'am' failure.\n" +"Not rewinding to ORIG_HEAD" +msgstr "" + +#: git-am.sh:105 +#, sh-format +msgid "" +"When you have resolved this problem run \"$cmdline --resolved\".\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" + +#: git-am.sh:121 +msgid "Cannot fall back to three-way merge." +msgstr "" + #: git-am.sh:137 msgid "Repository lacks necessary blobs to fall back on 3-way merge." msgstr "" @@ -4639,10 +4657,26 @@ msgstr "" msgid "Dirty index: cannot apply patches (dirty: $files)" msgstr "" +#: git-am.sh:671 +#, sh-format +msgid "" +"Patch is empty. Was it split wrong?\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" + +#: git-am.sh:708 +msgid "Patch does not have a valid e-mail address." +msgstr "" + #: git-am.sh:755 msgid "cannot be interactive without stdin connected to a terminal." msgstr "" +#: git-am.sh:759 +msgid "Commit Body is:" +msgstr "" + #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a] #. in your translation. The program will only accept English #. input at this point. @@ -4655,14 +4689,36 @@ msgstr "" msgid "Applying: $FIRSTLINE" msgstr "" +#: git-am.sh:823 +msgid "" +"No changes - did you forget to use 'git add'?\n" +"If there is nothing left to stage, chances are that something else\n" +"already introduced the same changes; you might want to skip this patch." +msgstr "" + +#: git-am.sh:831 +msgid "" +"You still have unmerged paths in your index\n" +"did you forget to use 'git add'?" +msgstr "" + #: git-am.sh:847 msgid "No changes -- Patch already applied." msgstr "" +#: git-am.sh:857 +#, sh-format +msgid "Patch failed at $msgnum $FIRSTLINE" +msgstr "" + #: git-am.sh:873 msgid "applying to an empty history" msgstr "" +#: git-bisect.sh:48 +msgid "You need to start by \"git bisect start\"" +msgstr "" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -4721,6 +4777,12 @@ msgstr "" msgid "'git bisect bad' can take only one argument." msgstr "" +#. have bad but not good. we could bisect although +#. this is less optimum. +#: git-bisect.sh:273 +msgid "Warning: bisecting only with a bad commit." +msgstr "" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -4728,6 +4790,23 @@ msgstr "" msgid "Are you sure [Y/n]? " msgstr "" +#: git-bisect.sh:289 +msgid "" +"You need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" + +#: git-bisect.sh:292 +msgid "" +"You need to start by \"git bisect start\".\n" +"You then need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" + +#: git-bisect.sh:347 git-bisect.sh:474 +msgid "We are not bisecting." +msgstr "" + #: git-bisect.sh:354 #, sh-format msgid "'$invalid' is not a valid commit" @@ -4753,8 +4832,31 @@ msgstr "" msgid "?? what are you talking about?" msgstr "" -#: git-bisect.sh:474 -msgid "We are not bisecting." +#: git-bisect.sh:420 +#, sh-format +msgid "running $command" +msgstr "" + +#: git-bisect.sh:427 +#, sh-format +msgid "" +"bisect run failed:\n" +"exit code $res from '$command' is < 0 or >= 128" +msgstr "" + +#: git-bisect.sh:453 +msgid "bisect run cannot continue any more" +msgstr "" + +#: git-bisect.sh:459 +#, sh-format +msgid "" +"bisect run failed:\n" +"'bisect_state $state' exited with error code $res" +msgstr "" + +#: git-bisect.sh:466 +msgid "bisect run success" msgstr "" #: git-pull.sh:21 @@ -4772,6 +4874,18 @@ msgstr "" msgid "updating an unborn branch with changes added to the index" msgstr "" +#. The fetch involved updating the current branch. +#. The working tree and the index file is still based on the +#. $orig_head commit, but we are merging into $curr_head. +#. First update the working tree to match $curr_head. +#: git-pull.sh:228 +#, sh-format +msgid "" +"Warning: fetch updated the current branch head.\n" +"Warning: fast-forwarding your working tree from\n" +"Warning: commit $orig_head." +msgstr "" + #: git-pull.sh:253 msgid "Cannot merge multiple branches into empty head" msgstr "" @@ -4808,6 +4922,23 @@ msgstr "" msgid "Cannot record working tree state" msgstr "" +#. TRANSLATORS: $option is an invalid option, like +#. `--blah-blah'. The 7 spaces at the beginning of the +#. second line correspond to "error: ". So you should line +#. up the second line with however many characters the +#. translation of "error: " takes in your language. E.g. in +#. English this is: +#. +#. $ git stash save --blah-blah 2>&1 | head -n 2 +#. error: unknown option for 'stash save': --blah-blah +#. To provide a message, use git stash save -- '--blah-blah' +#: git-stash.sh:202 +#, sh-format +msgid "" +"error: unknown option for 'stash save': $option\n" +" To provide a message, use git stash save -- '$option'" +msgstr "" + #: git-stash.sh:223 msgid "No local changes to save" msgstr "" @@ -4868,6 +4999,10 @@ msgstr "" msgid "Cannot unstage modified files" msgstr "" +#: git-stash.sh:474 +msgid "Index was not unstashed." +msgstr "" + #: git-stash.sh:491 #, sh-format msgid "Dropped ${REV} ($s)" @@ -4916,6 +5051,19 @@ msgstr "" msgid "'$sm_path' already exists in the index" msgstr "" +#: git-submodule.sh:270 +#, sh-format +msgid "" +"The following path is ignored by one of your .gitignore files:\n" +"$sm_path\n" +"Use -f if you really want to add it." +msgstr "" + +#: git-submodule.sh:281 +#, sh-format +msgid "Adding existing repo at '$sm_path' to the index" +msgstr "" + #: git-submodule.sh:283 #, sh-format msgid "'$sm_path' already exists and is not a valid git repo" @@ -5019,7 +5167,13 @@ msgid "Failed to recurse into submodule path '$sm_path'" msgstr "" #: git-submodule.sh:713 -msgid "--" +msgid "--cached cannot be used with --files" +msgstr "" + +#. unexpected type +#: git-submodule.sh:753 +#, sh-format +msgid "unexpected mode $mod_dst" msgstr "" #: git-submodule.sh:771 @@ -5045,6 +5199,14 @@ msgstr "" msgid "submodule" msgstr "" +#: git-submodule.sh:840 +msgid "# Submodules changed but not updated:" +msgstr "" + +#: git-submodule.sh:842 +msgid "# Submodule changes to be committed:" +msgstr "" + #: git-submodule.sh:974 #, sh-format msgid "Synchronizing submodule url for '$name'" @@ -1,13 +1,12 @@ # Italian translations for Git. # Copyright (C) 2012 Marco Paolone <marcopaolone@gmail.com> # This file is distributed under the same license as the Git package. - msgid "" msgstr "" "Project-Id-Version: Git\n" "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n" -"POT-Creation-Date: 2012-05-21 08:57+0800\n" -"PO-Revision-Date: 2012-05-29 22:58+0200\n" +"POT-Creation-Date: 2012-06-08 10:20+0800\n" +"PO-Revision-Date: 2012-06-14 14:13+0200\n" "Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n" "Language-Team: Italian\n" "Language: it\n" @@ -39,11 +38,11 @@ msgid "'%s' does not look like a v2 bundle file" msgstr "" #: bundle.c:63 -#, c-format, fuzzy +#, c-format msgid "unrecognized header: %s%s (%d)" msgstr "header non riconosciuto: %s%s (%d)" -#: bundle.c:89 builtin/commit.c:697 +#: bundle.c:89 builtin/commit.c:696 #, c-format msgid "could not open '%s'" msgstr "non è stato possibile aprire '%s'" @@ -52,8 +51,8 @@ msgstr "non è stato possibile aprire '%s'" msgid "Repository lacks these prerequisite commits:" msgstr "" -#: bundle.c:164 sequencer.c:533 sequencer.c:965 builtin/log.c:289 -#: builtin/log.c:719 builtin/log.c:1335 builtin/log.c:1554 builtin/merge.c:347 +#: bundle.c:164 sequencer.c:550 sequencer.c:982 builtin/log.c:289 +#: builtin/log.c:720 builtin/log.c:1309 builtin/log.c:1528 builtin/merge.c:347 #: builtin/shortlog.c:181 msgid "revision walk setup failed" msgstr "" @@ -76,7 +75,7 @@ msgstr[1] "" msgid "rev-list died" msgstr "" -#: bundle.c:296 builtin/log.c:1231 builtin/shortlog.c:284 +#: bundle.c:296 builtin/log.c:1205 builtin/shortlog.c:284 #, c-format msgid "unrecognized argument: %s" msgstr "argomento non riconosciuto: %s" @@ -84,7 +83,7 @@ msgstr "argomento non riconosciuto: %s" #: bundle.c:331 #, c-format msgid "ref '%s' is excluded by the rev-list options" -msgstr "" +msgstr "il ref '%s' è escluso dalle opzioni di rev-list" #: bundle.c:376 msgid "Refusing to create empty bundle." @@ -110,7 +109,7 @@ msgstr "" #: commit.c:48 #, c-format msgid "could not parse %s" -msgstr "" +msgstr "non è stato possibile analizzare %s" #: commit.c:50 #, c-format @@ -119,16 +118,16 @@ msgstr "%s %s non è un commit!" #: compat/obstack.c:406 compat/obstack.c:408 msgid "memory exhausted" -msgstr "" +msgstr "memoria esaurita" #: connected.c:39 msgid "Could not run 'git rev-list'" -msgstr "Impossibile eseguire 'git-rev-list'" +msgstr "Non è stato possibile eseguire 'git-rev-list'" #: connected.c:48 -#, c-format, fuzzy +#, c-format msgid "failed write to rev-list: %s" -msgstr "impossibile salvare nella rev-list: %s" +msgstr "scrittura nella rev-list non riuscita: %s" #: connected.c:56 #, c-format @@ -218,7 +217,7 @@ msgid "" "Found errors in 'diff.dirstat' config variable:\n" "%s" msgstr "" -"Errori trovati nella variabile di configurazione 'diff.dirstat':\n" +"Trovati errori nella variabile di configurazione 'diff.dirstat':\n" "%s" #: diff.c:1400 @@ -236,28 +235,28 @@ msgstr[1] " %d file modificati" #, c-format msgid ", %d insertion(+)" msgid_plural ", %d insertions(+)" -msgstr[0] ", %d aggiunta(+)" -msgstr[1] ", %d aggiunte(+)<" +msgstr[0] ", %d inserzione(+)" +msgstr[1] ", %d inserzioni(+)" #: diff.c:1432 #, c-format msgid ", %d deletion(-)" msgid_plural ", %d deletions(-)" -msgstr[0] ". %d eliminato(-)" -msgstr[1] ", %d eliminati(-)" +msgstr[0] ". %d rimozione(-)" +msgstr[1] ", %d rimozioni(-)" #: diff.c:3478 -#, c-format, fuzzy +#, c-format msgid "" "Failed to parse --dirstat/-X option parameter:\n" "%s" msgstr "" -"Errore nel parametro dell'opzione --dirstat/-X:\n" +"Analisi del parametro dell'opzione --dirstat/-X non riuscita:\n" "%s" #: gpg-interface.c:59 msgid "could not run gpg." -msgstr "impossibile eseguire gpg." +msgstr "non è stato possibile eseguire gpg." #: gpg-interface.c:71 msgid "gpg did not accept the data" @@ -267,17 +266,17 @@ msgstr "gpg non ha accettato i dati" msgid "gpg failed to sign the data" msgstr "gpg non è riuscito a firmare i dati" -#: grep.c:1280 +#: grep.c:1320 #, c-format msgid "'%s': unable to read %s" msgstr "'%s': impossibile leggere %s" -#: grep.c:1297 +#: grep.c:1337 #, c-format msgid "'%s': %s" msgstr "'%s': %s" -#: grep.c:1308 +#: grep.c:1348 #, c-format msgid "'%s': short read %s" msgstr "" @@ -289,7 +288,7 @@ msgstr "comandi git disponibili in '%s'" #: help.c:214 msgid "git commands available from elsewhere on your $PATH" -msgstr "i comandi git sono disponibili in un altro percorso nel tuo $PATH" +msgstr "comandi git disponibili altrove nel tuo $PATH" #: help.c:270 #, c-format @@ -298,11 +297,11 @@ msgid "" "able to execute it. Maybe git-%s is broken?" msgstr "" "'%s' sembra essere un comando git, ma non è stato\n" -"possibile eseguirlo. Fore git-%s è corrotto?" +"possibile eseguirlo. Forse git-%s è corrotto?" #: help.c:327 msgid "Uh oh. Your system reports no Git commands at all." -msgstr "Oh oh. Il sistema non riporta alcun comando Git." +msgstr "Oh oh. Il tuo sistema non riporta alcun comando Git." #: help.c:349 #, c-format @@ -319,7 +318,7 @@ msgstr "automaticamente tra %0.1f secondi..." #: help.c:361 #, c-format msgid "git: '%s' is not a git command. See 'git --help'." -msgstr "git: '%s' non è un comando git. Consultare 'git --help'." +msgstr "git: '%s' non è un comando git. Vedi 'git --help'." #: help.c:365 msgid "" @@ -328,8 +327,12 @@ msgid "" msgid_plural "" "\n" "Did you mean one of these?" -msgstr[0] "\nSi intendeva questo?" -msgstr[1] "\nSi intendeva uno di questi?" +msgstr[0] "" +"\n" +"Intendevi questo?" +msgstr[1] "" +"\n" +"Intendevi uno di questi?" #: parse-options.c:493 msgid "..." @@ -352,14 +355,14 @@ msgstr "oppure: %s" msgid " %s" msgstr " %s" -#: remote.c:1607 +#: remote.c:1629 #, c-format msgid "Your branch is ahead of '%s' by %d commit.\n" msgid_plural "Your branch is ahead of '%s' by %d commits.\n" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "Il tuo branch è avanti rispetto a '%s' di %d commit.\n" +msgstr[1] "Il tuo branch è avanti rispetto a '%s' di %d commit.\n" -#: remote.c:1613 +#: remote.c:1635 #, c-format msgid "Your branch is behind '%s' by %d commit, and can be fast-forwarded.\n" msgid_plural "" @@ -367,7 +370,7 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: remote.c:1621 +#: remote.c:1643 #, c-format msgid "" "Your branch and '%s' have diverged,\n" @@ -382,7 +385,7 @@ msgstr[1] "" #: builtin/merge.c:1088 builtin/merge.c:1098 #, c-format msgid "Could not open '%s' for writing" -msgstr "Impossibile aprire '%s' per la scrittura" +msgstr "Non è stato possibile aprire '%s' per la scrittura" #: sequencer.c:123 builtin/merge.c:333 builtin/merge.c:868 #: builtin/merge.c:1090 builtin/merge.c:1103 @@ -395,8 +398,8 @@ msgid "" "after resolving the conflicts, mark the corrected paths\n" "with 'git add <paths>' or 'git rm <paths>'" msgstr "" -"dopo aver risolto i conflitti, segnare i percorsi corretti\n" -"con 'git add <percorso>' o 'git rm <percorso>'" +"dopo aver risolto i conflitti, segna i path corretti\n" +"con 'git add <path>' o 'git rm <path>'" #: sequencer.c:147 msgid "" @@ -404,11 +407,11 @@ msgid "" "with 'git add <paths>' or 'git rm <paths>'\n" "and commit the result with 'git commit'" msgstr "" -"dopo aver risolto i conflitti, segnare i percorsi corretti\n" -"con 'git add <percorso>' o 'git rm <percorso>' ed effettuare\n" +"dopo aver risolto i conflitti, segna i path corretti\n" +"con 'git add <path>' o 'git rm <path>' ed eseguire\n" "il commit del risultato con 'git commit'" -#: sequencer.c:160 sequencer.c:741 sequencer.c:824 +#: sequencer.c:160 sequencer.c:758 sequencer.c:841 #, c-format msgid "Could not write to %s" msgstr "Non è stato possibile scrivere su %s" @@ -420,21 +423,21 @@ msgstr "" #: sequencer.c:178 msgid "Your local changes would be overwritten by cherry-pick." -msgstr "Le modifiche locali verranno sovrascritte da cherry-pick" +msgstr "Le tue modifiche locali verranno sovrascritte da cherry-pick" #: sequencer.c:180 msgid "Your local changes would be overwritten by revert." -msgstr "Le modifiche locali verranno sovrascritte da revert." +msgstr "Le tue modifiche locali verranno sovrascritte da revert." #: sequencer.c:183 msgid "Commit your changes or stash them to proceed." -msgstr "Effettuare il commit delle modifiche o annullarle per procedere." +msgstr "" #. TRANSLATORS: %s will be "revert" or "cherry-pick" #: sequencer.c:233 #, c-format msgid "%s: Unable to write new index file" -msgstr "%s: non è stato possibile scrivere il nuovo file indice" +msgstr "%s: impossibile scrivere il nuovo index file" #: sequencer.c:261 msgid "Could not resolve HEAD commit\n" @@ -442,191 +445,191 @@ msgstr "Non è stato possibile risolvere il commit HEAD\n" #: sequencer.c:282 msgid "Unable to update cache tree\n" -msgstr "Impossibile aggiornare la cache dell'albero\n" +msgstr "" -#: sequencer.c:323 +#: sequencer.c:324 #, c-format msgid "Could not parse commit %s\n" -msgstr "" +msgstr "Non è stato possibile analizzare il commit %s\n" -#: sequencer.c:328 +#: sequencer.c:329 #, c-format msgid "Could not parse parent commit %s\n" msgstr "" -#: sequencer.c:358 +#: sequencer.c:395 msgid "Your index file is unmerged." msgstr "" -#: sequencer.c:361 +#: sequencer.c:398 msgid "You do not have a valid HEAD" -msgstr "" +msgstr "Non hai un HEAD valido" -#: sequencer.c:376 +#: sequencer.c:413 #, c-format msgid "Commit %s is a merge but no -m option was given." -msgstr "Il commit %s è un merge ma non è stata fornita l'opzione -m." +msgstr "Il commit %s è un merge ma non è stata specificata l'opzione -m." -#: sequencer.c:384 +#: sequencer.c:421 #, c-format msgid "Commit %s does not have parent %d" msgstr "" -#: sequencer.c:388 +#: sequencer.c:425 #, c-format msgid "Mainline was specified but commit %s is not a merge." msgstr "" #. TRANSLATORS: The first %s will be "revert" or #. "cherry-pick", the second %s a SHA1 -#: sequencer.c:399 +#: sequencer.c:436 #, c-format msgid "%s: cannot parse parent commit %s" msgstr "" -#: sequencer.c:403 -#, c-format, fuzzy +#: sequencer.c:440 +#, c-format msgid "Cannot get commit message for %s" -msgstr "Non è possibile prelevare il messaggio di commit per %s" +msgstr "Impossibile ottenere il messaggio di commit per %s" -#: sequencer.c:491 +#: sequencer.c:524 #, c-format msgid "could not revert %s... %s" msgstr "non è stato possibile eseguire il revert di %s... %s" -#: sequencer.c:492 +#: sequencer.c:525 #, c-format msgid "could not apply %s... %s" msgstr "non è stato possibile applicare %s... %s" -#: sequencer.c:536 +#: sequencer.c:553 msgid "empty commit set passed" msgstr "è stato passato un set di commit vuoto" -#: sequencer.c:544 +#: sequencer.c:561 #, c-format msgid "git %s: failed to read the index" -msgstr "git %s: lettura dell'indice non riuscita" +msgstr "git %s: lettura di index non riuscita" -#: sequencer.c:549 +#: sequencer.c:566 #, c-format msgid "git %s: failed to refresh the index" -msgstr "git %s: aggiornamento dell'indice non riuscito" +msgstr "git %s: aggiornamento di index non riuscito" -#: sequencer.c:607 +#: sequencer.c:624 #, c-format msgid "Cannot %s during a %s" msgstr "" -#: sequencer.c:629 +#: sequencer.c:646 #, c-format msgid "Could not parse line %d." -msgstr "" +msgstr "Non è stato possibile analizzare la riga %d." -#: sequencer.c:634 +#: sequencer.c:651 msgid "No commits parsed." -msgstr "" +msgstr "Nessun commit analizzato." -#: sequencer.c:647 +#: sequencer.c:664 #, c-format msgid "Could not open %s" msgstr "Non è stato possibile aprire %s" -#: sequencer.c:651 +#: sequencer.c:668 #, c-format msgid "Could not read %s." -msgstr "" +msgstr "Non è stato possibile leggere %s." -#: sequencer.c:658 +#: sequencer.c:675 #, c-format msgid "Unusable instruction sheet: %s" msgstr "" -#: sequencer.c:686 +#: sequencer.c:703 #, c-format msgid "Invalid key: %s" msgstr "Chiave non valida: %s" -#: sequencer.c:689 +#: sequencer.c:706 #, c-format msgid "Invalid value for %s: %s" msgstr "Valore non valido per %s: %s" -#: sequencer.c:701 +#: sequencer.c:718 #, c-format msgid "Malformed options sheet: %s" msgstr "" -#: sequencer.c:722 +#: sequencer.c:739 msgid "a cherry-pick or revert is already in progress" msgstr "è già in corso un'operazione di cherry-pick o di revert" -#: sequencer.c:723 +#: sequencer.c:740 msgid "try \"git cherry-pick (--continue | --quit | --abort)\"" -msgstr "provare \"git cherry-pick (--continue | --quit | -- abort)\"" +msgstr "prova \"git cherry-pick (--continue | --quit | -- abort)\"" -#: sequencer.c:727 +#: sequencer.c:744 #, c-format msgid "Could not create sequencer directory %s" msgstr "" -#: sequencer.c:743 sequencer.c:828 +#: sequencer.c:760 sequencer.c:845 #, c-format msgid "Error wrapping up %s." msgstr "" -#: sequencer.c:762 sequencer.c:896 +#: sequencer.c:779 sequencer.c:913 msgid "no cherry-pick or revert in progress" msgstr "nessuna operazione di cherry-pick o revert in corso" -#: sequencer.c:764 +#: sequencer.c:781 msgid "cannot resolve HEAD" -msgstr "non è possibile risolvere HEAD" +msgstr "impossibile risolvere HEAD" -#: sequencer.c:766 +#: sequencer.c:783 msgid "cannot abort from a branch yet to be born" msgstr "" -#: sequencer.c:788 builtin/apply.c:3689 +#: sequencer.c:805 builtin/apply.c:3697 #, c-format msgid "cannot open %s: %s" -msgstr "non è possibile aprire %s: %s" +msgstr "impossibile aprire %s: %s" -#: sequencer.c:791 +#: sequencer.c:808 #, c-format msgid "cannot read %s: %s" -msgstr "non è possibile leggere %s: %s" +msgstr "impossibile leggere %s: %s" -#: sequencer.c:792 +#: sequencer.c:809 msgid "unexpected end of file" msgstr "fine del file inattesa" -#: sequencer.c:798 +#: sequencer.c:815 #, c-format msgid "stored pre-cherry-pick HEAD file '%s' is corrupt" msgstr "" -#: sequencer.c:821 +#: sequencer.c:838 #, c-format msgid "Could not format %s." msgstr "" -#: sequencer.c:983 +#: sequencer.c:1000 msgid "Can't revert as initial commit" -msgstr "" +msgstr "Impossibile eseguire il revert come commit iniziale" -#: sequencer.c:984 +#: sequencer.c:1001 msgid "Can't cherry-pick into empty head" msgstr "" #: sha1_name.c:864 msgid "HEAD does not point to a branch" -msgstr "HEAD non punta ad un ramo" +msgstr "HEAD non punta ad un branch" #: sha1_name.c:867 #, c-format msgid "No such branch: '%s'" -msgstr "Nessun ramo esistente: '%s'" +msgstr "Nessun branch esistente: '%s'" #: sha1_name.c:869 #, c-format @@ -638,6 +641,15 @@ msgstr "Nessun upstream configurato per il branch '%s'" msgid "Upstream branch '%s' not stored as a remote-tracking branch" msgstr "" +#: wrapper.c:413 +#, c-format +msgid "unable to look up current user in the passwd file: %s" +msgstr "impossibile trovare l'utente corrente nel file passwd: %s" + +#: wrapper.c:414 +msgid "no such user" +msgstr "utente non esistente" + #: wt-status.c:135 msgid "Unmerged paths:" msgstr "" @@ -645,23 +657,23 @@ msgstr "" #: wt-status.c:141 wt-status.c:158 #, c-format msgid " (use \"git reset %s <file>...\" to unstage)" -msgstr " (usare \"git reset %s <file>...\" per rimuoverlo dallo stage)" +msgstr "" #: wt-status.c:143 wt-status.c:160 msgid " (use \"git rm --cached <file>...\" to unstage)" -msgstr " (usare \"git rm --cached <file>...\" per rimuoverlo dallo stage)" +msgstr "" #: wt-status.c:144 msgid " (use \"git add/rm <file>...\" as appropriate to mark resolution)" -msgstr "" +msgstr " (usa \"git add/rm <file>...\" come appropriato per la risoluzione)" #: wt-status.c:152 msgid "Changes to be committed:" -msgstr "Modifiche di cui effettuare il commit:" +msgstr "" #: wt-status.c:170 msgid "Changes not staged for commit:" -msgstr "Modifiche non pronte per il commit:" +msgstr "" #: wt-status.c:174 msgid " (use \"git add <file>...\" to update what will be committed)" @@ -732,7 +744,7 @@ msgstr "contenuto modificato, " #: wt-status.c:253 msgid "untracked content, " -msgstr "contenuto non tracciato, " +msgstr "" #: wt-status.c:267 #, c-format @@ -781,11 +793,11 @@ msgstr "" #: wt-status.c:737 msgid "On branch " -msgstr "Sul ramo " +msgstr "Sul branch " #: wt-status.c:744 msgid "Not currently on any branch." -msgstr "Al momento non si è su alcun ramo." +msgstr "" #: wt-status.c:755 msgid "Initial commit" @@ -793,7 +805,7 @@ msgstr "Commit iniziale" #: wt-status.c:769 msgid "Untracked" -msgstr "Non tracciato" +msgstr "" #: wt-status.c:771 msgid "Ignored" @@ -806,7 +818,7 @@ msgstr "" #: wt-status.c:775 msgid " (use -u option to show untracked files)" -msgstr " (usare l'opzione -u per visualizzare i file non tracciati)" +msgstr "" #: wt-status.c:781 msgid "No changes" @@ -819,7 +831,7 @@ msgstr "nessuna modifica aggiunta al commit%s\n" #: wt-status.c:787 msgid " (use \"git add\" and/or \"git commit -a\")" -msgstr " (usare \"git add\" e/o \"git commit -a\")" +msgstr " (usa \"git add\" e/o \"git commit -a\")" #: wt-status.c:789 #, c-format @@ -828,7 +840,7 @@ msgstr "" #: wt-status.c:791 msgid " (use \"git add\" to track)" -msgstr " (usare \"git add\" per tracciare)" +msgstr "" #: wt-status.c:793 wt-status.c:796 wt-status.c:799 #, c-format @@ -837,19 +849,19 @@ msgstr "" #: wt-status.c:794 msgid " (create/copy files and use \"git add\" to track)" -msgstr " (crea/copia file e usa \"git add\" per tracciarli)" +msgstr "" #: wt-status.c:797 msgid " (use -u to show untracked files)" -msgstr " (usare -u per mostrare i file non tracciati)" +msgstr "" #: wt-status.c:800 msgid " (working directory clean)" -msgstr " (cartella di lavoro pulita)" +msgstr "" #: wt-status.c:908 msgid "HEAD (no branch)" -msgstr "HEAD (nessun ramo)" +msgstr "HEAD (nessun branch)" #: wt-status.c:914 msgid "Initial commit on " @@ -857,18 +869,18 @@ msgstr "Commit iniziale su " #: wt-status.c:929 msgid "behind " -msgstr "" +msgstr "indietro " #: wt-status.c:932 wt-status.c:935 msgid "ahead " -msgstr "" +msgstr "avanti " #: wt-status.c:937 msgid ", behind " -msgstr "" +msgstr ", indietro " #: builtin/add.c:62 -#, c-format, fuzzy +#, c-format msgid "unexpected diff status %c" msgstr "status diff %c inatteso" @@ -884,7 +896,7 @@ msgstr "elimina '%s'\n" #: builtin/add.c:176 #, c-format msgid "Path '%s' is in submodule '%.*s'" -msgstr "" +msgstr "Il path '%s' è nel sottomodulo '%.*s'" #: builtin/add.c:192 msgid "Unstaged changes after refreshing the index:" @@ -902,12 +914,12 @@ msgstr "'%s' si trova oltre un link simbolico" #: builtin/add.c:276 msgid "Could not read the index" -msgstr "Impossibile leggere l'indice" +msgstr "Non è stato possibile leggere index" #: builtin/add.c:286 #, c-format msgid "Could not open '%s' for writing." -msgstr "Impossibile aprire '%s' per la scrittura." +msgstr "Non è stato possibile aprire '%s' per la scrittura." #: builtin/add.c:290 msgid "Could not write patch" @@ -916,25 +928,25 @@ msgstr "Non è stato possibile scrivere la patch" #: builtin/add.c:295 #, c-format msgid "Could not stat '%s'" -msgstr "" +msgstr "Non è stato possibile eseguire lo stat di '%s'" #: builtin/add.c:297 msgid "Empty patch. Aborted." -msgstr "Patch vuota. Operazione terminata." +msgstr "Patch vuota. Operazione interrotta." #: builtin/add.c:303 #, c-format msgid "Could not apply '%s'" -msgstr "Impossibile applicare '%s'" +msgstr "Non è stato possibile applicare '%s'" #: builtin/add.c:312 msgid "The following paths are ignored by one of your .gitignore files:\n" -msgstr "I seguenti percorsi sono stati ignorati da uno o più file .gitignore:\n" +msgstr "I seguenti path sono stati ignorati da uno o più dei tuoi file .gitignore:\n" #: builtin/add.c:352 #, c-format msgid "Use -f if you really want to add them.\n" -msgstr "Usare -f se si desidera davvero aggiungerli.\n" +msgstr "Usa -f se vuoi davvero aggiungerli.\n" #: builtin/add.c:353 msgid "no files added" @@ -950,26 +962,26 @@ msgstr "-A e -u sono reciprocamente incompatibili" #: builtin/add.c:393 msgid "Option --ignore-missing can only be used together with --dry-run" -msgstr "L'opzione --ignore-missing può essere usata solo in combinazione con --dry-run" +msgstr "L'opzione --ignore-missing può essere usata solo con --dry-run" #: builtin/add.c:413 #, c-format msgid "Nothing specified, nothing added.\n" -msgstr "Non è stato specificato nulla, non è stato aggiunto nulla.\n" +msgstr "" #: builtin/add.c:414 #, c-format msgid "Maybe you wanted to say 'git add .'?\n" -msgstr "Forse si intendeva dire 'git add .'?\n" +msgstr "Forse intendevi dire 'git add .'?\n" #: builtin/add.c:420 builtin/clean.c:95 builtin/commit.c:286 builtin/mv.c:82 #: builtin/rm.c:162 msgid "index file corrupt" -msgstr "indice del file corrotto" +msgstr "index file corrotto" -#: builtin/add.c:476 builtin/apply.c:4100 builtin/mv.c:229 builtin/rm.c:260 +#: builtin/add.c:476 builtin/apply.c:4108 builtin/mv.c:229 builtin/rm.c:260 msgid "Unable to write new index file" -msgstr "Impossibile scrivere il nuovo file di indice" +msgstr "Impossibile scrivere il nuovo index file" #: builtin/apply.c:53 msgid "git apply [options] [<patch>...]" @@ -993,12 +1005,12 @@ msgstr "" #: builtin/apply.c:824 #, c-format msgid "regexec returned %d for input: %s" -msgstr "" +msgstr "regexec ha restituito %d per l'input: %s" #: builtin/apply.c:905 #, c-format msgid "unable to find filename in patch at line %d" -msgstr "non è possibile trovare il nome del file nella patch alla riga %d" +msgstr "impossibile trovare il nome del file nella patch alla riga %d" #: builtin/apply.c:937 #, c-format @@ -1008,7 +1020,7 @@ msgstr "git apply: git-diff errato - atteso /dev/null, ricevuto %s alla riga %d" #: builtin/apply.c:941 #, c-format msgid "git apply: bad git-diff - inconsistent new filename on line %d" -msgstr "git apply: git-diff errato - nuovo nome del file incosistente alla riga %d" +msgstr "git apply: git-diff errato - nuovo nome del file inconsistente alla riga %d" #: builtin/apply.c:942 #, c-format @@ -1052,7 +1064,7 @@ msgstr "il file eliminato ha ancora dei contenuti" #: builtin/apply.c:1656 #, c-format msgid "corrupt patch at line %d" -msgstr "patch corrotta alla riga %d" +msgstr "" #: builtin/apply.c:1692 #, c-format @@ -1083,7 +1095,7 @@ msgstr "patch binaria non riconosciuta alla riga %d" #: builtin/apply.c:1958 #, c-format msgid "patch with only garbage at line %d" -msgstr "patch con sola spazzatura alla riga %d" +msgstr "" #: builtin/apply.c:2048 #, c-format @@ -1131,7 +1143,7 @@ msgid "missing binary patch data for '%s'" msgstr "dati della patch binaria mancanti per '%s'" #: builtin/apply.c:2903 -#, c-format, fuzzy +#, c-format msgid "binary patch does not apply to '%s'" msgstr "la patch binaria non può essere applicata a '%s'" @@ -1143,7 +1155,7 @@ msgstr "la patch binaria su '%s' crea risultati non corretti (atteso %s, ricevut #: builtin/apply.c:2930 #, c-format msgid "patch failed: %s:%ld" -msgstr "patch non riuscito: %s:%ld" +msgstr "patch non riuscita: %s:%ld" #: builtin/apply.c:3045 #, c-format @@ -1162,12 +1174,12 @@ msgstr "la rimozione della patch lascia contenuti del file" #: builtin/apply.c:3105 #, c-format msgid "%s: already exists in working directory" -msgstr "%s: esiste già nella cartella di lavoro" +msgstr "%s: esiste già nella directory di lavoro" #: builtin/apply.c:3143 #, c-format msgid "%s: has been deleted/renamed" -msgstr "%s: è stato eliminato/rinominato" +msgstr "%s: è stata eliminata/rinominata" #: builtin/apply.c:3148 builtin/apply.c:3179 #, c-format @@ -1177,12 +1189,12 @@ msgstr "%s: %s" #: builtin/apply.c:3159 #, c-format msgid "%s: does not exist in index" -msgstr "%s: non esiste nell'indice" +msgstr "%s: non esiste in index" #: builtin/apply.c:3173 #, c-format msgid "%s: does not match index" -msgstr "%s: non corrisponde all'indice" +msgstr "%s: non corrisponde a index" #: builtin/apply.c:3190 #, c-format @@ -1197,254 +1209,259 @@ msgstr "%s ha il tipo %o, atteso %o" #: builtin/apply.c:3247 #, c-format msgid "%s: already exists in index" -msgstr "%s: esiste già nell'indice" +msgstr "%s: esiste già in index" -#: builtin/apply.c:3266 +#: builtin/apply.c:3267 #, c-format -msgid "new mode (%o) of %s does not match old mode (%o)%s%s" -msgstr "la nuova modalità (%o) di %s non corrisponde alla modalità precedente (%o)%s%s" +msgid "new mode (%o) of %s does not match old mode (%o)" +msgstr "" #: builtin/apply.c:3272 #, c-format +msgid "new mode (%o) of %s does not match old mode (%o) of %s" +msgstr "" + +#: builtin/apply.c:3280 +#, c-format msgid "%s: patch does not apply" msgstr "%s: la patch non può essere applicata" -#: builtin/apply.c:3285 +#: builtin/apply.c:3293 #, c-format msgid "Checking patch %s..." -msgstr "Verifica della patch %s..." +msgstr "Controllo della patch %s..." -#: builtin/apply.c:3340 builtin/checkout.c:212 builtin/reset.c:158 +#: builtin/apply.c:3348 builtin/checkout.c:212 builtin/reset.c:158 #, c-format msgid "make_cache_entry failed for path '%s'" -msgstr "make_cache_entry non riuscito per il percorso '%s'" +msgstr "make_cache_entry non riuscito per il path '%s'" -#: builtin/apply.c:3483 +#: builtin/apply.c:3491 #, c-format msgid "unable to remove %s from index" -msgstr "impossibile rimuovere %s dall'indice" +msgstr "impossibile rimuovere %s da index" -#: builtin/apply.c:3510 +#: builtin/apply.c:3518 #, c-format msgid "corrupt patch for subproject %s" -msgstr "" +msgstr "patch corrotta per il sottoprogetto %s" -#: builtin/apply.c:3514 +#: builtin/apply.c:3522 #, c-format msgid "unable to stat newly created file '%s'" msgstr "impossibile eseguire lo stat del file appena creato '%s'" -#: builtin/apply.c:3519 +#: builtin/apply.c:3527 #, c-format msgid "unable to create backing store for newly created file %s" msgstr "" -#: builtin/apply.c:3522 +#: builtin/apply.c:3530 #, c-format msgid "unable to add cache entry for %s" msgstr "impossibile aggiungere la voce della cache per %s" -#: builtin/apply.c:3555 +#: builtin/apply.c:3563 #, c-format msgid "closing file '%s'" msgstr "chiusura del file '%s'" -#: builtin/apply.c:3604 +#: builtin/apply.c:3612 #, c-format msgid "unable to write file '%s' mode %o" -msgstr "non è possibile scrivere il file '%s' in modalità %o" +msgstr "impossibile scrivere il file '%s' in modalità %o" -#: builtin/apply.c:3660 +#: builtin/apply.c:3668 #, c-format msgid "Applied patch %s cleanly." -msgstr "" +msgstr "Patch %s applicata correttamente." -#: builtin/apply.c:3668 +#: builtin/apply.c:3676 msgid "internal error" msgstr "errore interno" #. Say this even without --verbose -#: builtin/apply.c:3671 +#: builtin/apply.c:3679 #, c-format msgid "Applying patch %%s with %d reject..." msgid_plural "Applying patch %%s with %d rejects..." msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:3681 +#: builtin/apply.c:3689 #, c-format msgid "truncating .rej filename to %.*s.rej" msgstr "" -#: builtin/apply.c:3702 +#: builtin/apply.c:3710 #, c-format msgid "Hunk #%d applied cleanly." -msgstr "" +msgstr "Frammento #%d applicato correttamente." -#: builtin/apply.c:3705 +#: builtin/apply.c:3713 #, c-format msgid "Rejected hunk #%d." -msgstr "" +msgstr "Frammento #%d respinto." -#: builtin/apply.c:3836 +#: builtin/apply.c:3844 msgid "unrecognized input" msgstr "input non riconosciuto" -#: builtin/apply.c:3847 +#: builtin/apply.c:3855 msgid "unable to read index file" -msgstr "impossibile leggere il file dell'indice" +msgstr "impossibile leggere index file" -#: builtin/apply.c:3962 builtin/apply.c:3965 +#: builtin/apply.c:3970 builtin/apply.c:3973 msgid "path" -msgstr "percorso" +msgstr "path" -#: builtin/apply.c:3963 +#: builtin/apply.c:3971 msgid "don't apply changes matching the given path" -msgstr "" +msgstr "non applica le modifiche corrispondenti al path specificato" -#: builtin/apply.c:3966 +#: builtin/apply.c:3974 msgid "apply changes matching the given path" -msgstr "" +msgstr "applica le modifiche corrispondenti al path specificato" -#: builtin/apply.c:3968 +#: builtin/apply.c:3976 msgid "num" msgstr "num" -#: builtin/apply.c:3969 +#: builtin/apply.c:3977 msgid "remove <num> leading slashes from traditional diff paths" msgstr "" -#: builtin/apply.c:3972 +#: builtin/apply.c:3980 msgid "ignore additions made by the patch" -msgstr "" +msgstr "ignora le aggiunte create dalla patch" -#: builtin/apply.c:3974 +#: builtin/apply.c:3982 msgid "instead of applying the patch, output diffstat for the input" msgstr "invece di applicare la patch, mostra l'output di diffstat per l'input" -#: builtin/apply.c:3978 +#: builtin/apply.c:3986 msgid "shows number of added and deleted lines in decimal notation" msgstr "mostra il numero di righe aggiunte e eliminate in notazione decimale" -#: builtin/apply.c:3980 +#: builtin/apply.c:3988 msgid "instead of applying the patch, output a summary for the input" msgstr "invece di applicare la patch, mostra un riassunto per l'input" -#: builtin/apply.c:3982 +#: builtin/apply.c:3990 msgid "instead of applying the patch, see if the patch is applicable" msgstr "invece di applicare la patch, verifica se può essere applicata" -#: builtin/apply.c:3984 +#: builtin/apply.c:3992 msgid "make sure the patch is applicable to the current index" -msgstr "assicura che la patch sia applicabile all'indice corrente" +msgstr "assicura che la patch sia applicabile all'attuale index" -#: builtin/apply.c:3986 +#: builtin/apply.c:3994 msgid "apply a patch without touching the working tree" -msgstr "applica una patch senza modificare l'albero di lavoro" +msgstr "" -#: builtin/apply.c:3988 +#: builtin/apply.c:3996 msgid "also apply the patch (use with --stat/--summary/--check)" -msgstr "applica anche la patch (usare con --stat/--summary/--check)" +msgstr "applica anche la patch (da usare con --stat/--summary/--check)" -#: builtin/apply.c:3990 +#: builtin/apply.c:3998 msgid "build a temporary index based on embedded index information" -msgstr "crea un indice temporaneo basato sulle informazioni incorporate dell'indice" +msgstr "" -#: builtin/apply.c:3992 +#: builtin/apply.c:4000 msgid "paths are separated with NUL character" -msgstr "i percorsi sono separati con un carattere NUL" +msgstr "i path sono separati con un carattere NUL" -#: builtin/apply.c:3995 +#: builtin/apply.c:4003 msgid "ensure at least <n> lines of context match" msgstr "assicura almeno <n> righe di contesto corrispondente" -#: builtin/apply.c:3996 +#: builtin/apply.c:4004 msgid "action" msgstr "azione" -#: builtin/apply.c:3997 +#: builtin/apply.c:4005 msgid "detect new or modified lines that have whitespace errors" msgstr "rileva righe nuove o modificate che hanno errori di spazi bianchi" -#: builtin/apply.c:4000 builtin/apply.c:4003 +#: builtin/apply.c:4008 builtin/apply.c:4011 msgid "ignore changes in whitespace when finding context" msgstr "" -#: builtin/apply.c:4006 +#: builtin/apply.c:4014 msgid "apply the patch in reverse" msgstr "applica la patch in maniera inversa" -#: builtin/apply.c:4008 +#: builtin/apply.c:4016 msgid "don't expect at least one line of context" msgstr "" -#: builtin/apply.c:4010 +#: builtin/apply.c:4018 msgid "leave the rejected hunks in corresponding *.rej files" -msgstr "" +msgstr "lascia i frammenti respinti nei file .rej corrispondenti" -#: builtin/apply.c:4012 +#: builtin/apply.c:4020 msgid "allow overlapping hunks" -msgstr "" +msgstr "consente la sovrapposizione dei frammenti" -#: builtin/apply.c:4013 +#: builtin/apply.c:4021 msgid "be verbose" msgstr "dettagliato" -#: builtin/apply.c:4015 +#: builtin/apply.c:4023 msgid "tolerate incorrectly detected missing new-line at the end of file" msgstr "" -#: builtin/apply.c:4018 +#: builtin/apply.c:4026 msgid "do not trust the line counts in the hunk headers" msgstr "" -#: builtin/apply.c:4020 +#: builtin/apply.c:4028 msgid "root" msgstr "radice" -#: builtin/apply.c:4021 +#: builtin/apply.c:4029 msgid "prepend <root> to all filenames" msgstr "antepone <root> a tutti i nomi file" -#: builtin/apply.c:4042 +#: builtin/apply.c:4050 msgid "--index outside a repository" -msgstr "--index al di fuori di un deposito" +msgstr "--index al di fuori di un repository" -#: builtin/apply.c:4045 +#: builtin/apply.c:4053 msgid "--cached outside a repository" -msgstr "--cached al di fuori di un deposito" +msgstr "--cached al di fuori di un repository" -#: builtin/apply.c:4061 +#: builtin/apply.c:4069 #, c-format msgid "can't open patch '%s'" msgstr "impossibile aprire la patch '%s'" -#: builtin/apply.c:4075 +#: builtin/apply.c:4083 #, c-format msgid "squelched %d whitespace error" msgid_plural "squelched %d whitespace errors" msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:4081 builtin/apply.c:4091 +#: builtin/apply.c:4089 builtin/apply.c:4099 #, c-format msgid "%d line adds whitespace errors." msgid_plural "%d lines add whitespace errors." -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%d riga aggiunge errori di spazi bianchi." +msgstr[1] "%d righe aggiungono errori di spazi bianchi." #: builtin/archive.c:17 #, c-format msgid "could not create archive file '%s'" -msgstr "impossibile creare il file dell'archivio '%s'" +msgstr "non è stato possibile creare il file del repository '%s'" #: builtin/archive.c:20 msgid "could not redirect output" -msgstr "impossibile redirigere l'output" +msgstr "non è stato possibile redirigere l'output" #: builtin/archive.c:37 msgid "git archive: Remote with no URL" -msgstr "git archive: Remote non ha una URL" +msgstr "git archive: Remote non ha un URL" #: builtin/archive.c:58 msgid "git archive: expected ACK/NAK, got EOF" @@ -1466,7 +1483,7 @@ msgstr "git archive: errore del protocollo" #: builtin/archive.c:71 msgid "git archive: expected a flush" -msgstr "" +msgstr "git archive: atteso un flush" #: builtin/branch.c:144 #, c-format @@ -1498,12 +1515,12 @@ msgstr "" #: builtin/branch.c:202 #, c-format msgid "remote branch '%s' not found." -msgstr "il ramo remoto '%s' non è stato trovato." +msgstr "il branch remoto '%s' non è stato trovato." #: builtin/branch.c:203 #, c-format msgid "branch '%s' not found." -msgstr "ramo '%s' non trovato." +msgstr "branch '%s' non trovato." #: builtin/branch.c:210 #, c-format @@ -1520,12 +1537,12 @@ msgstr "" #: builtin/branch.c:225 #, c-format msgid "Error deleting remote branch '%s'" -msgstr "Errore nella rimozione del ramo remoto '%s'" +msgstr "Errore nella rimozione del branch remoto '%s'" #: builtin/branch.c:226 #, c-format msgid "Error deleting branch '%s'" -msgstr "Errore nella rimozione del ramo '%s'" +msgstr "Errore nella rimozione del branch '%s'" #: builtin/branch.c:233 #, c-format @@ -1544,7 +1561,7 @@ msgstr "Aggiornamento del file di configurazione fallito" #: builtin/branch.c:337 #, c-format msgid "branch '%s' does not point at a commit" -msgstr "il ramo '%s' non punta ad un commit" +msgstr "il branch '%s' non punta ad un commit" #: builtin/branch.c:409 #, c-format @@ -1578,7 +1595,7 @@ msgstr "" #: builtin/branch.c:535 msgid "(no branch)" -msgstr "(nessun ramo)" +msgstr "(nessun branch)" #: builtin/branch.c:600 msgid "some refs could not be read" @@ -1591,7 +1608,7 @@ msgstr "" #: builtin/branch.c:623 #, c-format msgid "Invalid branch name: '%s'" -msgstr "Nome del ramo non valido: '%s'" +msgstr "Nome del branch non valido: '%s'" #: builtin/branch.c:638 msgid "Branch rename failed" @@ -1609,12 +1626,14 @@ msgstr "Ramo rinominato in %s, ma HEAD non è aggiornato!" #: builtin/branch.c:653 msgid "Branch is renamed, but update of config-file failed" -msgstr "Il ramo è stato rinominato, ma l'aggiornamento del file di configurazione è fallito" +msgstr "" +"Il branch è stato rinominato, ma l'aggiornamento del file di configurazione " +"è fallito" #: builtin/branch.c:668 #, c-format msgid "malformed object name %s" -msgstr "nome dell'oggetto %s non corretto" +msgstr "nome dell'oggetto %s errato" #: builtin/branch.c:692 #, c-format @@ -1635,7 +1654,8 @@ msgstr "--column e --verbose non sono compatibili" #: builtin/branch.c:857 msgid "-a and -r options to 'git branch' do not make sense with a branch name" -msgstr "le opzioni -a e -r per 'git branch' non hanno senso con il nome di un ramo" +msgstr "" +"le opzioni -a e -r per 'git branch' non hanno senso con il nome di un branch" #: builtin/bundle.c:47 #, c-format @@ -1653,12 +1673,12 @@ msgstr "" #: builtin/checkout.c:113 builtin/checkout.c:146 #, c-format msgid "path '%s' does not have our version" -msgstr "il percorso '%s' non ha la nostra versione" +msgstr "il path '%s' non ha la nostra versione" #: builtin/checkout.c:115 builtin/checkout.c:148 #, c-format msgid "path '%s' does not have their version" -msgstr "il percorso '%s' non ha la loro versione" +msgstr "il path '%s' non ha la loro versione" #: builtin/checkout.c:131 #, c-format @@ -1668,7 +1688,7 @@ msgstr "" #: builtin/checkout.c:175 #, c-format msgid "path '%s' does not have necessary versions" -msgstr "il percorso '%s' non ha le versioni necessarie" +msgstr "il path '%s' non ha le versioni necessarie" #: builtin/checkout.c:192 #, c-format @@ -1682,7 +1702,7 @@ msgstr "" #: builtin/checkout.c:234 builtin/checkout.c:392 msgid "corrupt index file" -msgstr "file indice corrotto" +msgstr "file index corrotto" #: builtin/checkout.c:264 builtin/checkout.c:271 #, c-format @@ -1692,7 +1712,7 @@ msgstr "" #: builtin/checkout.c:302 builtin/checkout.c:498 builtin/clone.c:583 #: builtin/merge.c:812 msgid "unable to write new index file" -msgstr "impossibile scrivere il nuovo file di indice" +msgstr "impossibile scrivere il nuovo file index" #: builtin/checkout.c:319 builtin/diff.c:302 builtin/merge.c:408 msgid "diff_setup_done failed" @@ -1700,7 +1720,7 @@ msgstr "diff_setup_done non riuscito" #: builtin/checkout.c:414 msgid "you need to resolve your current index first" -msgstr "è necessario risolvere prima l'indice corrente" +msgstr "è necessario risolvere prima l'attuale index" #: builtin/checkout.c:533 #, c-format @@ -1714,7 +1734,7 @@ msgstr "HEAD si trova ora a" #: builtin/checkout.c:573 #, c-format msgid "Reset branch '%s'\n" -msgstr "Ripristina il ramo '%s'\n" +msgstr "Ripristina il branch '%s'\n" #: builtin/checkout.c:576 #, c-format @@ -1734,7 +1754,7 @@ msgstr "" #: builtin/checkout.c:584 #, c-format msgid "Switched to branch '%s'\n" -msgstr "Si è passati al ramo '%s'\n" +msgstr "Si è passati al branch '%s'\n" #: builtin/checkout.c:640 #, c-format @@ -1766,10 +1786,10 @@ msgid "" " git branch new_branch_name %s\n" "\n" msgstr "" -"Se si desidera mantenerle creando un nuovo ramo, questo potrebbe essere\n" +"Se si vuole mantenerle creando un nuovo branch, questo potrebbe essere\n" "un buon momento per farlo con:\n" "\n" -" git branch nuovo_nome_ramo %s\n" +" git branch nuovo_nome_branch %s\n" "\n" #: builtin/checkout.c:694 @@ -1794,7 +1814,7 @@ msgstr "riferimento non valido: %s" #: builtin/checkout.c:894 #, c-format msgid "reference is not a tree: %s" -msgstr "il riferimento non è un albero: %s" +msgstr "" #: builtin/checkout.c:974 msgid "-B cannot be used with -b" @@ -1802,23 +1822,23 @@ msgstr "-B non può essere usata con -b" #: builtin/checkout.c:983 msgid "--patch is incompatible with all other options" -msgstr "--patch è incompatibile con tutte le altre opzioni" +msgstr "--patch non è compatibile con tutte le altre opzioni" #: builtin/checkout.c:986 msgid "--detach cannot be used with -b/-B/--orphan" -msgstr "--detach non può essere usato con -b/-B/--orphan" +msgstr "--detach non può essere usata con -b/-B/--orphan" #: builtin/checkout.c:988 msgid "--detach cannot be used with -t" -msgstr "--detach non può essere usato con -t" +msgstr "--detach non può essere usata con -t" #: builtin/checkout.c:994 msgid "--track needs a branch name" -msgstr "--track necessita del nome di un ramo" +msgstr "--track necessita del nome di un branch" #: builtin/checkout.c:1001 msgid "Missing branch name; try -b" -msgstr "Nome del ramo mancante; provare con -b" +msgstr "Nome del branch mancante; prova con -b" #: builtin/checkout.c:1007 msgid "--orphan and -b|-B are mutually exclusive" @@ -1826,7 +1846,7 @@ msgstr "" #: builtin/checkout.c:1009 msgid "--orphan cannot be used with -t" -msgstr "--orphan non può essere usato con -t" +msgstr "--orphan non può essere usata con -t" #: builtin/checkout.c:1019 msgid "git checkout: -f and -m are incompatible" @@ -1849,7 +1869,7 @@ msgstr "" #: builtin/checkout.c:1068 msgid "git checkout: --detach does not take a path argument" -msgstr "" +msgstr "git checkout: --detach non prende un path come argomento" #: builtin/checkout.c:1071 msgid "" @@ -1863,7 +1883,7 @@ msgstr "" #: builtin/checkout.c:1093 msgid "--ours/--theirs is incompatible with switching branches." -msgstr "" +msgstr "--ours/--theirs non sono compatibili con il passaggio ai branch." #: builtin/clean.c:78 msgid "-x and -X cannot be used together" @@ -1873,12 +1893,16 @@ msgstr "-x e -X non possono essere usati insieme" msgid "" "clean.requireForce set to true and neither -n nor -f given; refusing to clean" msgstr "" +"clean.requireForce è impostato a vero, ma né -n né -f sono state specificate; " +"clean interrotto" #: builtin/clean.c:85 msgid "" "clean.requireForce defaults to true and neither -n nor -f given; refusing to " "clean" msgstr "" +"clean.requireForce è vero per default, ma né -n né -f sono state specificate; " +"clean interrotto" #: builtin/clean.c:155 builtin/clean.c:176 #, c-format @@ -1908,7 +1932,7 @@ msgstr "" #: builtin/clone.c:243 #, c-format msgid "reference repository '%s' is not a local directory." -msgstr "l'archivio di riferimento '%s' non è una cartella locale." +msgstr "il repository di riferimento '%s' non è una directory locale." #: builtin/clone.c:302 #, c-format @@ -1918,7 +1942,7 @@ msgstr "apertura di '%s' non riuscita" #: builtin/clone.c:306 #, c-format msgid "failed to create directory '%s'" -msgstr "creazione della cartella '%s' non riuscita" +msgstr "creazione della directory '%s' non riuscita" #: builtin/clone.c:308 builtin/diff.c:75 #, c-format @@ -1928,7 +1952,7 @@ msgstr "stat di '%s' non riuscito" #: builtin/clone.c:310 #, c-format msgid "%s exists and is not a directory" -msgstr "%s esiste e non è una cartella" +msgstr "%s esiste e non è una directory" #: builtin/clone.c:324 #, c-format @@ -1936,7 +1960,7 @@ msgid "failed to stat %s\n" msgstr "stat di %s non riuscito\n" #: builtin/clone.c:341 -#, c-format, fuzzy +#, c-format msgid "failed to unlink '%s'" msgstr "rimozione del link '%s' non riuscita" @@ -1958,13 +1982,12 @@ msgstr "fatto.\n" #: builtin/clone.c:440 #, c-format msgid "Could not find remote branch %s to clone." -msgstr "Impossibile trovare il ramo remoto %s da clonare." +msgstr "Non è stato possibile trovare il branch remoto %s da clonare." #: builtin/clone.c:549 -#, fuzzy msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n" msgstr "" -"l'HEAD remoto si riferisce ad un ref inesistente, impossibile eseguire il\n" +"l'HEAD remoto si riferisce ad un ref inesistente, impossibile eseguire il " "checkout.\n" #: builtin/clone.c:639 @@ -1973,7 +1996,7 @@ msgstr "Troppi argomenti." #: builtin/clone.c:643 msgid "You must specify a repository to clone." -msgstr "È necessario specificare un archivio da clonare." +msgstr "Devi specificare un repository da clonare." #: builtin/clone.c:654 #, c-format @@ -1983,21 +2006,22 @@ msgstr "le opzioni --bare e --origin %s non sono compatibili." #: builtin/clone.c:668 #, c-format msgid "repository '%s' does not exist" -msgstr "l'archivio '%s' non esiste" +msgstr "il repository '%s' non esiste" #: builtin/clone.c:673 msgid "--depth is ignored in local clones; use file:// instead." -msgstr "--depth è ingnorato nei cloni locali; usare file:// invece." +msgstr "" #: builtin/clone.c:683 #, c-format msgid "destination path '%s' already exists and is not an empty directory." -msgstr "il percorso di destinazione '%s' esiste già e non è una cartella vuota." +msgstr "" +"il path di destinazione '%s' esiste già e non è una directory vuota." #: builtin/clone.c:693 #, c-format msgid "working tree '%s' already exists." -msgstr "l'albero di lavoro '%s' esiste già." +msgstr "" #: builtin/clone.c:706 builtin/clone.c:720 #, c-format @@ -2012,7 +2036,7 @@ msgstr "" #: builtin/clone.c:728 #, c-format msgid "Cloning into bare repository '%s'...\n" -msgstr "" +msgstr "Clone nel repository spoglio '%s'...\n" #: builtin/clone.c:730 #, c-format @@ -2027,11 +2051,11 @@ msgstr "Non so come clonare %s" #: builtin/clone.c:835 #, c-format msgid "Remote branch %s not found in upstream %s" -msgstr "Il ramo remoto %s non è stato trovato in upstream %s" +msgstr "Il branch remoto %s non è stato trovato in upstream %s" #: builtin/clone.c:842 msgid "You appear to have cloned an empty repository." -msgstr "Sembra che sia stato clonato un archivio vuoto." +msgstr "Sembra che tu abbia clonato un repository vuoto." #: builtin/column.c:51 msgid "--command must be the first argument" @@ -2050,14 +2074,14 @@ msgid "" "\n" " git commit --amend --reset-author\n" msgstr "" -"Il nome e l'indirizzo email sono stati configurati automaticamente usando\n" -"il nome utente ed il nome host. Per favore, verificare che siano esatti.\n" +"Il tuo nome e l'indirizzo email sono stati configurati automaticamente usando\n" +"il tuo nome utente ed il nome host. Per favore, verifica che siano esatti.\n" "È possibile eliminare questo messaggio impostandoli esplicitamente:\n" "\n" " git config --global user.name \"Tuo Nome\"\n" " git config --global user.email tu@esempio.com\n" "\n" -"Dopo questa operazione, per ripristinare l'identità usata in questo commit:\n" +"Dopo questa operazione, puoi ripristinare l'identità usata in questo commit con:\n" "\n" " git commit --amend --reset-author\n" @@ -2088,27 +2112,27 @@ msgstr "" #: builtin/commit.c:301 msgid "interactive add failed" -msgstr "" +msgstr "add interattivo non riuscito" #: builtin/commit.c:334 builtin/commit.c:355 builtin/commit.c:405 msgid "unable to write new_index file" -msgstr "non è possibile scrivere il file new_index" +msgstr "impossibile scrivere il file new_index" #: builtin/commit.c:386 msgid "cannot do a partial commit during a merge." -msgstr "non è possibile eseguire un commit parziale durante un merge." +msgstr "impossibile eseguire un commit parziale durante un merge." #: builtin/commit.c:388 msgid "cannot do a partial commit during a cherry-pick." -msgstr "non è possibile eseguire un commit parziale durante un cherry-pick." +msgstr "impossibile eseguire un commit parziale durante un cherry-pick." #: builtin/commit.c:398 msgid "cannot read the index" -msgstr "non è possibile leggere l'indice" +msgstr "impossibile leggere index" #: builtin/commit.c:418 msgid "unable to write temporary index file" -msgstr "scrittura del file di indice temporaneo non riuscita" +msgstr "" #: builtin/commit.c:493 builtin/commit.c:499 #, c-format @@ -2117,54 +2141,54 @@ msgstr "commit non valido: %s" #: builtin/commit.c:522 msgid "malformed --author parameter" -msgstr "parametro --author non corretto" +msgstr "parametro --author malformato" -#: builtin/commit.c:583 +#: builtin/commit.c:582 #, c-format msgid "Malformed ident string: '%s'" msgstr "" -#: builtin/commit.c:621 builtin/commit.c:654 builtin/commit.c:968 +#: builtin/commit.c:620 builtin/commit.c:653 builtin/commit.c:967 #, c-format msgid "could not lookup commit %s" -msgstr "" +msgstr "non è stato possibile trovare il commit %s" -#: builtin/commit.c:633 builtin/shortlog.c:296 +#: builtin/commit.c:632 builtin/shortlog.c:296 #, c-format msgid "(reading log message from standard input)\n" msgstr "(lettura del messaggio di log dallo standard input)\n" -#: builtin/commit.c:635 +#: builtin/commit.c:634 msgid "could not read log from standard input" -msgstr "impossibile leggere il log dallo standard input" +msgstr "non è stato possibile leggere il log dallo standard input" -#: builtin/commit.c:639 +#: builtin/commit.c:638 #, c-format msgid "could not read log file '%s'" -msgstr "impossibile leggere il file di log '%s'" +msgstr "non è stato possibile leggere il file di log '%s'" -#: builtin/commit.c:645 +#: builtin/commit.c:644 msgid "commit has empty message" msgstr "il commit ha un messaggio vuoto" -#: builtin/commit.c:661 +#: builtin/commit.c:660 msgid "could not read MERGE_MSG" -msgstr "impossibile leggere MERGE_MSG" +msgstr "non è stato possibile leggere MERGE_MSG" -#: builtin/commit.c:665 +#: builtin/commit.c:664 msgid "could not read SQUASH_MSG" -msgstr "impossibile leggere SQUASH_MSG" +msgstr "non è stato possibile leggere SQUASH_MSG" -#: builtin/commit.c:669 +#: builtin/commit.c:668 #, c-format msgid "could not read '%s'" -msgstr "impossibile leggere '%s'" +msgstr "non è stato possibile leggere '%s'" -#: builtin/commit.c:721 +#: builtin/commit.c:720 msgid "could not write commit template" msgstr "non è stato possibile scrivere il modello di commit" -#: builtin/commit.c:732 +#: builtin/commit.c:731 #, c-format msgid "" "\n" @@ -2175,11 +2199,11 @@ msgid "" msgstr "" "\n" "Sembra che si stia eseguendo il commit di un merge.\n" -"Se l'operazione non è corretta, per favore eliminare il file\n" +"Se l'operazione non è corretta, per favore elimina il file\n" "\t%s\n" -"e riprovare.\n" +"e riprova.\n" -#: builtin/commit.c:737 +#: builtin/commit.c:736 #, c-format msgid "" "\n" @@ -2188,189 +2212,192 @@ msgid "" "\t%s\n" "and try again.\n" msgstr "" +"\n" +"Sembra che si stia eseguendo il commit di un cherry-pick.\n" +"Se l'operazione non è corretta, per favore rimuovi il file\n" +"\t%s\n" +"e riprova.\n" -#: builtin/commit.c:749 -#, fuzzy +#: builtin/commit.c:748 msgid "" "Please enter the commit message for your changes. Lines starting\n" "with '#' will be ignored, and an empty message aborts the commit.\n" msgstr "" -"Per favore, inserire il messaggio di commit per le modifiche effettuate.\n" -"Le righe che iniziano con '#' verranno ignorate, ed un messaggio vuoto\n" -"annulla il commit.\n" +"Per favore inserisci il messaggio di commit per le modifiche. Le righe\n" +"che iniziano con '#' verranno ignorate, e un messaggio vuoto annulla il commit.\n" -#: builtin/commit.c:754 -#, fuzzy +#: builtin/commit.c:753 msgid "" "Please enter the commit message for your changes. Lines starting\n" "with '#' will be kept; you may remove them yourself if you want to.\n" "An empty message aborts the commit.\n" msgstr "" -"Per favore, inserire il messaggio di commit per le modifiche effettuate.\n" -"Le righe che iniziano con '#' verranno mantenute; possono essere rimosse\n" -"manualmente se si vuole. Un messaggio vuoto annulla il commit.\n" +"Per favore inserisci il messaggio di commit per le modifiche. Le\n" +"righe che iniziano con '#' verranno mantenute; possono comunque essere\n" +"rimosse manualmente. Un messaggio vuoto annulla il commit.\n" -#: builtin/commit.c:767 +#: builtin/commit.c:766 #, c-format msgid "%sAuthor: %s" msgstr "%sAutore: %s" -#: builtin/commit.c:774 +#: builtin/commit.c:773 #, c-format msgid "%sCommitter: %s" msgstr "%sCommitter: %s" -#: builtin/commit.c:794 +#: builtin/commit.c:793 msgid "Cannot read index" -msgstr "Impossibile leggere l'indice" +msgstr "Impossibile leggere index" -#: builtin/commit.c:831 +#: builtin/commit.c:830 msgid "Error building trees" -msgstr "Errore nella creazione degli alberi" +msgstr "" -#: builtin/commit.c:846 builtin/tag.c:361 +#: builtin/commit.c:845 builtin/tag.c:361 #, c-format msgid "Please supply the message using either -m or -F option.\n" -msgstr "Per favore, fornire il messaggio usando l'opzione -m o -F.\n" +msgstr "Per favore, specifica il messaggio usando l'opzione -m o -F.\n" -#: builtin/commit.c:943 +#: builtin/commit.c:942 #, c-format msgid "No existing author found with '%s'" msgstr "Nessun autore esistente trovato con '%s'" -#: builtin/commit.c:958 builtin/commit.c:1158 +#: builtin/commit.c:957 builtin/commit.c:1157 #, c-format msgid "Invalid untracked files mode '%s'" msgstr "" -#: builtin/commit.c:998 +#: builtin/commit.c:997 msgid "Using both --reset-author and --author does not make sense" msgstr "L'uso di entrambe le opzioni --reset-author e --author non ha senso" -#: builtin/commit.c:1009 +#: builtin/commit.c:1008 msgid "You have nothing to amend." -msgstr "Non c'è nulla da riparare." +msgstr "" -#: builtin/commit.c:1012 +#: builtin/commit.c:1011 msgid "You are in the middle of a merge -- cannot amend." -msgstr "Si è nel mezzo di un merge -- non è possibile riparare." +msgstr "" -#: builtin/commit.c:1014 +#: builtin/commit.c:1013 msgid "You are in the middle of a cherry-pick -- cannot amend." msgstr "" -#: builtin/commit.c:1017 +#: builtin/commit.c:1016 msgid "Options --squash and --fixup cannot be used together" msgstr "Le opzioni --squash e --fixup non possono essere usate insieme" -#: builtin/commit.c:1027 +#: builtin/commit.c:1026 msgid "Only one of -c/-C/-F/--fixup can be used." msgstr "Solo una delle opzioni -c/-C/-F/--fixup può essere usata." -#: builtin/commit.c:1029 +#: builtin/commit.c:1028 msgid "Option -m cannot be combined with -c/-C/-F/--fixup." msgstr "L'opzione -m non può essere combinata con -c/-C/-F/--fixup." -#: builtin/commit.c:1037 +#: builtin/commit.c:1036 msgid "--reset-author can be used only with -C, -c or --amend." msgstr "L'opzione --reset-author può essere usata solo con -C, -c o --amend." -#: builtin/commit.c:1054 +#: builtin/commit.c:1053 msgid "Only one of --include/--only/--all/--interactive/--patch can be used." -msgstr "Può essere usata solo una delle opzioni --include/--only/--all/--interactive/--patch ." +msgstr "" +"Può essere usata solo una delle opzioni --include/--only/--all/--" +"interactive/--patch ." -#: builtin/commit.c:1056 +#: builtin/commit.c:1055 msgid "No paths with --include/--only does not make sense." -msgstr "" +msgstr "Devi specificare un path se usi --include/--only." -#: builtin/commit.c:1058 -#, fuzzy +#: builtin/commit.c:1057 msgid "Clever... amending the last one with dirty index." -msgstr "Furbo... riparare l'ultimo con un indice errato." +msgstr "" -#: builtin/commit.c:1060 +#: builtin/commit.c:1059 msgid "Explicit paths specified without -i nor -o; assuming --only paths..." msgstr "" -#: builtin/commit.c:1070 builtin/tag.c:577 +#: builtin/commit.c:1069 builtin/tag.c:577 #, c-format msgid "Invalid cleanup mode %s" msgstr "" -#: builtin/commit.c:1075 +#: builtin/commit.c:1074 msgid "Paths with -a does not make sense." -msgstr "" +msgstr "I path con -a non hanno senso." -#: builtin/commit.c:1258 +#: builtin/commit.c:1257 msgid "couldn't look up newly created commit" -msgstr "" +msgstr "non è stato possibile trovare il commit appena creato" -#: builtin/commit.c:1260 +#: builtin/commit.c:1259 msgid "could not parse newly created commit" -msgstr "" +msgstr "non è stato possibile analizzare il commit appena creato" -#: builtin/commit.c:1301 +#: builtin/commit.c:1300 msgid "detached HEAD" msgstr "" -#: builtin/commit.c:1303 +#: builtin/commit.c:1302 msgid " (root-commit)" -msgstr "" +msgstr " (root-commit)" -#: builtin/commit.c:1447 +#: builtin/commit.c:1446 msgid "could not parse HEAD commit" -msgstr "" +msgstr "non è stato possibile analizzare il commit HEAD" -#: builtin/commit.c:1485 builtin/merge.c:509 +#: builtin/commit.c:1484 builtin/merge.c:509 #, c-format msgid "could not open '%s' for reading" msgstr "non è stato possibile aprire '%s' per la lettura" -#: builtin/commit.c:1492 +#: builtin/commit.c:1491 #, c-format msgid "Corrupt MERGE_HEAD file (%s)" msgstr "File MERGE_HEAD corrotto (%s)" -#: builtin/commit.c:1499 +#: builtin/commit.c:1498 msgid "could not read MERGE_MODE" msgstr "non è stato possibile leggere MERGE_MODE" -#: builtin/commit.c:1518 +#: builtin/commit.c:1517 #, c-format msgid "could not read commit message: %s" msgstr "non è stato possibile leggere il messaggio di commit: %s" -#: builtin/commit.c:1532 +#: builtin/commit.c:1531 #, c-format msgid "Aborting commit; you did not edit the message.\n" -msgstr "Commit annullato; il messaggio non è stato modificato.\n" +msgstr "Commit interrotto; il messaggio non è stato modificato.\n" -#: builtin/commit.c:1537 +#: builtin/commit.c:1536 #, c-format msgid "Aborting commit due to empty commit message.\n" -msgstr "Annullamento del commit a causa di un messaggio di commit vuoto.\n" +msgstr "Interruzione del commit a causa di un messaggio di commit vuoto.\n" -#: builtin/commit.c:1552 builtin/merge.c:936 builtin/merge.c:961 +#: builtin/commit.c:1551 builtin/merge.c:936 builtin/merge.c:961 msgid "failed to write commit object" msgstr "scrittura dell'oggetto di commit non riuscita" -#: builtin/commit.c:1573 +#: builtin/commit.c:1572 msgid "cannot lock HEAD ref" msgstr "" -#: builtin/commit.c:1577 +#: builtin/commit.c:1576 msgid "cannot update HEAD ref" msgstr "" -#: builtin/commit.c:1588 +#: builtin/commit.c:1587 msgid "" "Repository has been updated, but unable to write\n" "new_index file. Check that disk is not full or quota is\n" "not exceeded, and then \"git reset HEAD\" to recover." msgstr "" -"L'archivio è stato aggiornato, ma non è stato possibile scrivere il file\n" -"new_index. Verificare che l'unità disco non sia piena o che la quota non sia\n" -"stata superata, ed eseguire \"git reset HEAD\"ccc per il ripristino." +"Il repository è stato aggiornato, ma non è stato possibile scrivere il file\n" +"new_index. Verifica che l'unità disco non sia piena o che la quota non sia\n" +"stata superata, ed esegui \"git reset HEAD\" per il ripristino." #: builtin/describe.c:234 #, c-format @@ -2385,10 +2412,10 @@ msgstr "" #: builtin/describe.c:240 #, c-format msgid "tag '%s' is really '%s' here" -msgstr "" +msgstr "il tag '%s' è davvero '%s' qui" #: builtin/describe.c:267 -#, c-format, fuzzy +#, c-format msgid "Not a valid object name %s" msgstr "Non è il nome di un oggetto valido %s" @@ -2398,7 +2425,7 @@ msgid "%s is not a valid '%s' object" msgstr "%s non è un oggetto '%s' valido" #: builtin/describe.c:287 -#, c-format, fuzzy +#, c-format msgid "no tag exactly matches '%s'" msgstr "nessun tag corrisponde esattamente a '%s'" @@ -2426,7 +2453,7 @@ msgid "" "Try --always, or create some tags." msgstr "" "Nessun tag può descrivere '%s'.\n" -"Provare con --always, o creare dei tag." +"Prova con --always, o crea dei tag." #: builtin/describe.c:378 #, c-format @@ -2464,12 +2491,12 @@ msgstr "opzione non valida: %s" #: builtin/diff.c:297 msgid "Not a git repository" -msgstr "Non è un archivio git" +msgstr "Non è un repository git" #: builtin/diff.c:347 #, c-format msgid "invalid object '%s' given." -msgstr "" +msgstr "oggetto non valido '%s' specificato." #: builtin/diff.c:352 #, c-format @@ -2479,12 +2506,12 @@ msgstr "" #: builtin/diff.c:362 #, c-format msgid "more than two blobs given: '%s'" -msgstr "" +msgstr "più di due blob specificati: '%s'" #: builtin/diff.c:370 #, c-format msgid "unhandled object '%s' given." -msgstr "" +msgstr "oggetto non gestito '%s' specificato." #: builtin/fetch.c:200 msgid "Couldn't find remote ref HEAD" @@ -2510,32 +2537,31 @@ msgstr "[respinto]" #: builtin/fetch.c:285 msgid "[tag update]" -msgstr "" +msgstr "[tag aggiornata]" #: builtin/fetch.c:287 builtin/fetch.c:322 builtin/fetch.c:340 msgid " (unable to update local ref)" -msgstr "" +msgstr " (impossibile aggiornare il ref locale)" #: builtin/fetch.c:305 -#, fuzzy msgid "[new tag]" msgstr "[nuova tag]" #: builtin/fetch.c:308 msgid "[new branch]" -msgstr "[nuovo ramo]" +msgstr "[nuovo branch]" #: builtin/fetch.c:311 msgid "[new ref]" -msgstr "" +msgstr "[nuovo ref]" #: builtin/fetch.c:356 msgid "unable to update local ref" -msgstr "" +msgstr "impossibile aggiornare il ref locale" #: builtin/fetch.c:356 msgid "forced update" -msgstr "" +msgstr "aggiornamento forzato" #: builtin/fetch.c:362 msgid "(non-fast-forward)" @@ -2562,6 +2588,8 @@ msgid "" "some local refs could not be updated; try running\n" " 'git remote prune %s' to remove any old, conflicting branches" msgstr "" +"non è stato possibile aggiornare alcuni ref locali; prova con\n" +" 'git remote prune %s' per rimuovere ogni branch che vada in conflitto" #: builtin/fetch.c:549 #, c-format @@ -2599,7 +2627,7 @@ msgstr "" #: builtin/fetch.c:789 #, c-format msgid "Option \"%s\" is ignored for %s\n" -msgstr "" +msgstr "L'opzione \"%s\" è ignorata per %s\n" #: builtin/fetch.c:888 #, c-format @@ -2616,15 +2644,16 @@ msgid "" "No remote repository specified. Please, specify either a URL or a\n" "remote name from which new revisions should be fetched." msgstr "" +"Nessun repository remoto specificato. Per favore, specifica un URL o\n" +"il nome di un remote da cui prelevare nuove revisioni." #: builtin/fetch.c:927 -#, fuzzy msgid "You need to specify a tag name." -msgstr "È necessario specificare il nome di un tag." +msgstr "Devi specificare il nome di un tag." #: builtin/fetch.c:979 msgid "fetch --all does not take a repository argument" -msgstr "fetch --all non richiede l'archivio come argomento" +msgstr "fetch --all non richiede il repository come argomento" #: builtin/fetch.c:981 msgid "fetch --all does not make sense with refspecs" @@ -2642,7 +2671,7 @@ msgstr "" #: builtin/gc.c:63 #, c-format msgid "Invalid %s: '%s'" -msgstr "" +msgstr "%s non valido: '%s'" #: builtin/gc.c:90 #, c-format @@ -2669,7 +2698,7 @@ msgstr "" #: builtin/grep.c:216 #, c-format msgid "grep: failed to create thread: %s" -msgstr "" +msgstr "grep: creazione del thread non riuscita: %s" #: builtin/grep.c:402 #, c-format @@ -2679,7 +2708,7 @@ msgstr "" #: builtin/grep.c:478 builtin/grep.c:512 #, c-format msgid "unable to read tree (%s)" -msgstr "" +msgstr "impossibile leggere il tree (%s)" #: builtin/grep.c:526 #, c-format @@ -2689,39 +2718,39 @@ msgstr "" #: builtin/grep.c:584 #, c-format msgid "switch `%c' expects a numerical value" -msgstr "" +msgstr "switch '%c' richiede un valore numerico" #: builtin/grep.c:601 #, c-format msgid "cannot open '%s'" msgstr "impossibile aprire '%s'" -#: builtin/grep.c:888 +#: builtin/grep.c:885 msgid "no pattern given." -msgstr "" +msgstr "nessun modello specificato." -#: builtin/grep.c:902 +#: builtin/grep.c:899 #, c-format msgid "bad object %s" msgstr "oggetto %s errato" -#: builtin/grep.c:943 +#: builtin/grep.c:940 msgid "--open-files-in-pager only works on the worktree" -msgstr "--open-files-in-pager funziona solo nell'albero di lavoro" +msgstr "" -#: builtin/grep.c:966 +#: builtin/grep.c:963 msgid "--cached or --untracked cannot be used with --no-index." msgstr "--cached o --untracked non può essere usato con --no-index." -#: builtin/grep.c:971 +#: builtin/grep.c:968 msgid "--no-index or --untracked cannot be used with revs." -msgstr "" +msgstr "--no-index o --untracked non possono essere usate con le revisioni." -#: builtin/grep.c:974 +#: builtin/grep.c:971 msgid "--[no-]exclude-standard cannot be used for tracked contents." -msgstr "--[no-]exclude-standard non può essere usato per il contenuto tracciato." +msgstr "" -#: builtin/grep.c:982 +#: builtin/grep.c:979 msgid "both --cached and trees are given." msgstr "" @@ -2741,7 +2770,7 @@ msgstr "Verifica della versione di emacsclient non riuscita." #: builtin/help.c:108 #, c-format msgid "emacsclient version '%d' too old (< 22)." -msgstr "la versione '%d' di emacsclient è vecchia (<22)." +msgstr "la versione '%d' di emacsclient è troppo vecchia (<22)." #: builtin/help.c:126 builtin/help.c:154 builtin/help.c:163 builtin/help.c:171 #, c-format @@ -2754,8 +2783,8 @@ msgid "" "'%s': path for unsupported man viewer.\n" "Please consider using 'man.<tool>.cmd' instead." msgstr "" -"'%s': percorso ad un visualizzatore man non supportato.\n" -"Utilizzare invece 'man.<tool>.cmd'." +"'%s': path ad un visualizzatore man pages non supportato.\n" +"Usa invece 'man.<tool>.cmd'." #: builtin/help.c:223 #, c-format @@ -2763,6 +2792,8 @@ msgid "" "'%s': cmd for supported man viewer.\n" "Please consider using 'man.<tool>.path' instead." msgstr "" +"'%s': comando per visualizzatore man pages supportato.\n" +"Per favore usa 'man.<tool>.path' invece." #: builtin/help.c:287 msgid "The most commonly used git commands are:" @@ -2771,7 +2802,7 @@ msgstr "I comandi git usati più di frequente sono:" #: builtin/help.c:355 #, c-format msgid "'%s': unknown man viewer." -msgstr "'%s': visualizzatore mano sconosciuto." +msgstr "'%s': visualizzatore man sconosciuto." #: builtin/help.c:372 msgid "no man viewer handled the request" @@ -2784,7 +2815,7 @@ msgstr "nessun visualizzatore info ha gestito la richiesta" #: builtin/help.c:391 #, c-format msgid "'%s': not a documentation directory." -msgstr "'%s': non è una cartella della documentazione." +msgstr "'%s': non è una directory della documentazione." #: builtin/help.c:432 builtin/help.c:439 #, c-format @@ -2826,20 +2857,19 @@ msgstr "usati più byte di quelli disponibili" #: builtin/index-pack.c:256 msgid "pack too large for current definition of off_t" -msgstr "" +msgstr "pack troppo largo per la definizione corrente di off_t" #: builtin/index-pack.c:272 #, c-format msgid "unable to create '%s'" -msgstr "non è possibile creare '%s'" +msgstr "impossibile creare '%s'" #: builtin/index-pack.c:277 #, c-format msgid "cannot open packfile '%s'" -msgstr "" +msgstr "impossibile aprire il file pack '%s'" #: builtin/index-pack.c:291 -#, fuzzy msgid "pack signature mismatch" msgstr "la firma del pack non coincide" @@ -2894,10 +2924,10 @@ msgstr "TROVATA COLLISIONE SHA1 CON %s !" #: builtin/index-pack.c:598 #, c-format msgid "invalid blob object %s" -msgstr "" +msgstr "oggetto blob %s non valido" #: builtin/index-pack.c:610 -#, c-format, fuzzy +#, c-format msgid "invalid %s" msgstr "%s non valido" @@ -2923,7 +2953,6 @@ msgid "Indexing objects" msgstr "Indicizzazione degli oggetti" #: builtin/index-pack.c:872 -#, fuzzy msgid "pack is corrupted (SHA1 mismatch)" msgstr "il pack è corrotto (SHA1 non corrisponde)" @@ -2947,8 +2976,8 @@ msgstr "confusione al di là della follia" #, c-format msgid "pack has %d unresolved delta" msgid_plural "pack has %d unresolved deltas" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "pack ha %d delta irrisolto" +msgstr[1] "pack ha %d delta irrisolti" #: builtin/index-pack.c:998 #, c-format @@ -2958,17 +2987,16 @@ msgstr "" #: builtin/index-pack.c:1077 #, c-format msgid "local object %s is corrupt" -msgstr "" +msgstr "l'oggetto locale %s è corrotto" #: builtin/index-pack.c:1101 -#, fuzzy msgid "error while closing pack file" -msgstr "errore durante la chiusura del file pack" +msgstr "errore nella chiusura del file pack" #: builtin/index-pack.c:1114 -#, c-format, fuzzy +#, c-format msgid "cannot write keep file '%s'" -msgstr "non è stato possibile scrivere il keep file '%s'" +msgstr "impossibile scrivere il file keep '%s'" #: builtin/index-pack.c:1122 #, c-format @@ -2977,16 +3005,16 @@ msgstr "" #: builtin/index-pack.c:1135 msgid "cannot store pack file" -msgstr "" +msgstr "impossibile archiviare il file pack" #: builtin/index-pack.c:1146 msgid "cannot store index file" -msgstr "" +msgstr "impossibile archiviare index file" #: builtin/index-pack.c:1247 #, c-format msgid "Cannot open existing pack file '%s'" -msgstr "" +msgstr "Impossibile aprire il file pack '%s' esistente" #: builtin/index-pack.c:1249 #, c-format @@ -2994,14 +3022,14 @@ msgid "Cannot open existing pack idx file for '%s'" msgstr "" #: builtin/index-pack.c:1296 -#, c-format, fuzzy +#, c-format msgid "non delta: %d object" msgid_plural "non delta: %d objects" msgstr[0] "non delta: %d oggetto" msgstr[1] "non delta: %d oggetti" #: builtin/index-pack.c:1303 -#, c-format, fuzzy +#, c-format msgid "chain length = %d: %lu object" msgid_plural "chain length = %d: %lu objects" msgstr[0] "lunghezza della catena = %d: %lu oggetto" @@ -3022,19 +3050,18 @@ msgid "--fix-thin cannot be used without --stdin" msgstr "--fix-thin non può essere usato senza --stdin" #: builtin/index-pack.c:1411 builtin/index-pack.c:1421 -#, c-format, fuzzy +#, c-format msgid "packfile name '%s' does not end with '.pack'" msgstr "il nome del file pack '%s' non termina con '.pack'" #: builtin/index-pack.c:1430 -#, fuzzy msgid "--verify with no packfile name given" -msgstr "--verify senza un nome del file pack fornito" +msgstr "--verify senza un nome del file pack specificato" #: builtin/init-db.c:35 #, c-format msgid "Could not make %s writable by group" -msgstr "" +msgstr "Non è stato possible rendere %s scrivibile dal gruppo" #: builtin/init-db.c:62 #, c-format @@ -3044,7 +3071,7 @@ msgstr "" #: builtin/init-db.c:67 #, c-format msgid "cannot stat '%s'" -msgstr "non è stato possibile eseguire lo stat di '%s'" +msgstr "impossibile eseguire lo stat di '%s'" #: builtin/init-db.c:73 #, c-format @@ -3109,17 +3136,17 @@ msgstr "%s esiste già" #: builtin/init-db.c:354 #, c-format msgid "unable to handle file type %d" -msgstr "" +msgstr "impossibile gestire il tipo di file %d" #: builtin/init-db.c:357 #, c-format msgid "unable to move %s to %s" -msgstr "non è stato possibile spostare %s in %s" +msgstr "impossibile spostare %s in %s" #: builtin/init-db.c:362 #, c-format msgid "Could not create git link %s" -msgstr "" +msgstr "Non è stato possibile creare il link git %s" #. #. * TRANSLATORS: The first '%s' is either "Reinitialized @@ -3129,17 +3156,15 @@ msgstr "" #: builtin/init-db.c:419 #, c-format msgid "%s%s Git repository in %s%s\n" -msgstr "%s%s archivio Git in %s%s\n" +msgstr "%s%s repository Git in %s%s\n" #: builtin/init-db.c:420 -#, fuzzy msgid "Reinitialized existing" msgstr "Reinizializzato un esistente" #: builtin/init-db.c:420 -#, fuzzy msgid "Initialized empty" -msgstr "Inizializzato un vuoto" +msgstr "Inizializzato un" #: builtin/init-db.c:421 msgid " shared" @@ -3165,22 +3190,22 @@ msgid "" "%s (or --work-tree=<directory>) not allowed without specifying %s (or --git-" "dir=<directory>)" msgstr "" -"%s (o --work-tree=<cartella>) non consentito senza specificare %s (o --git-" -"dir=<cartella>)" +"%s (o --work-tree=<directory>) non consentito senza specificare %s (o --git-" +"dir=<directory>)" #: builtin/init-db.c:578 msgid "Cannot access current working directory" -msgstr "Non è stato possibile accedere alla cartella di lavoro corrente" +msgstr "Impossibile accedere alla directory di lavoro corrente" #: builtin/init-db.c:585 #, c-format msgid "Cannot access work tree '%s'" -msgstr "Non è stato possibile accedere all'albero di lavoro '%s'" +msgstr "" #: builtin/log.c:188 #, c-format msgid "Final output: %d %s\n" -msgstr "" +msgstr "Output finale: %d %s\n" #: builtin/log.c:401 builtin/log.c:489 #, c-format @@ -3196,85 +3221,81 @@ msgstr "Tipo sconosciuto: %d" msgid "format.headers without value" msgstr "format.headers non ha alcun valore" -#: builtin/log.c:675 +#: builtin/log.c:676 msgid "name of output directory is too long" -msgstr "il nome della cartella di output è troppo lungo" +msgstr "il nome della directory di output è troppo lungo" -#: builtin/log.c:686 +#: builtin/log.c:687 #, c-format msgid "Cannot open patch file %s" -msgstr "Non è possibile aprire il file patch %s" +msgstr "Impossibile aprire il file patch %s" -#: builtin/log.c:700 +#: builtin/log.c:701 msgid "Need exactly one range." msgstr "" -#: builtin/log.c:708 +#: builtin/log.c:709 msgid "Not a range." msgstr "" -#: builtin/log.c:745 -msgid "Could not extract email from committer identity." -msgstr "Non è stato possibile estrarre l'indirizzo email dall'identità del committer." - -#: builtin/log.c:791 +#: builtin/log.c:786 msgid "Cover letter needs email format" msgstr "" -#: builtin/log.c:885 +#: builtin/log.c:859 #, c-format msgid "insane in-reply-to: %s" msgstr "" -#: builtin/log.c:958 +#: builtin/log.c:932 msgid "Two output directories?" -msgstr "Due cartelle di output?" +msgstr "Due directory di output?" -#: builtin/log.c:1179 +#: builtin/log.c:1153 #, c-format msgid "bogus committer info %s" msgstr "" -#: builtin/log.c:1224 +#: builtin/log.c:1198 msgid "-n and -k are mutually exclusive." msgstr "" -#: builtin/log.c:1226 +#: builtin/log.c:1200 msgid "--subject-prefix and -k are mutually exclusive." msgstr "" -#: builtin/log.c:1234 +#: builtin/log.c:1208 msgid "--name-only does not make sense" msgstr "--name-only non ha senso" -#: builtin/log.c:1236 +#: builtin/log.c:1210 msgid "--name-status does not make sense" msgstr "--name-status non ha senso" -#: builtin/log.c:1238 +#: builtin/log.c:1212 msgid "--check does not make sense" msgstr "--check non ha senso" -#: builtin/log.c:1261 +#: builtin/log.c:1235 msgid "standard output, or directory, which one?" -msgstr "standard output, o cartella, quale dei due?" +msgstr "standard output, o directory, quale dei due?" -#: builtin/log.c:1263 +#: builtin/log.c:1237 #, c-format msgid "Could not create directory '%s'" -msgstr "Non è stato possibile creare la cartella '%s'" +msgstr "Non è stato possibile creare la directory '%s'" -#: builtin/log.c:1416 +#: builtin/log.c:1390 msgid "Failed to create output files" msgstr "Creazione dei file di output non riuscita" -#: builtin/log.c:1520 +#: builtin/log.c:1494 #, c-format msgid "" "Could not find a tracked remote branch, please specify <upstream> manually.\n" msgstr "" -#: builtin/log.c:1536 builtin/log.c:1538 builtin/log.c:1550 +#: builtin/log.c:1510 builtin/log.c:1512 builtin/log.c:1524 #, c-format msgid "Unknown commit %s" msgstr "Commit %s sconosciuto" @@ -3349,7 +3370,7 @@ msgstr "Stringa branch.%s.mergeoptions errata: %s" #: builtin/merge.c:629 msgid "git write-tree failed to write a tree" -msgstr "git write-tree non è riuscito a scrivere un albero" +msgstr "" #: builtin/merge.c:679 msgid "failed to read the cache" @@ -3357,7 +3378,7 @@ msgstr "lettura della cache non riuscita" #: builtin/merge.c:697 msgid "Unable to write index." -msgstr "Non è possibile scrivere l'indice." +msgstr "Impossibile scrivere index." #: builtin/merge.c:710 msgid "Not handling anything other than two heads merge." @@ -3402,11 +3423,11 @@ msgid "Wonderful.\n" msgstr "Splendido.\n" #: builtin/merge.c:993 -#, c-format, fuzzy +#, c-format msgid "Automatic merge failed; fix conflicts and then commit the result.\n" msgstr "" -"Merge automatico fallito; risolvere i conflitti ed effettuare il commit del\n" -"risultato.\n" +"Merge automatico fallito; risolvi i conflitti ed eseguire il commit\n" +"del risultato.\n" #: builtin/merge.c:1009 #, c-format @@ -3415,16 +3436,15 @@ msgstr "'%s' non è un commit" #: builtin/merge.c:1050 msgid "No current branch." -msgstr "Nessun ramo corrente." +msgstr "Nessun branch corrente." #: builtin/merge.c:1052 msgid "No remote for the current branch." -msgstr "" +msgstr "Nessun remote per il branch corrente." #: builtin/merge.c:1054 -#, fuzzy msgid "No default upstream defined for the current branch." -msgstr "Nessun upstream di default definito per il ramo corrente." +msgstr "Nessun upstream di default definito per il branch corrente." #: builtin/merge.c:1059 #, c-format @@ -3432,13 +3452,13 @@ msgid "No remote tracking branch for %s from %s" msgstr "" #: builtin/merge.c:1146 builtin/merge.c:1303 -#, c-format, fuzzy +#, c-format msgid "%s - not something we can merge" -msgstr "%s - non è qualcosa per cui effettuare il merge" +msgstr "%s - non è qualcosa per cui possiamo eseguire il merge" #: builtin/merge.c:1214 msgid "There is no merge to abort (MERGE_HEAD missing)." -msgstr "" +msgstr "Non c'è nessun merge da interrompere (manca MERGE_HEAD)" #: builtin/merge.c:1230 git-pull.sh:31 msgid "" @@ -3446,7 +3466,7 @@ msgid "" "Please, commit your changes before you can merge." msgstr "" "Il merge non è stato concluso (esiste MERGE_HEAD).\n" -"Per favore, effettuare il commit delle modifiche prima del merge." +"Per favore, esegui il commit delle modifiche prima del merge." #: builtin/merge.c:1233 git-pull.sh:34 msgid "You have not concluded your merge (MERGE_HEAD exists)." @@ -3458,19 +3478,19 @@ msgid "" "Please, commit your changes before you can merge." msgstr "" "Il cherry-pick non è stato concluso (esiste CHERRY_PICK_HEAD).\n" -"Per favore, eseguire il commit delle modifiche prima del merge." +"Per favore, esegui il commit delle modifiche prima del merge." #: builtin/merge.c:1240 msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)." -msgstr "" +msgstr "Il tuo cherry-pick non è stato concluso (CHERRY_PICK_HEAD esiste)." #: builtin/merge.c:1249 msgid "You cannot combine --squash with --no-ff." -msgstr "Non è possibile combinare --squash con --no-off." +msgstr "Impossibile combinare --squash con --no-off." #: builtin/merge.c:1254 msgid "You cannot combine --no-ff with --ff-only." -msgstr "Non è possibile combinare --no-ff con --ff-only." +msgstr "Impossibile combinare --no-ff con --ff-only." #: builtin/merge.c:1261 msgid "No commit specified and merge.defaultToUpstream not set." @@ -3505,7 +3525,7 @@ msgstr "No.\n" #: builtin/merge.c:1490 msgid "Not possible to fast-forward, aborting." -msgstr "" +msgstr "Fast-forward non possibile, stop." #: builtin/merge.c:1513 builtin/merge.c:1592 #, c-format @@ -3515,17 +3535,17 @@ msgstr "" #: builtin/merge.c:1517 #, c-format msgid "Trying merge strategy %s...\n" -msgstr "" +msgstr "Tentativo con la strategia di merge %s...\n" #: builtin/merge.c:1583 #, c-format msgid "No merge strategy handled the merge.\n" -msgstr "" +msgstr "Nessuna strategia di merge ha gestito il merge.\n" #: builtin/merge.c:1585 #, c-format msgid "Merge with strategy %s failed.\n" -msgstr "" +msgstr "Merge con la strategia %s fallito.\n" #: builtin/merge.c:1594 #, c-format @@ -3536,6 +3556,8 @@ msgstr "" #, c-format msgid "Automatic merge went well; stopped before committing as requested\n" msgstr "" +"Il merge automatico è andato a buon fine; fermato prima del commit come " +"richiesto\n" #: builtin/mv.c:108 #, c-format @@ -3548,24 +3570,24 @@ msgstr "" #: builtin/mv.c:115 msgid "can not move directory into itself" -msgstr "" +msgstr "non è possibile spostare la directory in sé stessa" #: builtin/mv.c:118 msgid "cannot move directory over file" -msgstr "" +msgstr "non è possibile spostare la directory su un file" #: builtin/mv.c:128 #, c-format msgid "Huh? %.*s is in index?" -msgstr "Eh? %.*s si trova nell'indice?" +msgstr "Eh? %.*s si trova in index?" #: builtin/mv.c:140 msgid "source directory is empty" -msgstr "la cartella sorgente è vuota" +msgstr "la directory sorgente è vuota" #: builtin/mv.c:171 msgid "not under version control" -msgstr "non si trova nel sistema di controllo versione" +msgstr "non è sotto controllo di versione" #: builtin/mv.c:173 msgid "destination exists" @@ -3578,7 +3600,7 @@ msgstr "sovrascrittura di %s in corso" #: builtin/mv.c:184 msgid "Cannot overwrite" -msgstr "" +msgstr "Impossibile sovrascrivere" #: builtin/mv.c:187 msgid "multiple sources for the same target" @@ -3597,12 +3619,12 @@ msgstr "Rinominazione di %s in %s in corso\n" #: builtin/mv.c:215 builtin/remote.c:731 #, c-format msgid "renaming '%s' failed" -msgstr "" +msgstr "rinomina di '%s' non riuscita" #: builtin/notes.c:139 #, c-format msgid "unable to start 'show' for object '%s'" -msgstr "" +msgstr "impossibile avviare 'show' per l'oggetto '%s'" #: builtin/notes.c:145 msgid "can't fdopen 'show' output fd" @@ -3621,35 +3643,35 @@ msgstr "" #: builtin/notes.c:175 builtin/tag.c:347 #, c-format msgid "could not create file '%s'" -msgstr "" +msgstr "non è stato possibile creare il file '%s'" #: builtin/notes.c:189 msgid "Please supply the note contents using either -m or -F option" -msgstr "" +msgstr "Per favore specifica il contenuto delle note usando le opzioni -m o -F" #: builtin/notes.c:210 builtin/notes.c:973 #, c-format msgid "Removing note for object %s\n" -msgstr "" +msgstr "Rimozione della nota per l'oggetto %s\n" #: builtin/notes.c:215 msgid "unable to write note object" -msgstr "" +msgstr "impossibile scrivere l'oggetto nota" #: builtin/notes.c:217 #, c-format msgid "The note contents has been left in %s" -msgstr "" +msgstr "Il contenuto della nota è stato lasciato in %s" #: builtin/notes.c:251 builtin/tag.c:542 #, c-format msgid "cannot read '%s'" -msgstr "" +msgstr "impossibile leggere '%s'" #: builtin/notes.c:253 builtin/tag.c:545 #, c-format msgid "could not open or read '%s'" -msgstr "" +msgstr "non è stato possibile aprire o leggere '%s'" #: builtin/notes.c:272 builtin/notes.c:445 builtin/notes.c:447 #: builtin/notes.c:507 builtin/notes.c:561 builtin/notes.c:644 @@ -3662,7 +3684,7 @@ msgstr "" #: builtin/notes.c:275 #, c-format msgid "Failed to read object '%s'." -msgstr "" +msgstr "Lettura dell'oggetto '%s' non riuscita." #: builtin/notes.c:299 msgid "Cannot commit uninitialized/unreferenced notes tree" @@ -3676,7 +3698,7 @@ msgstr "Valore di notes.rewriteMode errato: '%s'" #: builtin/notes.c:350 #, c-format msgid "Refusing to rewrite notes in %s (outside of refs/notes/)" -msgstr "" +msgstr "Impossibile riscrivere le note in %s (al di fuori di refs/notes/)" #. TRANSLATORS: The first %s is the name of the #. environment variable, the second %s is its value @@ -3688,12 +3710,12 @@ msgstr "Valore di %s errato: '%s'" #: builtin/notes.c:441 #, c-format msgid "Malformed input line: '%s'." -msgstr "" +msgstr "Riga di input malformata: '%s'." #: builtin/notes.c:456 #, c-format msgid "Failed to copy notes from '%s' to '%s'" -msgstr "" +msgstr "Copia delle note da '%s' a '%s' non riuscita" #: builtin/notes.c:500 builtin/notes.c:554 builtin/notes.c:627 #: builtin/notes.c:639 builtin/notes.c:712 builtin/notes.c:759 @@ -3716,7 +3738,7 @@ msgstr "" #: builtin/notes.c:585 builtin/notes.c:662 #, c-format msgid "Overwriting existing notes for object %s\n" -msgstr "" +msgstr "Sovrascrittura delle note esistenti per l'oggetto %s\n" #: builtin/notes.c:635 msgid "too few parameters" @@ -3728,11 +3750,13 @@ msgid "" "Cannot copy notes. Found existing notes for object %s. Use '-f' to overwrite " "existing notes" msgstr "" +"Impossibile copiare le note. Trovate note esistenti per l'oggetto %s. Usa " +"'-f' per sovrascrivere le note esistenti" #: builtin/notes.c:668 #, c-format msgid "Missing notes on source object %s. Cannot copy." -msgstr "" +msgstr "Note mancanti per l'oggetto sorgente %s. Impossibile copiare." #: builtin/notes.c:717 #, c-format @@ -3740,6 +3764,8 @@ msgid "" "The -m/-F/-c/-C options have been deprecated for the 'edit' subcommand.\n" "Please use 'git notes add -f -m/-F/-c/-C' instead.\n" msgstr "" +"Le opzioni -m/-F/-c/-C per il sottocomando 'edit' sono deprecate.\n" +"Per favore usa 'git notes add -f -m/-F/-c/-C' invece.\n" #: builtin/notes.c:971 #, c-format @@ -3749,27 +3775,27 @@ msgstr "L'oggetto %s non ha note.\n" #: builtin/notes.c:1103 builtin/remote.c:1598 #, c-format msgid "Unknown subcommand: %s" -msgstr "" +msgstr "Sottocomando sconosciuto: %s" -#: builtin/pack-objects.c:2315 +#: builtin/pack-objects.c:2337 #, c-format msgid "unsupported index version %s" -msgstr "" +msgstr "versione %s di index non supportata" -#: builtin/pack-objects.c:2319 +#: builtin/pack-objects.c:2341 #, c-format msgid "bad index version '%s'" -msgstr "versione dell'indice '%s' errata" +msgstr "versione '%s' di index errata" -#: builtin/pack-objects.c:2342 +#: builtin/pack-objects.c:2364 #, c-format msgid "option %s does not accept negative form" msgstr "l'opzione %s non accetta forme negative" -#: builtin/pack-objects.c:2346 +#: builtin/pack-objects.c:2368 #, c-format msgid "unable to parse value '%s' for option %s" -msgstr "" +msgstr "impossibile analizzare il valore '%s' per l'opzione %s" #: builtin/push.c:45 msgid "tag shorthand without <tag>" @@ -3777,7 +3803,7 @@ msgstr "" #: builtin/push.c:64 msgid "--delete only accepts plain target ref names" -msgstr "" +msgstr "--delete accetta solo nomi dei ref di destinazione in chiaro" #: builtin/push.c:99 msgid "" @@ -3818,11 +3844,15 @@ msgid "" "\n" " git push --set-upstream %s %s\n" msgstr "" +"Il branch corrente %s non ha alcun branch upstream.\n" +"Per eseguire il push del branch corrente ed impostare remote come upstream, usa\n" +"\n" +" git push --set-upstream %s %s\n" #: builtin/push.c:136 #, c-format msgid "The current branch %s has multiple upstream branches, refusing to push." -msgstr "" +msgstr "Il branch corrente %s ha branch multipli in upstream; push non eseguito." #: builtin/push.c:139 #, c-format @@ -3836,6 +3866,7 @@ msgstr "" msgid "" "You didn't specify any refspecs to push, and push.default is \"nothing\"." msgstr "" +"Non è stato specificato alcun refspec per il push, e push.default è \"nothing\"." #: builtin/push.c:181 msgid "" @@ -3874,7 +3905,7 @@ msgstr "" #: builtin/push.c:269 #, c-format msgid "bad repository '%s'" -msgstr "archivio '%s' errato" +msgstr "repository '%s' errato" #: builtin/push.c:270 msgid "" @@ -3888,10 +3919,19 @@ msgid "" "\n" " git push <name>\n" msgstr "" +"Nessuna destinazione per il push configurata.\n" +"Specifica un URL dalla riga di comando oppure configurare un repository " +"remoto usando\n" +"\n" +" git remote add <nome> <url>\n" +"\n" +"e poi eseguire il push usando il nome del remote\n" +"\n" +" git push <nome>\n" #: builtin/push.c:285 msgid "--all and --tags are incompatible" -msgstr "--all e tags non sono compatibili" +msgstr "--all e --tags non sono compatibili" #: builtin/push.c:286 msgid "--all can't be combined with refspecs" @@ -3899,7 +3939,7 @@ msgstr "" #: builtin/push.c:291 msgid "--mirror and --tags are incompatible" -msgstr "" +msgstr "--mirror e --tags non sono compatibili" #: builtin/push.c:292 msgid "--mirror can't be combined with refspecs" @@ -3915,7 +3955,7 @@ msgstr "--delete non è compatibile con --all, --mirror e --tags" #: builtin/push.c:387 msgid "--delete doesn't make sense without any refs" -msgstr "" +msgstr "--delete non ha senso senza alcun ref" #: builtin/remote.c:98 #, c-format @@ -3928,16 +3968,16 @@ msgid "" "\t use --mirror=fetch or --mirror=push instead" msgstr "" "--mirror è pericoloso e deprecato; per favore\n" -"\t usare invece --mirror-fetch o --mirror-push" +"\t usa invece --mirror-fetch o --mirror-push" #: builtin/remote.c:147 #, c-format msgid "unknown mirror argument: %s" -msgstr "" +msgstr "argomento di mirror sconosciuto: %s" #: builtin/remote.c:185 msgid "specifying a master branch makes no sense with --mirror" -msgstr "" +msgstr "specificare un branch master con --mirror non ha senso" #: builtin/remote.c:187 msgid "specifying branches to track makes sense only with fetch mirrors" @@ -3946,22 +3986,22 @@ msgstr "" #: builtin/remote.c:195 builtin/remote.c:646 #, c-format msgid "remote %s already exists." -msgstr "" +msgstr "il remoto %s esiste già." #: builtin/remote.c:199 builtin/remote.c:650 #, c-format msgid "'%s' is not a valid remote name" -msgstr "" +msgstr "'%s' non è un nome di remoto valido" #: builtin/remote.c:243 #, c-format msgid "Could not setup master '%s'" -msgstr "" +msgstr "Non è stato possibile configurare il master '%s'" #: builtin/remote.c:299 #, c-format msgid "more than one %s" -msgstr "" +msgstr "più di un %s" #: builtin/remote.c:339 #, c-format @@ -3970,26 +4010,26 @@ msgstr "" #: builtin/remote.c:440 builtin/remote.c:448 msgid "(matching)" -msgstr "" +msgstr "(corrispondente)" #: builtin/remote.c:452 msgid "(delete)" -msgstr "" +msgstr "(elimina)" #: builtin/remote.c:595 builtin/remote.c:601 builtin/remote.c:607 #, c-format msgid "Could not append '%s' to '%s'" -msgstr "" +msgstr "Non è stato possibile aggiungere '%s' a '%s'" #: builtin/remote.c:639 builtin/remote.c:792 builtin/remote.c:890 #, c-format msgid "No such remote: %s" -msgstr "" +msgstr "Remote non esistente: %s" #: builtin/remote.c:656 -#, c-format, fuzzy +#, c-format msgid "Could not rename config section '%s' to '%s'" -msgstr "Non è stato possibile rinominare la sezione di configurazione '%s' in '%s'" +msgstr "Non è stato possibile rinominare la sezione di configurazione da '%s' in '%s'" #: builtin/remote.c:662 builtin/remote.c:799 #, c-format @@ -3999,7 +4039,7 @@ msgstr "Non è stato possibile rimuovere la sezione di configurazione '%s'" #: builtin/remote.c:677 #, c-format msgid "" -"Not updating non-default fetch respec\n" +"Not updating non-default fetch refspec\n" "\t%s\n" "\tPlease update the configuration manually if necessary." msgstr "" @@ -4012,12 +4052,12 @@ msgstr "" #: builtin/remote.c:694 #, c-format msgid "Could not set '%s'" -msgstr "" +msgstr "Non è stato possibile impostare '%s'" #: builtin/remote.c:716 #, c-format msgid "deleting '%s' failed" -msgstr "eliminazione di '%s' fallita" +msgstr "eliminazione di '%s' non riuscita" #: builtin/remote.c:750 #, c-format @@ -4027,7 +4067,7 @@ msgstr "creazione di '%s' non riuscita" #: builtin/remote.c:764 #, c-format msgid "Could not remove branch %s" -msgstr "Non è stato possibile rimuovere il ramo %s" +msgstr "Non è stato possibile rimuovere il branch %s" #: builtin/remote.c:834 msgid "" @@ -4037,7 +4077,13 @@ msgid_plural "" "Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n" "to delete them, use:" msgstr[0] "" +"Nota: un branch al di fuori della gerarchia refs/remotes/ non è stato " +"eliminato;\n" +"per eliminarlo, usare:" msgstr[1] "" +"Nota: alcuni branch al di fuori della gerarchia refs/remotes/ non sono stati " +"eliminati;\n" +"per eliminarli, usare:" #: builtin/remote.c:943 #, c-format @@ -4050,16 +4096,17 @@ msgstr "" #: builtin/remote.c:948 msgid " stale (use 'git remote prune' to remove)" -msgstr "" +msgstr " vecchio (usare 'git remote prune' per rimuoverlo)" #: builtin/remote.c:950 msgid " ???" -msgstr "" +msgstr "???" #: builtin/remote.c:991 #, c-format msgid "invalid branch.%s.merge; cannot rebase onto > 1 branch" msgstr "" +"branch.%s.merge non valido; impossibile eseguire il rebase su > 1 branch" #: builtin/remote.c:998 #, c-format @@ -4069,16 +4116,16 @@ msgstr "" #: builtin/remote.c:1001 #, c-format msgid " merges with remote %s" -msgstr "" +msgstr " merge con il remote %s" #: builtin/remote.c:1002 msgid " and with remote" -msgstr "" +msgstr " e con il remote" #: builtin/remote.c:1004 #, c-format msgid "merges with remote %s" -msgstr "" +msgstr "merge con il remote %s" #: builtin/remote.c:1005 msgid " and with remote" @@ -4086,15 +4133,15 @@ msgstr "" #: builtin/remote.c:1051 msgid "create" -msgstr "" +msgstr "crea" #: builtin/remote.c:1054 msgid "delete" -msgstr "" +msgstr "elimina" #: builtin/remote.c:1058 msgid "up to date" -msgstr "" +msgstr "aggiornato" #: builtin/remote.c:1061 msgid "fast-forwardable" @@ -4102,7 +4149,7 @@ msgstr "" #: builtin/remote.c:1064 msgid "local out of date" -msgstr "" +msgstr "locale non aggiornato" #: builtin/remote.c:1071 #, c-format @@ -4122,12 +4169,12 @@ msgstr "" #: builtin/remote.c:1081 #, c-format msgid " %-*s pushes to %s" -msgstr "" +msgstr " %-*s esegue il push su %s" #: builtin/remote.c:1118 #, c-format msgid "* remote %s" -msgstr "" +msgstr "* remote %s" #: builtin/remote.c:1119 #, c-format @@ -4146,20 +4193,21 @@ msgstr "" #: builtin/remote.c:1133 builtin/remote.c:1135 builtin/remote.c:1137 #, c-format msgid " HEAD branch: %s" -msgstr " ramo HEAD: %s" +msgstr " branch HEAD: %s" #: builtin/remote.c:1139 #, c-format msgid "" " HEAD branch (remote HEAD is ambiguous, may be one of the following):\n" msgstr "" +" branch HEAD (l'HEAD remoto è ambiguo, potrebbe essere uno dei seguenti):\n" #: builtin/remote.c:1151 #, c-format msgid " Remote branch:%s" msgid_plural " Remote branches:%s" -msgstr[0] " Ramo remoto:%s" -msgstr[1] " Rami remoti:%s" +msgstr[0] " Branch remoto:%s" +msgstr[1] " Branch remoti:%s" #: builtin/remote.c:1154 builtin/remote.c:1181 msgid " (status not queried)" @@ -4168,8 +4216,8 @@ msgstr "" #: builtin/remote.c:1163 msgid " Local branch configured for 'git pull':" msgid_plural " Local branches configured for 'git pull':" -msgstr[0] " Ramo locale configurato per 'git pull':" -msgstr[1] " Rami locali configurati per 'git pull':" +msgstr[0] " Branch locale configurato per 'git pull':" +msgstr[1] " Branch locali configurati per 'git pull':" #: builtin/remote.c:1171 msgid " Local refs will be mirrored by 'git push'" @@ -4179,12 +4227,12 @@ msgstr "" #, c-format msgid " Local ref configured for 'git push'%s:" msgid_plural " Local refs configured for 'git push'%s:" -msgstr[0] "" -msgstr[1] "" +msgstr[0] " Ref locale configurato per 'git push'%s:" +msgstr[1] " Ref locali configurati per 'git push'%s:" #: builtin/remote.c:1216 msgid "Cannot determine remote HEAD" -msgstr "" +msgstr "Impossibile determinare l'HEAD remoto" #: builtin/remote.c:1218 msgid "Multiple remote HEAD branches. Please choose one explicitly with:" @@ -4193,17 +4241,17 @@ msgstr "" #: builtin/remote.c:1228 #, c-format msgid "Could not delete %s" -msgstr "" +msgstr "Non è stato possibile eliminare %s" #: builtin/remote.c:1236 #, c-format msgid "Not a valid ref: %s" -msgstr "" +msgstr "Non è un ref valido: %s" #: builtin/remote.c:1238 #, c-format msgid "Could not setup %s" -msgstr "" +msgstr "Non è stato possibile configurare %s" #: builtin/remote.c:1274 #, c-format @@ -4223,7 +4271,7 @@ msgstr "" #: builtin/remote.c:1282 #, c-format msgid "URL: %s" -msgstr "" +msgstr "URL: %s" #: builtin/remote.c:1295 #, c-format @@ -4238,11 +4286,11 @@ msgstr "" #: builtin/remote.c:1387 builtin/remote.c:1461 #, c-format msgid "No such remote '%s'" -msgstr "" +msgstr "Remote '%s' non esistente" #: builtin/remote.c:1414 msgid "no remote specified" -msgstr "" +msgstr "nessun remote specificato" #: builtin/remote.c:1447 msgid "--add --delete doesn't make sense" @@ -4293,20 +4341,20 @@ msgstr "" #: builtin/reset.c:85 #, c-format msgid "Failed to find tree of %s." -msgstr "Ricerca dell'albero di %s non riuscita." +msgstr "" #: builtin/reset.c:96 msgid "Could not write new index file." -msgstr "Non è stato possibile scrivere il nuovo file indice." +msgstr "Non è stato possibile scrivere il nuovo index file." #: builtin/reset.c:106 -#, c-format, fuzzy +#, c-format msgid "HEAD is now at %s" msgstr "HEAD ora si trova a %s" #: builtin/reset.c:130 msgid "Could not read index" -msgstr "Non è possibile leggere l'indice" +msgstr "Non è stato possibile leggere index" #: builtin/reset.c:133 msgid "Unstaged changes after reset:" @@ -4315,12 +4363,12 @@ msgstr "" #: builtin/reset.c:223 #, c-format msgid "Cannot do a %s reset in the middle of a merge." -msgstr "" +msgstr "Impossibile eseguire un %s reset nel corso di un merge." #: builtin/reset.c:297 #, c-format msgid "Could not parse object '%s'." -msgstr "" +msgstr "Non è stato possibile analizzare l'oggetto '%s'." #: builtin/reset.c:302 msgid "--patch is incompatible with --{hard,mixed,soft}" @@ -4328,7 +4376,7 @@ msgstr "--patch non è compatibile con --{hard,mixed,soft}" #: builtin/reset.c:311 msgid "--mixed with paths is deprecated; use 'git reset -- <paths>' instead." -msgstr "--mixed con i percorsi è deprecata; usare invece 'git reset -- <percorso>'." +msgstr "--mixed con i path è deprecata; usa invece 'git reset -- <path>'." #: builtin/reset.c:313 #, c-format @@ -4336,31 +4384,31 @@ msgid "Cannot do %s reset with paths." msgstr "" #: builtin/reset.c:325 -#, c-format, fuzzy +#, c-format msgid "%s reset is not allowed in a bare repository" -msgstr "%s reset non è consentito in un archivio scoperto #FIXME: bare" +msgstr "%s reset non è consentito in un repository spoglio" #: builtin/reset.c:341 -#, c-format, fuzzy +#, c-format msgid "Could not reset index file to revision '%s'." -msgstr "Non è possibile ripristinare il file indice alla revisione '%s'." +msgstr "" +"Non è stato possibile ripristinare index file " +"alla revisione '%s'." #: builtin/revert.c:70 builtin/revert.c:92 #, c-format msgid "%s: %s cannot be used with %s" -msgstr "%s: %s non può essere usato con %s" +msgstr "%s: %s non può essere usata con %s" #: builtin/revert.c:131 msgid "program error" msgstr "errore del programma" #: builtin/revert.c:221 -#, fuzzy msgid "revert failed" msgstr "revert non riuscito" #: builtin/revert.c:236 -#, fuzzy msgid "cherry-pick failed" msgstr "cherry-pick non riuscito" @@ -4385,7 +4433,7 @@ msgid "" "(use --cached to keep the file, or -f to force removal)" msgstr "" "'%s' contiene delle modifiche locali\n" -"(usare --cached per mantenere il file, o -f per forzare la rimozione)" +"(usa --cached per mantenere il file, o -f per forzare la rimozione)" #: builtin/rm.c:194 #, c-format @@ -4408,7 +4456,7 @@ msgid "malformed object at '%s'" msgstr "" #: builtin/tag.c:207 -#, c-format, fuzzy +#, c-format msgid "tag name too long: %.*s..." msgstr "nome tag troppo lungo: %.*s..." @@ -4425,7 +4473,7 @@ msgstr "Tag '%s' eliminato (era %s)\n" #: builtin/tag.c:239 #, c-format msgid "could not verify the tag '%s'" -msgstr "non è possibile verificare il tag '%s'" +msgstr "non è stato possibile verificare il tag '%s'" #: builtin/tag.c:249 msgid "" @@ -4435,6 +4483,11 @@ msgid "" "# Lines starting with '#' will be ignored.\n" "#\n" msgstr "" +"\n" +"#\n" +"# Scrivere un messaggio associato al tag\n" +"# Le righe che iniziano con '#' verranno ignorate.\n" +"#\n" #: builtin/tag.c:256 msgid "" @@ -4445,44 +4498,46 @@ msgid "" "want to.\n" "#\n" msgstr "" +"\n" +"#\n" +"# Scrivere un messaggio associato al tag\n" +"# Le righe che iniziano con '#' verranno mantenute; possono essere comunque " +"rimosse manualmente.\n" +"#\n" #: builtin/tag.c:298 msgid "unable to sign the tag" -msgstr "non è possibile firmare il tag" +msgstr "impossibile firmare il tag" #: builtin/tag.c:300 msgid "unable to write tag file" -msgstr "" +msgstr "impossibile scrivere il file di tag" #: builtin/tag.c:325 -#, fuzzy msgid "bad object type." msgstr "tipo di oggetto errato." #: builtin/tag.c:338 -#, fuzzy msgid "tag header too big." -msgstr "intestazione del tag troppo grande" +msgstr "intestazione del tag troppo grande." #: builtin/tag.c:370 -#, fuzzy msgid "no tag message?" msgstr "nessun messaggio per il tag?" #: builtin/tag.c:376 -#, c-format, fuzzy +#, c-format msgid "The tag message has been left in %s\n" -msgstr "Il messaggio tag è stato lasciato in %s\n" +msgstr "Il messaggio del tag è stato lasciato in %s\n" #: builtin/tag.c:425 -#, fuzzy msgid "switch 'points-at' requires an object" msgstr "lo switch 'points-at' richiede un oggetto" #: builtin/tag.c:427 #, c-format msgid "malformed object name '%s'" -msgstr "" +msgstr "nome oggetto '%s' malformato" #: builtin/tag.c:506 msgid "--column and -n are incompatible" @@ -4509,7 +4564,7 @@ msgid "too many params" msgstr "troppi parametri" #: builtin/tag.c:561 -#, c-format, fuzzy +#, c-format msgid "'%s' is not a valid tag name." msgstr "'%s' non è un nome tag valido." @@ -4521,12 +4576,12 @@ msgstr "il tag '%s' esiste già" #: builtin/tag.c:584 #, c-format msgid "%s: cannot lock the ref" -msgstr "" +msgstr "%s: impossibile riservare il ref" #: builtin/tag.c:586 #, c-format msgid "%s: cannot update the ref" -msgstr "" +msgstr "%s: impossibile aggiornare il ref" #: builtin/tag.c:588 #, c-format @@ -4535,14 +4590,15 @@ msgstr "Tag '%s' aggiornato (era %s)\n" #: git.c:16 msgid "See 'git help <command>' for more information on a specific command." -msgstr "Consultare 'git help <comando> per maggiori informazioni su un comando specifico." +msgstr "" +"Vedi 'git help <comando> per maggiori informazioni su un comando " +"specifico." #: parse-options.h:133 parse-options.h:235 msgid "n" msgstr "n" #: parse-options.h:141 -#, fuzzy msgid "time" msgstr "tempo" @@ -4567,22 +4623,20 @@ msgid "be more quiet" msgstr "meno dettagliato" #: parse-options.h:236 -#, fuzzy msgid "use <n> digits to display SHA-1s" -msgstr "usa <n> cifre per mostrare SHA-1" +msgstr "usare <n> cifre per mostrare gli hash SHA-1" #: common-cmds.h:8 -#, fuzzy msgid "Add file contents to the index" -msgstr "Aggiunge il contenuto del file all'indice" +msgstr "Aggiunge il contenuto del file a index" #: common-cmds.h:9 msgid "Find by binary search the change that introduced a bug" -msgstr "" +msgstr "Cerca mediante ricerca binaria la modifica che ha introdotto un bug" #: common-cmds.h:10 msgid "List, create, or delete branches" -msgstr "Elenca, crea o elimina rami" +msgstr "Elenca, crea o elimina branch" #: common-cmds.h:11 msgid "Checkout a branch or paths to the working tree" @@ -4590,20 +4644,19 @@ msgstr "" #: common-cmds.h:12 msgid "Clone a repository into a new directory" -msgstr "Clona un archivio in una nuova cartella" +msgstr "Clona un repository in una nuova directory" #: common-cmds.h:13 -#, fuzzy msgid "Record changes to the repository" -msgstr "Registra modifiche nell'archivio" +msgstr "Registra modifiche nel repository" #: common-cmds.h:14 msgid "Show changes between commits, commit and working tree, etc" -msgstr "Mostra le modifiche tra i commit, commit e albero di lavoro, ecc" +msgstr "" #: common-cmds.h:15 msgid "Download objects and refs from another repository" -msgstr "" +msgstr "Scarica oggetti e ref da un altro repository" #: common-cmds.h:16 msgid "Print lines matching a pattern" @@ -4611,42 +4664,39 @@ msgstr "Stampa le righe corrispondenti ad un modello" #: common-cmds.h:17 msgid "Create an empty git repository or reinitialize an existing one" -msgstr "Crea un archivio git vuoto o reinizializza uno esistente" +msgstr "Crea un repository git vuoto o reinizializza uno esistente" #: common-cmds.h:18 msgid "Show commit logs" msgstr "Mostra log del commit" #: common-cmds.h:19 -#, fuzzy msgid "Join two or more development histories together" -msgstr "Unisce due o più cronologie di sviluppo insieme" +msgstr "Unisce due o più cronologie di sviluppo" #: common-cmds.h:20 msgid "Move or rename a file, a directory, or a symlink" -msgstr "Sposta o rinomina un file, una cartella o un link simbolico" +msgstr "Sposta o rinomina un file, una directory o un link simbolico" #: common-cmds.h:21 -#, fuzzy msgid "Fetch from and merge with another repository or a local branch" -msgstr "Preleva e applica da un altro archivio o un ramo locale" +msgstr "Combina fetche + merge da un altro repository o un branch locale" #: common-cmds.h:22 msgid "Update remote refs along with associated objects" -msgstr "" +msgstr "Aggiorna i ref remoti insieme agli oggetti associati" #: common-cmds.h:23 msgid "Forward-port local commits to the updated upstream head" msgstr "" #: common-cmds.h:24 -#, fuzzy msgid "Reset current HEAD to the specified state" msgstr "Ripristina l'HEAD corrente allo stato specificato" #: common-cmds.h:25 msgid "Remove files from the working tree and from the index" -msgstr "Rimuove file dall'albero di lavoro e dall'indice" +msgstr "" #: common-cmds.h:26 msgid "Show various types of objects" @@ -4654,18 +4704,38 @@ msgstr "Mostra vari tipi di oggetti" #: common-cmds.h:27 msgid "Show the working tree status" -msgstr "Mostra lo stato dell'albero di lavoro" +msgstr "" #: common-cmds.h:28 -#, fuzzy msgid "Create, list, delete or verify a tag object signed with GPG" -msgstr "Crea, elenca. elimina o verifica un oggetto tag firmato con GPG" +msgstr "Crea, elenca, elimina o verifica un oggetto tag firmato con GPG" #: git-am.sh:50 -#, fuzzy msgid "You need to set your committer info first" msgstr "È necessario impostare le informazioni sul committer" +#: git-am.sh:95 +msgid "" +"You seem to have moved HEAD since the last 'am' failure.\n" +"Not rewinding to ORIG_HEAD" +msgstr "" + +#: git-am.sh:105 +#, sh-format +msgid "" +"When you have resolved this problem run \"$cmdline --resolved\".\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"Quando hai risolto il problema esegui \"$cmdline --resolved\".\n" +"Se vuoi saltare questa patch, esegui invece \"$cmdline --skip\".\n" +"Per ripristinare il branch originale e interrompere l'applicazione delle " +"patch esegui \"$cmdline --abort\"." + +#: git-am.sh:121 +msgid "Cannot fall back to three-way merge." +msgstr "" + #: git-am.sh:137 msgid "Repository lacks necessary blobs to fall back on 3-way merge." msgstr "" @@ -4675,13 +4745,14 @@ msgid "" "Did you hand edit your patch?\n" "It does not apply to blobs recorded in its index." msgstr "" +"La tua patch è stata modificata manualmente?\n" +"Non può essere applicata ai blob registrati nel proprio index." #: git-am.sh:163 msgid "Falling back to patching base and 3-way merge..." msgstr "" #: git-am.sh:275 -#, fuzzy msgid "Only one StGIT patch series can be applied at once" msgstr "Può essere applicata solo una serie di patch StGIT per volta" @@ -4692,7 +4763,7 @@ msgstr "Il formato patch $patch_format non è supportato." #: git-am.sh:364 msgid "Patch format detection failed." -msgstr "" +msgstr "Rilevamento del formato della patch non riuscito." #: git-am.sh:418 msgid "-d option is no longer supported. Do not use." @@ -4704,9 +4775,8 @@ msgid "previous rebase directory $dotest still exists but mbox given." msgstr "" #: git-am.sh:486 -#, fuzzy msgid "Please make up your mind. --skip or --abort?" -msgstr "Per favore, decidetevi. --skip o --abort?" +msgstr "Per favore, deciditi. --skip o --abort?" #: git-am.sh:513 msgid "Resolve operation not in progress, we are not resuming." @@ -4717,62 +4787,96 @@ msgstr "" msgid "Dirty index: cannot apply patches (dirty: $files)" msgstr "" +#: git-am.sh:671 +#, sh-format +msgid "" +"Patch is empty. Was it split wrong?\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" + +#: git-am.sh:708 +msgid "Patch does not have a valid e-mail address." +msgstr "La patch non contiene un indirizzo email valido." + #: git-am.sh:755 -#, fuzzy msgid "cannot be interactive without stdin connected to a terminal." msgstr "" -"non è possibile passare in modalità interattiva senza uno standard input connesso ad\n" -"un terminale" + +#: git-am.sh:759 +msgid "Commit Body is:" +msgstr "" #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a] #. in your translation. The program will only accept English #. input at this point. #: git-am.sh:766 -#, fuzzy msgid "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all " -msgstr "Applicare? [s]ì/[n]o/[m]odifica/[v]isualizza/mostra [p]atch/[a]ccetta tutto " +msgstr "Applicare? sì[y]/no[n]/modifica[e]/visualizza patch[v]/accetta tutto[a] " #: git-am.sh:802 #, sh-format msgid "Applying: $FIRSTLINE" msgstr "" +#: git-am.sh:823 +msgid "" +"No changes - did you forget to use 'git add'?\n" +"If there is nothing left to stage, chances are that something else\n" +"already introduced the same changes; you might want to skip this patch." +msgstr "" + +#: git-am.sh:831 +msgid "" +"You still have unmerged paths in your index\n" +"did you forget to use 'git add'?" +msgstr "" + #: git-am.sh:847 msgid "No changes -- Patch already applied." msgstr "Nessuna modifica -- patch già applicata." +#: git-am.sh:857 +#, sh-format +msgid "Patch failed at $msgnum $FIRSTLINE" +msgstr "Patch non riuscita a $msgnum $FIRSTLINE" + #: git-am.sh:873 msgid "applying to an empty history" msgstr "" +#: git-bisect.sh:48 +msgid "You need to start by \"git bisect start\"" +msgstr "Devi iniziare con \"git bisect start\"" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. #: git-bisect.sh:54 -#, fuzzy msgid "Do you want me to do it for you [Y/n]? " -msgstr "Volete che me ne occupi io [S/n]? " +msgstr "Vuoi che me ne occupi io [Y/n]? " #: git-bisect.sh:95 #, sh-format msgid "unrecognised option: '$arg'" -msgstr "opzione non riconoscitua: '$arg'" +msgstr "opzione non riconosciuta: '$arg'" #: git-bisect.sh:99 #, sh-format msgid "'$arg' does not appear to be a valid revision" -msgstr "" +msgstr "'$arg' non sembra essere una revisione valida" #: git-bisect.sh:117 -#, fuzzy msgid "Bad HEAD - I need a HEAD" -msgstr "HEAD errata - ho bisogno di una HEAD" +msgstr "" #: git-bisect.sh:130 #, sh-format msgid "" "Checking out '$start_head' failed. Try 'git bisect reset <validbranch>'." msgstr "" +"Checkout di '$start_head' non riuscito. Prova 'git bisect reset " +"<branch-valido>'." #: git-bisect.sh:140 msgid "won't bisect on seeked tree" @@ -4780,12 +4884,12 @@ msgstr "" #: git-bisect.sh:144 msgid "Bad HEAD - strange symbolic ref" -msgstr "" +msgstr "HEAD errato - strano ref simbolico" #: git-bisect.sh:189 #, sh-format msgid "Bad bisect_write argument: $state" -msgstr "" +msgstr "Argomento bisect_write errato: $state" #: git-bisect.sh:218 #, sh-format @@ -4794,7 +4898,7 @@ msgstr "" #: git-bisect.sh:232 msgid "Please call 'bisect_state' with at least one argument." -msgstr "Per favore, chiamare 'bisect_state' con almeno un argomento." +msgstr "Per favore, chiama 'bisect_state' con almeno un argomento." #: git-bisect.sh:244 #, sh-format @@ -4805,12 +4909,37 @@ msgstr "" msgid "'git bisect bad' can take only one argument." msgstr "'git bisect bad' può prendere un solo argomento." +#. have bad but not good. we could bisect although +#. this is less optimum. +#: git-bisect.sh:273 +msgid "Warning: bisecting only with a bad commit." +msgstr "" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. #: git-bisect.sh:279 msgid "Are you sure [Y/n]? " -msgstr "Si è sicuri? [S/n] " +msgstr "Sei sicuro? [Y/n] " + +#: git-bisect.sh:289 +msgid "" +"You need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"Devi specificare almeno una revisione corretta ed una errata.\n" +"(Puoi usare \"git bisect bad\" e \"git bisect good\" per questo scopo.)" + +#: git-bisect.sh:292 +msgid "" +"You need to start by \"git bisect start\".\n" +"You then need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" + +#: git-bisect.sh:347 git-bisect.sh:474 +msgid "We are not bisecting." +msgstr "Non stiamo eseguendo un bisect." #: git-bisect.sh:354 #, sh-format @@ -4835,12 +4964,38 @@ msgstr "" #: git-bisect.sh:408 msgid "?? what are you talking about?" +msgstr "?? di cosa si sta parlando?" + +#: git-bisect.sh:420 +#, sh-format +msgid "running $command" +msgstr "sto eseguendo $command" + +#: git-bisect.sh:427 +#, sh-format +msgid "" +"bisect run failed:\n" +"exit code $res from '$command' is < 0 or >= 128" msgstr "" +"bisect run non riuscito:\n" +"il codice di uscita $res da '$command' è < 0 oppure >= 128" -#: git-bisect.sh:474 -#, fuzzy -msgid "We are not bisecting." -msgstr "Non stiamo eseguendo il bisect." +#: git-bisect.sh:453 +msgid "bisect run cannot continue any more" +msgstr "bisect run non può più proseguire" + +#: git-bisect.sh:459 +#, sh-format +msgid "" +"bisect run failed:\n" +"'bisect_state $state' exited with error code $res" +msgstr "" +"bisect run non riuscito:\n" +"bisect_state $state è uscito con il codice di errore $res" + +#: git-bisect.sh:466 +msgid "bisect run success" +msgstr "bisect run eseguito con successo" #: git-pull.sh:21 msgid "" @@ -4852,37 +5007,48 @@ msgstr "" #: git-pull.sh:25 msgid "Pull is not possible because you have unmerged files." msgstr "" +"Il pull non è possibile perché ci sono file di cui non è stato eseguito il " +"merge." #: git-pull.sh:197 msgid "updating an unborn branch with changes added to the index" msgstr "" +#. The fetch involved updating the current branch. +#. The working tree and the index file is still based on the +#. $orig_head commit, but we are merging into $curr_head. +#. First update the working tree to match $curr_head. +#: git-pull.sh:228 +#, sh-format +msgid "" +"Warning: fetch updated the current branch head.\n" +"Warning: fast-forwarding your working tree from\n" +"Warning: commit $orig_head." +msgstr "" + #: git-pull.sh:253 msgid "Cannot merge multiple branches into empty head" -msgstr "" +msgstr "Impossibile eseguire il merge di branch multipli in un head vuoto" #: git-pull.sh:257 msgid "Cannot rebase onto multiple branches" -msgstr "Non è possibile eseguire il rebase su rami multipli" +msgstr "Impossibile eseguire il rebase su branch multipli" #: git-stash.sh:51 -#, fuzzy msgid "git stash clear with parameters is unimplemented" msgstr "git stash clear con parametri non è implementato" #: git-stash.sh:74 msgid "You do not have the initial commit yet" -msgstr "Non esiste ancora un commit iniziale" +msgstr "Non hai ancora un commit iniziale" #: git-stash.sh:89 -#, fuzzy msgid "Cannot save the current index state" -msgstr "Non è possibile salvare lo stato corrente dell'indice" +msgstr "Impossibile salvare lo stato corrente di index" #: git-stash.sh:123 git-stash.sh:136 -#, fuzzy msgid "Cannot save the current worktree state" -msgstr "Non è possibile salvare lo stato dell'albero di lavoro corrente" +msgstr "" #: git-stash.sh:140 msgid "No changes selected" @@ -4893,9 +5059,27 @@ msgid "Cannot remove temporary index (can't happen)" msgstr "" #: git-stash.sh:156 -#, fuzzy msgid "Cannot record working tree state" -msgstr "Non è possbile registrare lo stato dell'albero di lavoro" +msgstr "" + +#. TRANSLATORS: $option is an invalid option, like +#. `--blah-blah'. The 7 spaces at the beginning of the +#. second line correspond to "error: ". So you should line +#. up the second line with however many characters the +#. translation of "error: " takes in your language. E.g. in +#. English this is: +#. +#. $ git stash save --blah-blah 2>&1 | head -n 2 +#. error: unknown option for 'stash save': --blah-blah +#. To provide a message, use git stash save -- '--blah-blah' +#: git-stash.sh:202 +#, sh-format +msgid "" +"error: unknown option for 'stash save': $option\n" +" To provide a message, use git stash save -- '$option'" +msgstr "" +"errore: opzione sconosciuta per 'stash save': $option\n" +" Per aggiungere un messaggio, usare git stash save -- '$option'" #: git-stash.sh:223 msgid "No local changes to save" @@ -4903,24 +5087,22 @@ msgstr "Nessuna modifica locale da salvare" #: git-stash.sh:227 msgid "Cannot initialize stash" -msgstr "Non è possibile inizializzare stash" +msgstr "Impossibile inizializzare stash" #: git-stash.sh:235 -#, fuzzy msgid "Cannot save the current status" -msgstr "Non è possibile salvare lo stato attuale" +msgstr "Impossibile salvare lo stato attuale" #: git-stash.sh:253 -#, fuzzy msgid "Cannot remove worktree changes" -msgstr "Non è possibile rimuovere le modifiche all'albero di lavoro" +msgstr "" #: git-stash.sh:352 msgid "No stash found." msgstr "Nessuno stash trovato." #: git-stash.sh:359 -#, sh-format, fuzzy +#, sh-format msgid "Too many revisions specified: $REV" msgstr "Troppe revisioni specificate: $REV" @@ -4935,49 +5117,51 @@ msgid "'$args' is not a stash-like commit" msgstr "'$args' non è un commit di tipo stash" #: git-stash.sh:404 -#, sh-format, fuzzy +#, sh-format msgid "'$args' is not a stash reference" -msgstr "'$args' non è un riferimento a stash" +msgstr "'$args' non è un referimento a uno stash" #: git-stash.sh:412 msgid "unable to refresh index" -msgstr "non è stato possibile aggiornare l'indice" +msgstr "impossibile aggiornare index" #: git-stash.sh:416 msgid "Cannot apply a stash in the middle of a merge" -msgstr "Non è possibile applicare uno stash nel mezzo di un merge" +msgstr "Impossibile applicare uno stash nel mezzo di un merge" #: git-stash.sh:424 -#, fuzzy msgid "Conflicts in index. Try without --index." -msgstr "Ci sono conflitti nell'indice. Provare senza --index." +msgstr "Ci sono conflitti in index. Prova senza --index." #: git-stash.sh:426 msgid "Could not save index tree" -msgstr "Non è stato possibile salvare l'indice dell'albero" +msgstr "" #: git-stash.sh:460 msgid "Cannot unstage modified files" msgstr "" +#: git-stash.sh:474 +msgid "Index was not unstashed." +msgstr "" + #: git-stash.sh:491 #, sh-format msgid "Dropped ${REV} ($s)" -msgstr "" +msgstr "${REV} eliminata ($s)" #: git-stash.sh:492 #, sh-format msgid "${REV}: Could not drop stash entry" -msgstr "" +msgstr "${REV}: non è stato possibile rimuovere la voce di stash" #: git-stash.sh:499 -#, fuzzy msgid "No branch name specified" -msgstr "Nessun nome del ramo specificato" +msgstr "Nome del branch non specificato" #: git-stash.sh:570 msgid "(To restore them type \"git stash apply\")" -msgstr "(Per ripristinarli digitare \"git stash apply\")" +msgstr "(Per ripristinarli digita \"git stash apply\")" #: git-submodule.sh:56 #, sh-format @@ -5002,17 +5186,33 @@ msgstr "" #: git-submodule.sh:249 #, sh-format msgid "repo URL: '$repo' must be absolute or begin with ./|../" -msgstr "" +msgstr "repo URL: '$repo' deve essere assoluto o iniziare con ./|../" #: git-submodule.sh:266 #, sh-format msgid "'$sm_path' already exists in the index" +msgstr "'$sm_path' esiste già in index" + +#: git-submodule.sh:270 +#, sh-format +msgid "" +"The following path is ignored by one of your .gitignore files:\n" +"$sm_path\n" +"Use -f if you really want to add it." +msgstr "" +"Il seguente path è ignorato da uno dei tuoi file .gitignore:\n" +"$sm_path\n" +"Usa -f se vuoi davvero aggiungerlo." + +#: git-submodule.sh:281 +#, sh-format +msgid "Adding existing repo at '$sm_path' to the index" msgstr "" #: git-submodule.sh:283 #, sh-format msgid "'$sm_path' already exists and is not a valid git repo" -msgstr "" +msgstr "'$sm_path' esiste già e non è un repository git valido" #: git-submodule.sh:297 #, sh-format @@ -5038,107 +5238,130 @@ msgstr "" #, sh-format msgid "Stopping at '$sm_path'; script returned non-zero status." msgstr "" +"Interruzione a '$sm_path'; lo script ha restituito uno stato diverso da zero." -#: git-submodule.sh:405 +#: git-submodule.sh:406 #, sh-format msgid "No url found for submodule path '$sm_path' in .gitmodules" msgstr "" -#: git-submodule.sh:414 +#: git-submodule.sh:415 #, sh-format msgid "Failed to register url for submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:422 +#: git-submodule.sh:417 #, sh-format -msgid "Failed to register update mode for submodule path '$sm_path'" +msgid "Submodule '$name' ($url) registered for path '$sm_path'" msgstr "" -#: git-submodule.sh:424 +#: git-submodule.sh:425 #, sh-format -msgid "Submodule '$name' ($url) registered for path '$sm_path'" +msgid "Failed to register update mode for submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:523 +#: git-submodule.sh:524 #, sh-format msgid "" "Submodule path '$sm_path' not initialized\n" "Maybe you want to use 'update --init'?" msgstr "" -#: git-submodule.sh:536 +#: git-submodule.sh:537 #, sh-format msgid "Unable to find current revision in submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:555 +#: git-submodule.sh:556 #, sh-format msgid "Unable to fetch in submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:569 +#: git-submodule.sh:570 #, sh-format msgid "Unable to rebase '$sha1' in submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:570 +#: git-submodule.sh:571 #, sh-format msgid "Submodule path '$sm_path': rebased into '$sha1'" msgstr "" -#: git-submodule.sh:575 +#: git-submodule.sh:576 #, sh-format msgid "Unable to merge '$sha1' in submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:576 +#: git-submodule.sh:577 #, sh-format msgid "Submodule path '$sm_path': merged in '$sha1'" msgstr "" -#: git-submodule.sh:581 +#: git-submodule.sh:582 #, sh-format msgid "Unable to checkout '$sha1' in submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:582 +#: git-submodule.sh:583 #, sh-format msgid "Submodule path '$sm_path': checked out '$sha1'" msgstr "" -#: git-submodule.sh:604 git-submodule.sh:927 +#: git-submodule.sh:605 git-submodule.sh:928 #, sh-format msgid "Failed to recurse into submodule path '$sm_path'" msgstr "" -#: git-submodule.sh:712 -msgid "--" -msgstr "--" +#: git-submodule.sh:713 +msgid "--cached cannot be used with --files" +msgstr "--cached non può essere usata con --files" + +#. unexpected type +#: git-submodule.sh:753 +#, sh-format +msgid "unexpected mode $mod_dst" +msgstr "modalità $mod_dst inattesa" -#: git-submodule.sh:770 +#: git-submodule.sh:771 #, sh-format msgid " Warn: $name doesn't contain commit $sha1_src" msgstr " Attenzione: $name non contiene commit $sha1_src" -#: git-submodule.sh:773 +#: git-submodule.sh:774 #, sh-format msgid " Warn: $name doesn't contain commit $sha1_dst" msgstr " Attenzione: $name non contiene commit $sha1_dst" -#: git-submodule.sh:776 +#: git-submodule.sh:777 #, sh-format msgid " Warn: $name doesn't contain commits $sha1_src and $sha1_dst" msgstr " Attenzione: $name non contiene commit $sha1_src e $sha1_dst" -#: git-submodule.sh:801 +#: git-submodule.sh:802 msgid "blob" -msgstr "" +msgstr "blob" -#: git-submodule.sh:802 +#: git-submodule.sh:803 msgid "submodule" +msgstr "sottomodulo" + +#: git-submodule.sh:840 +msgid "# Submodules changed but not updated:" +msgstr "" + +#: git-submodule.sh:842 +msgid "# Submodule changes to be committed:" msgstr "" -#: git-submodule.sh:973 +#: git-submodule.sh:974 #, sh-format msgid "Synchronizing submodule url for '$name'" msgstr "" + +#~ msgid "--" +#~ msgstr "--" + +#~ msgid "Could not extract email from committer identity." +#~ msgstr "" +#~ "Non è stato possibile estrarre l'indirizzo email dall'identità del " +#~ "committer." @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: git-1.7.11-rc0-100-g5498c\n" +"Project-Id-Version: git-1.7.11.rc2.2.gb694fbb\n" "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n" -"POT-Creation-Date: 2012-06-02 07:03+0800\n" -"PO-Revision-Date: 2012-06-03 07:13+0700\n" +"POT-Creation-Date: 2012-06-08 10:20+0800\n" +"PO-Revision-Date: 2012-06-09 14:08+0700\n" "Last-Translator: Trần Ngọc Quân <vnwildman@gmail.com>\n" "Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n" "MIME-Version: 1.0\n" @@ -4887,6 +4887,29 @@ msgstr "Tạo, liệt kê, xóa hay xác thực một đối tượng thẻ (tag msgid "You need to set your committer info first" msgstr "Bạn cần đặt thông tin về người chuyển giao mã nguồn trước đã" +#: git-am.sh:95 +msgid "" +"You seem to have moved HEAD since the last 'am' failure.\n" +"Not rewinding to ORIG_HEAD" +msgstr "" +"Bạn có lẽ đã có HEAD đã bị di chuyển đi kể từ lần 'am' thất bại cuối cùng.\n" +"Không thể chuyển tới ORIG_HEAD" + +#: git-am.sh:105 +#, sh-format +msgid "" +"When you have resolved this problem run \"$cmdline --resolved\".\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"Khi bạn cần giải quyết vấn đề này hãy chạy lệnh \"$cmdline --resolved\".\n" +"Nếu bạn có ý định bỏ qua miếng vá, thay vào đó bạn chạy \"$cmdline --skip\".\n" +"Để phục hồi lại thành nhánh nguyên bản và dừng việc vá lại thì chạy \"$cmdline --abort\"." + +#: git-am.sh:121 +msgid "Cannot fall back to three-way merge." +msgstr "Đang trở lại để hòa trộn kiểu 'three-way'." + #: git-am.sh:137 msgid "Repository lacks necessary blobs to fall back on 3-way merge." msgstr "Kho thiếu đối tượng blob cần thiết để trở về trên '3-way merge'." @@ -4938,10 +4961,29 @@ msgstr "Thao tác phân giải không đang được tiến hành, chúng ta kh msgid "Dirty index: cannot apply patches (dirty: $files)" msgstr "Bảng mục lục sai: không thể áp dụng các miếng vá (sai: $files)" +#: git-am.sh:671 +#, sh-format +msgid "" +"Patch is empty. Was it split wrong?\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"Miếng vá trống rỗng. Nó đã bị chia cắt sai phải không?\n" +"Nếu bạn thích bỏ qua miếng vá này, hãy chạy lệnh sau để thay thế \"$cmdline --skip\".\n" +"Để phục hồi lại nhánh nguyên bản và dừng vá lại hãy chạy lệnh \"$cmdline --abort\"." + +#: git-am.sh:708 +msgid "Patch does not have a valid e-mail address." +msgstr "Miếng vá không có địa chỉ e-mail hợp lệ." + #: git-am.sh:755 msgid "cannot be interactive without stdin connected to a terminal." msgstr "không thể được tương tác mà không có stdin kết nối với một thiết bị cuối" +#: git-am.sh:759 +msgid "Commit Body is:" +msgstr "Thân của lần chuyển giao (commit) là:" + #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a] #. in your translation. The program will only accept English #. input at this point. @@ -4954,14 +4996,41 @@ msgstr "Áp dụng? đồng ý [y]/không [n]/chỉnh sửa [e]/hiển thị mi msgid "Applying: $FIRSTLINE" msgstr "Đang áp dụng (miếng vá): $FIRSTLINE" +#: git-am.sh:823 +msgid "" +"No changes - did you forget to use 'git add'?\n" +"If there is nothing left to stage, chances are that something else\n" +"already introduced the same changes; you might want to skip this patch." +msgstr "" +"Không có thay đổi nào - bạn đã quên sử dụng lệnh 'git add' à?\n" +"Nếu ở đây không có gì còn lại stage, tình cờ là có một số thứ khác\n" +"đã sẵn được đưa vào với cùng nội dung thay đổi; bạn có lẽ muốn bỏ qua miếng vá này." + +#: git-am.sh:831 +msgid "" +"You still have unmerged paths in your index\n" +"did you forget to use 'git add'?" +msgstr "" +"Bạn vẫn có những đường dẫn chưa được hòa trộn trong bảng mục lục của mình\n" +"bạn đã quên sử dụng lệnh 'git add' à?" + #: git-am.sh:847 msgid "No changes -- Patch already applied." msgstr "Không thay đổi gì cả -- Miếng vá đã được áp dụng rồi." +#: git-am.sh:857 +#, sh-format +msgid "Patch failed at $msgnum $FIRSTLINE" +msgstr "Vá gặp lỗi tại $msgnum $FIRSTLINE" + #: git-am.sh:873 msgid "applying to an empty history" msgstr "áp dụng vào một lịch sử trống rỗng" +#: git-bisect.sh:48 +msgid "You need to start by \"git bisect start\"" +msgstr "Bạn cần khởi đầu bằng \"git bisect start\"" + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -5019,6 +5088,12 @@ msgstr "Đầu vào rev sai: $rev" msgid "'git bisect bad' can take only one argument." msgstr "'git bisect bad' có thể lấy chỉ một đối số." +#. have bad but not good. we could bisect although +#. this is less optimum. +#: git-bisect.sh:273 +msgid "Warning: bisecting only with a bad commit." +msgstr "Cảnh báo: chỉ thực hiện việc bisect với một lần chuyển giao (commit) sai." + #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input #. at this point. @@ -5026,6 +5101,29 @@ msgstr "'git bisect bad' có thể lấy chỉ một đối số." msgid "Are you sure [Y/n]? " msgstr "Bạn có chắc chắn chưa [Y/n]?" +#: git-bisect.sh:289 +msgid "" +"You need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"Bạn phải chỉ cho tôi ít nhất một điểm xét duyệt tốt và một điểm sai.\n" +"(Bạn có thể sử dụng \"git bisect bad\" và \"git bisect good\" cho cái đó.)" + +#: git-bisect.sh:292 +msgid "" +"You need to start by \"git bisect start\".\n" +"You then need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"Bạn cần bắt đầu bằng lệnh \"git bisect start\".\n" +"Bạn sau đó cần phải chỉ cho tôi ít nhất một điểm xét duyệt đúng và một điểm sai.\n" +"(Bạn có thể sử dụng \"git bisect bad\" và \"git bisect good\" cho chúng.)" + +#: git-bisect.sh:347 +#: git-bisect.sh:474 +msgid "We are not bisecting." +msgstr "Chúng tôi không bisect." + #: git-bisect.sh:354 #, sh-format msgid "'$invalid' is not a valid commit" @@ -5053,9 +5151,36 @@ msgstr "không thể đọc $file để thao diễn lại" msgid "?? what are you talking about?" msgstr "?? bạn đang nói gì thế?" -#: git-bisect.sh:474 -msgid "We are not bisecting." -msgstr "Chúng tôi không bisect." +#: git-bisect.sh:420 +#, sh-format +msgid "running $command" +msgstr "đang chạy lệnh $command" + +#: git-bisect.sh:427 +#, sh-format +msgid "" +"bisect run failed:\n" +"exit code $res from '$command' is < 0 or >= 128" +msgstr "" +"chạy bisect gặp lỗi:\n" +"mã trả về $res từ lệnh '$command' là < 0 hoặc >= 128" + +#: git-bisect.sh:453 +msgid "bisect run cannot continue any more" +msgstr "bisect không thể tiếp tục thêm được nữa" + +#: git-bisect.sh:459 +#, sh-format +msgid "" +"bisect run failed:\n" +"'bisect_state $state' exited with error code $res" +msgstr "" +"chạy bisect gặp lỗi:\n" +"'bisect_state $state' đã thoát ra với mã lỗi $res" + +#: git-bisect.sh:466 +msgid "bisect run success" +msgstr "bisect chạy thành công" #: git-pull.sh:21 msgid "" @@ -5075,6 +5200,21 @@ msgstr "Full là không thể thực hiện bởi vì bạn có những tập ti msgid "updating an unborn branch with changes added to the index" msgstr "đang cập nhật một nhánh chưa được sinh ra với các thay đổi được thêm vào bảng mục lục" +#. The fetch involved updating the current branch. +#. The working tree and the index file is still based on the +#. $orig_head commit, but we are merging into $curr_head. +#. First update the working tree to match $curr_head. +#: git-pull.sh:228 +#, sh-format +msgid "" +"Warning: fetch updated the current branch head.\n" +"Warning: fast-forwarding your working tree from\n" +"Warning: commit $orig_head." +msgstr "" +"Cảnh báo: fetch đã cập nhật head nhánh hiện tại.\n" +"Cảnh báo: đang fast-forward cây làm việc của bạn từ\n" +"Cảnh báo: commit $orig_head." + #: git-pull.sh:253 msgid "Cannot merge multiple branches into empty head" msgstr "Không thể hòa trộn nhiều nhánh và trong một head trống rỗng" @@ -5112,6 +5252,25 @@ msgstr "Không thể gỡ bỏ bảng mục lục tạm thời (không thể x msgid "Cannot record working tree state" msgstr "Không thể ghi lại trạng thái cây làm việc hiện hành" +#. TRANSLATORS: $option is an invalid option, like +#. `--blah-blah'. The 7 spaces at the beginning of the +#. second line correspond to "error: ". So you should line +#. up the second line with however many characters the +#. translation of "error: " takes in your language. E.g. in +#. English this is: +#. +#. $ git stash save --blah-blah 2>&1 | head -n 2 +#. error: unknown option for 'stash save': --blah-blah +#. To provide a message, use git stash save -- '--blah-blah' +#: git-stash.sh:202 +#, sh-format +msgid "" +"error: unknown option for 'stash save': $option\n" +" To provide a message, use git stash save -- '$option'" +msgstr "" +"lỗi: không hiểu tùy chọn cho 'stash save': $option\n" +" Để cung cấp một thông điệp, sử dụng git stash save -- '$option'" + #: git-stash.sh:223 msgid "No local changes to save" msgstr "Không có thay đổi nội bộ nào được ghi lại" @@ -5172,6 +5331,10 @@ msgstr "Không thể ghi lại cây chỉ mục" msgid "Cannot unstage modified files" msgstr "Không thể bỏ trạng thía của các tập tin đã được sửa chữa" +#: git-stash.sh:474 +msgid "Index was not unstashed." +msgstr "Bảng mục lục đã không được bỏ stash." + #: git-stash.sh:491 #, sh-format msgid "Dropped ${REV} ($s)" @@ -5220,6 +5383,22 @@ msgstr "repo URL: '$repo' phải là đường dẫn tuyệt đối hoặc là b msgid "'$sm_path' already exists in the index" msgstr "'$sm_path' thực sự đã tồn tại ở bảng mục lục rồi" +#: git-submodule.sh:270 +#, sh-format +msgid "" +"The following path is ignored by one of your .gitignore files:\n" +"$sm_path\n" +"Use -f if you really want to add it." +msgstr "" +"Các đường dẫn theo sau đây sẽ bị lờ đi bởi một trong các tập tin .gitignore của bạn:\n" +"$sm_path\n" +"Sử dụng -f nếu bạn thực sự muốn thêm nó vào." + +#: git-submodule.sh:281 +#, sh-format +msgid "Adding existing repo at '$sm_path' to the index" +msgstr "Đang thêm repo có sẵn tại '$sm_path' vào bảng mục lục" + #: git-submodule.sh:283 #, sh-format msgid "'$sm_path' already exists and is not a valid git repo" @@ -5326,8 +5505,14 @@ msgid "Failed to recurse into submodule path '$sm_path'" msgstr "Gặp lỗi khi đệ quy vào trong đường dẫn mô-đun-con '$sm_path'" #: git-submodule.sh:713 -msgid "--" -msgstr "--" +msgid "--cached cannot be used with --files" +msgstr "--cached không thể được sử dụng cùng với --files" + +#. unexpected type +#: git-submodule.sh:753 +#, sh-format +msgid "unexpected mode $mod_dst" +msgstr "chế độ không như mong chờ $mod_dst" #: git-submodule.sh:771 #, sh-format @@ -5352,11 +5537,22 @@ msgstr "blob" msgid "submodule" msgstr "mô-đun con" +#: git-submodule.sh:840 +msgid "# Submodules changed but not updated:" +msgstr "# Những mô-đun-con đã bị thay đổi nhưng chưa được cập nhật:" + +#: git-submodule.sh:842 +msgid "# Submodule changes to be committed:" +msgstr "# Những thay đổi mô-đun-con được chuyển giao (commit):" + #: git-submodule.sh:974 #, sh-format msgid "Synchronizing submodule url for '$name'" msgstr "Đang đồng bộ hóa url mô-đun-con cho '$name'" +#~ msgid "--" +#~ msgstr "--" + #~ msgid "Could not extract email from committer identity." #~ msgstr "" #~ "Không thể rút trích địa chỉ thư điện tử từ định danh người chuyển giao" diff --git a/po/zh_CN.po b/po/zh_CN.po index 1b7a51b933..b46b53e6d6 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -12,8 +12,8 @@ msgid "" msgstr "" "Project-Id-Version: Git\n" "Report-Msgid-Bugs-To: Git Mailing List <git@vger.kernel.org>\n" -"POT-Creation-Date: 2012-06-02 07:03+0800\n" -"PO-Revision-Date: 2012-06-02 17:05+0800\n" +"POT-Creation-Date: 2012-06-08 10:20+0800\n" +"PO-Revision-Date: 2012-06-08 12:24+0800\n" "Last-Translator: Jiang Xin <worldhello.net@gmail.com>\n" "Language-Team: GitHub <https://github.com/gotgit/git/>\n" "Language: zh_CN\n" @@ -4806,6 +4806,28 @@ msgstr "创建、列出、删除或校验一个GPG签名的 tag 对象" msgid "You need to set your committer info first" msgstr "您需要先设置你的提交者信息" +#: git-am.sh:95 +msgid "" +"You seem to have moved HEAD since the last 'am' failure.\n" +"Not rewinding to ORIG_HEAD" +msgstr "" +"您好像在上一次 'am' 失败后移动了 HEAD。未回退至 ORIG_HEAD" + +#: git-am.sh:105 +#, sh-format +msgid "" +"When you have resolved this problem run \"$cmdline --resolved\".\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"当您解决了此问题后,执行 \"$cmdline --resolved\"。\n" +"如果您想跳过此补丁,则执行 \"$cmdline --skip\"。\n" +"要恢复原分支并停止打补丁,执行 \"$cmdline --abort\"。" + +#: git-am.sh:121 +msgid "Cannot fall back to three-way merge." +msgstr "无法求助于三路合并。" + #: git-am.sh:137 msgid "Repository lacks necessary blobs to fall back on 3-way merge." msgstr "版本库缺乏必要的 blob 数据以进行三路合并。" @@ -4820,7 +4842,7 @@ msgstr "" #: git-am.sh:163 msgid "Falling back to patching base and 3-way merge..." -msgstr "回退到补丁基础版本并使用三路合并..." +msgstr "转而在基础版本上打补丁及进行三路合并..." #: git-am.sh:275 msgid "Only one StGIT patch series can be applied at once" @@ -4857,10 +4879,29 @@ msgstr "解决操作未进行,我们不会继续。" msgid "Dirty index: cannot apply patches (dirty: $files)" msgstr "脏的索引:不能应用补丁(脏文件:$files)" +#: git-am.sh:671 +#, sh-format +msgid "" +"Patch is empty. Was it split wrong?\n" +"If you would prefer to skip this patch, instead run \"$cmdline --skip\".\n" +"To restore the original branch and stop patching run \"$cmdline --abort\"." +msgstr "" +"补丁为空。是不是切分错误?\n" +"如果您想要跳过这个补丁,执行 \"$cmdline --skip\"。\n" +"要恢复原分支并停止打补丁,执行 \"$cmdline --abort\"。" + +#: git-am.sh:708 +msgid "Patch does not have a valid e-mail address." +msgstr "补丁中没有一个有效的邮件地址。" + #: git-am.sh:755 msgid "cannot be interactive without stdin connected to a terminal." msgstr "标准输入没有和终端关联,不能进行交互式操作。" +#: git-am.sh:759 +msgid "Commit Body is:" +msgstr "提交内容为:" + # 译者:注意保持句尾空格 #. TRANSLATORS: Make sure to include [y], [n], [e], [v] and [a] #. in your translation. The program will only accept English @@ -4874,14 +4915,40 @@ msgstr "应用?[y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all " msgid "Applying: $FIRSTLINE" msgstr "正应用:$FIRSTLINE" +#: git-am.sh:823 +msgid "" +"No changes - did you forget to use 'git add'?\n" +"If there is nothing left to stage, chances are that something else\n" +"already introduced the same changes; you might want to skip this patch." +msgstr "" +"没有变更 —— 您是不是忘了执行 'git add'?\n" +"如果没有什么要添加到暂存区的,则很可能是其它提交已经引入了相同的变更。\n" +"您也许想要跳过这个补丁。" + +#: git-am.sh:831 +msgid "" +"You still have unmerged paths in your index\n" +"did you forget to use 'git add'?" +msgstr "" +"您的索引中仍有未合并的路径。您是否忘了执行 'git add'?" + #: git-am.sh:847 msgid "No changes -- Patch already applied." msgstr "没有变更 -- 补丁已经应用过。" +#: git-am.sh:857 +#, sh-format +msgid "Patch failed at $msgnum $FIRSTLINE" +msgstr "补丁失败于 $msgnum $FIRSTLINE" + #: git-am.sh:873 msgid "applying to an empty history" msgstr "正应用到一个空历史上" +#: git-bisect.sh:48 +msgid "You need to start by \"git bisect start\"" +msgstr "您需要执行 \"git bisect start\" 来开始" + # 译者:注意保持句尾空格 #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input @@ -4941,6 +5008,12 @@ msgstr "输入坏的版本:$rev" msgid "'git bisect bad' can take only one argument." msgstr "'git bisect bad' 只能带一个参数。" +#. have bad but not good. we could bisect although +#. this is less optimum. +#: git-bisect.sh:273 +msgid "Warning: bisecting only with a bad commit." +msgstr "警告:在仅有一个坏提交下进行二分查找。" + # 译者:注意保持句尾空格 #. TRANSLATORS: Make sure to include [Y] and [n] in your #. translation. The program will only accept English input @@ -4949,6 +5022,28 @@ msgstr "'git bisect bad' 只能带一个参数。" msgid "Are you sure [Y/n]? " msgstr "您确认么[Y/n]? " +#: git-bisect.sh:289 +msgid "" +"You need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"您需要给我至少一个好版本和一个坏版本。\n" +"(您可以用 \"git bisect bad\" 和 \"git bisect good\" 命令来标识。)" + +#: git-bisect.sh:292 +msgid "" +"You need to start by \"git bisect start\".\n" +"You then need to give me at least one good and one bad revisions.\n" +"(You can use \"git bisect bad\" and \"git bisect good\" for that.)" +msgstr "" +"您需要执行 \"git bisect start\" 来开始。\n" +"然后需要提供我至少一个好版本和一个坏版本。\n" +"(您可以用 \"git bisect bad\" 和 \"git bisect good\" 命令来标识。)" + +#: git-bisect.sh:347 git-bisect.sh:474 +msgid "We are not bisecting." +msgstr "我们没有在二分查找。" + #: git-bisect.sh:354 #, sh-format msgid "'$invalid' is not a valid commit" @@ -4976,9 +5071,36 @@ msgstr "不能读取 $file 来重放" msgid "?? what are you talking about?" msgstr "?? 您在说什么?" -#: git-bisect.sh:474 -msgid "We are not bisecting." -msgstr "我们没有在二分查找。" +#: git-bisect.sh:420 +#, sh-format +msgid "running $command" +msgstr "运行 $command" + +#: git-bisect.sh:427 +#, sh-format +msgid "" +"bisect run failed:\n" +"exit code $res from '$command' is < 0 or >= 128" +msgstr "" +"二分查找运行失败:\n" +"命令 '$command' 的退出码 $res 或者小于 0 或者大于等于 128" + +#: git-bisect.sh:453 +msgid "bisect run cannot continue any more" +msgstr "二分查找不能继续运行" + +#: git-bisect.sh:459 +#, sh-format +msgid "" +"bisect run failed:\n" +"'bisect_state $state' exited with error code $res" +msgstr "" +"二分查找运行失败:\n" +"'bisect_state $state' 退出码为 $res" + +#: git-bisect.sh:466 +msgid "bisect run success" +msgstr "二分查找运行成功" #: git-pull.sh:21 msgid "" @@ -4998,6 +5120,20 @@ msgstr "Pull 不可用,因为您尚有未合并的文件。" msgid "updating an unborn branch with changes added to the index" msgstr "更新尚未诞生的分支,变更添加至索引" +#. The fetch involved updating the current branch. +#. The working tree and the index file is still based on the +#. $orig_head commit, but we are merging into $curr_head. +#. First update the working tree to match $curr_head. +#: git-pull.sh:228 +#, sh-format +msgid "" +"Warning: fetch updated the current branch head.\n" +"Warning: fast-forwarding your working tree from\n" +"Warning: commit $orig_head." +msgstr "" +"警告:fetch 更新了当前的分支。您的工作区\n" +"警告:从原提交 $orig_head 快进。" + #: git-pull.sh:253 msgid "Cannot merge multiple branches into empty head" msgstr "无法将多个分支合并到空分支" @@ -5034,6 +5170,25 @@ msgstr "无法删除临时索引(不应发生)" msgid "Cannot record working tree state" msgstr "不能记录工作区状态" +#. TRANSLATORS: $option is an invalid option, like +#. `--blah-blah'. The 7 spaces at the beginning of the +#. second line correspond to "error: ". So you should line +#. up the second line with however many characters the +#. translation of "error: " takes in your language. E.g. in +#. English this is: +#. +#. $ git stash save --blah-blah 2>&1 | head -n 2 +#. error: unknown option for 'stash save': --blah-blah +#. To provide a message, use git stash save -- '--blah-blah' +#: git-stash.sh:202 +#, sh-format +msgid "" +"error: unknown option for 'stash save': $option\n" +" To provide a message, use git stash save -- '$option'" +msgstr "" +"错误:'stash save' 的未知选项:$option\n" +" 要提供一个描述信息,使用 git stash save -- '$option'" + #: git-stash.sh:223 msgid "No local changes to save" msgstr "没有要保存的本地修改" @@ -5094,6 +5249,10 @@ msgstr "不能保存索引树" msgid "Cannot unstage modified files" msgstr "无法还原修改的文件" +#: git-stash.sh:474 +msgid "Index was not unstashed." +msgstr "索引的进度没有被恢复。" + #: git-stash.sh:491 #, sh-format msgid "Dropped ${REV} ($s)" @@ -5142,6 +5301,22 @@ msgstr "版本库URL:'$repo' 必须是绝对路径或以 ./|../ 起始" msgid "'$sm_path' already exists in the index" msgstr "'$sm_path' 已经存在于索引中" +#: git-submodule.sh:270 +#, sh-format +msgid "" +"The following path is ignored by one of your .gitignore files:\n" +"$sm_path\n" +"Use -f if you really want to add it." +msgstr "" +"以下路径被您的一个 .gitignore 文件所忽略:\n" +"$sm_path\n" +"如果您确实想添加它,使用 -f 参数。" + +#: git-submodule.sh:281 +#, sh-format +msgid "Adding existing repo at '$sm_path' to the index" +msgstr "添加位于 '$sm_path' 的现存版本库到索引" + #: git-submodule.sh:283 #, sh-format msgid "'$sm_path' already exists and is not a valid git repo" @@ -5247,8 +5422,14 @@ msgid "Failed to recurse into submodule path '$sm_path'" msgstr "无法递归进子模组路径 '$sm_path'" #: git-submodule.sh:713 -msgid "--" -msgstr "--" +msgid "--cached cannot be used with --files" +msgstr "--cached 不能和 --files 共用" + +#. unexpected type +#: git-submodule.sh:753 +#, sh-format +msgid "unexpected mode $mod_dst" +msgstr "意外的模式 $mod_dst" # 译者:注意保持前导空格 #: git-submodule.sh:771 @@ -5276,19 +5457,15 @@ msgstr "blob" msgid "submodule" msgstr "子模组" +#: git-submodule.sh:840 +msgid "# Submodules changed but not updated:" +msgstr "# 子模组已修改但尚未更新:" + +#: git-submodule.sh:842 +msgid "# Submodule changes to be committed:" +msgstr "要提交的子模组变更:" + #: git-submodule.sh:974 #, sh-format msgid "Synchronizing submodule url for '$name'" msgstr "为 '$name' 同步子模组 url" - -#~ msgid "Could not extract email from committer identity." -#~ msgstr "不能从提交者身份中提取邮件地址。" - -#~ msgid "cherry-pick" -#~ msgstr "拣选" - -#~ msgid "Please enter the commit message for your changes." -#~ msgstr "请为您的修改输入提交说明。" - -#~ msgid "Too many options specified" -#~ msgstr "指定了太多的选项" @@ -544,13 +544,13 @@ static int do_plain_rerere(struct string_list *rr, int fd) if (has_rerere_resolution(name)) { if (!merge(name, path)) { - if (rerere_autoupdate) + const char *msg; + if (rerere_autoupdate) { string_list_insert(&update, path); - fprintf(stderr, - "%s '%s' using previous resolution.\n", - rerere_autoupdate - ? "Staged" : "Resolved", - path); + msg = "Staged '%s' using previous resolution.\n"; + } else + msg = "Resolved '%s' using previous resolution.\n"; + fprintf(stderr, msg, path); goto mark_resolved; } } diff --git a/revision.c b/revision.c index 935e7a7ba4..5b81a92e3a 100644 --- a/revision.c +++ b/revision.c @@ -1358,11 +1358,13 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->topo_order = 1; } else if (!strcmp(arg, "--simplify-merges")) { revs->simplify_merges = 1; + revs->topo_order = 1; revs->rewrite_parents = 1; revs->simplify_history = 0; revs->limited = 1; } else if (!strcmp(arg, "--simplify-by-decoration")) { revs->simplify_merges = 1; + revs->topo_order = 1; revs->rewrite_parents = 1; revs->simplify_history = 0; revs->simplify_by_decoration = 1; @@ -1781,7 +1783,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s * but the latter we have checked in the main loop. */ for (j = i; j < argc; j++) - verify_filename(revs->prefix, argv[j]); + verify_filename(revs->prefix, argv[j], j == i); append_prune_data(&prune_data, argv + i); break; @@ -1947,8 +1949,9 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c } /* - * Do we know what commit all of our parents should be rewritten to? - * Otherwise we are not ready to rewrite this one yet. + * Do we know what commit all of our parents that matter + * should be rewritten to? Otherwise we are not ready to + * rewrite this one yet. */ for (cnt = 0, p = commit->parents; p; p = p->next) { pst = locate_simplify_state(revs, p->item); @@ -1956,6 +1959,8 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c tail = &commit_list_insert(p->item, tail)->next; cnt++; } + if (revs->first_parent_only) + break; } if (cnt) { tail = &commit_list_insert(commit, tail)->next; @@ -1968,8 +1973,13 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c for (p = commit->parents; p; p = p->next) { pst = locate_simplify_state(revs, p->item); p->item = pst->simplified; + if (revs->first_parent_only) + break; } - cnt = remove_duplicate_parents(commit); + if (!revs->first_parent_only) + cnt = remove_duplicate_parents(commit); + else + cnt = 1; /* * It is possible that we are a merge and one side branch @@ -2013,25 +2023,31 @@ static struct commit_list **simplify_one(struct rev_info *revs, struct commit *c static void simplify_merges(struct rev_info *revs) { - struct commit_list *list; + struct commit_list *list, *next; struct commit_list *yet_to_do, **tail; + struct commit *commit; - if (!revs->topo_order) - sort_in_topological_order(&revs->commits, revs->lifo); if (!revs->prune) return; /* feed the list reversed */ yet_to_do = NULL; - for (list = revs->commits; list; list = list->next) - commit_list_insert(list->item, &yet_to_do); + for (list = revs->commits; list; list = next) { + commit = list->item; + next = list->next; + /* + * Do not free(list) here yet; the original list + * is used later in this function. + */ + commit_list_insert(commit, &yet_to_do); + } while (yet_to_do) { list = yet_to_do; yet_to_do = NULL; tail = &yet_to_do; while (list) { - struct commit *commit = list->item; - struct commit_list *next = list->next; + commit = list->item; + next = list->next; free(list); list = next; tail = simplify_one(revs, commit, tail); @@ -2043,9 +2059,10 @@ static void simplify_merges(struct rev_info *revs) revs->commits = NULL; tail = &revs->commits; while (list) { - struct commit *commit = list->item; - struct commit_list *next = list->next; struct merge_simplify_state *st; + + commit = list->item; + next = list->next; free(list); list = next; st = locate_simplify_state(revs, commit); @@ -53,11 +53,17 @@ int check_filename(const char *prefix, const char *arg) die_errno("failed to stat '%s'", arg); } -static void NORETURN die_verify_filename(const char *prefix, const char *arg) +static void NORETURN die_verify_filename(const char *prefix, + const char *arg, + int diagnose_misspelt_rev) { unsigned char sha1[20]; unsigned mode; + if (!diagnose_misspelt_rev) + die("%s: no such path in the working tree.\n" + "Use '-- <path>...' to specify paths that do not exist locally.", + arg); /* * Saying "'(icase)foo' does not exist in the index" when the * user gave us ":(icase)foo" is just stupid. A magic pathspec @@ -80,14 +86,29 @@ static void NORETURN die_verify_filename(const char *prefix, const char *arg) * as true, because even if such a filename were to exist, we want * it to be preceded by the "--" marker (or we want the user to * use a format like "./-filename") + * + * The "diagnose_misspelt_rev" is used to provide a user-friendly + * diagnosis when dying upon finding that "name" is not a pathname. + * If set to 1, the diagnosis will try to diagnose "name" as an + * invalid object name (e.g. HEAD:foo). If set to 0, the diagnosis + * will only complain about an inexisting file. + * + * This function is typically called to check that a "file or rev" + * argument is unambiguous. In this case, the caller will want + * diagnose_misspelt_rev == 1 when verifying the first non-rev + * argument (which could have been a revision), and + * diagnose_misspelt_rev == 0 for the next ones (because we already + * saw a filename, there's not ambiguity anymore). */ -void verify_filename(const char *prefix, const char *arg) +void verify_filename(const char *prefix, + const char *arg, + int diagnose_misspelt_rev) { if (*arg == '-') die("bad flag '%s' used after filename", arg); if (check_filename(prefix, arg)) return; - die_verify_filename(prefix, arg); + die_verify_filename(prefix, arg, diagnose_misspelt_rev); } /* diff --git a/sha1_name.c b/sha1_name.c index c6331136d1..5d81ea0564 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -1127,7 +1127,7 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1, if (new_filename) filename = new_filename; ret = get_tree_entry(tree_sha1, filename, sha1, &oc->mode); - if (only_to_die) { + if (ret && only_to_die) { diagnose_invalid_sha1_path(prefix, filename, tree_sha1, object_name); free(object_name); diff --git a/t/t1050-large.sh b/t/t1050-large.sh index 55ed955cef..fd10528009 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -130,10 +130,27 @@ test_expect_success 'git-show a large file' ' ' +test_expect_success 'index-pack' ' + git clone file://"`pwd`"/.git foo && + GIT_DIR=non-existent git index-pack --strict --verify foo/.git/objects/pack/*.pack +' + test_expect_success 'repack' ' git repack -ad ' +test_expect_success 'pack-objects with large loose object' ' + SHA1=`git hash-object huge` && + test_create_repo loose && + echo $SHA1 | git pack-objects --stdout | + GIT_ALLOC_LIMIT=0 GIT_DIR=loose/.git git unpack-objects && + echo $SHA1 | GIT_DIR=loose/.git git pack-objects pack && + test_create_repo packed && + mv pack-* packed/.git/objects/pack && + GIT_DIR=packed/.git git cat-file blob $SHA1 >actual && + cmp huge actual +' + test_expect_success 'tar achiving' ' git archive --format=tar HEAD >/dev/null ' diff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh index 2b962cfda7..79045abb51 100755 --- a/t/t1304-default-acl.sh +++ b/t/t1304-default-acl.sh @@ -14,16 +14,15 @@ umask 077 # We need an arbitrary other user give permission to using ACLs. root # is a good candidate: exists on all unices, and it has permission # anyway, so we don't create a security hole running the testsuite. - -setfacl_out="$(setfacl -m u:root:rwx . 2>&1)" -setfacl_ret=$? - -if test $setfacl_ret != 0 -then - say "Unable to use setfacl (output: '$setfacl_out'; return code: '$setfacl_ret')" -else - test_set_prereq SETFACL -fi +test_expect_success 'checking for a working acl setup' ' + if setfacl -m d:m:rwx -m u:root:rwx . && + getfacl . | grep user:root:rwx && + touch should-have-readable-acl && + getfacl should-have-readable-acl | egrep "mask::?rw-" + then + test_set_prereq SETFACL + fi +' if test -z "$LOGNAME" then diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh index 0843a1c13b..c5cb77a0e1 100755 --- a/t/t1506-rev-parse-diagnosis.sh +++ b/t/t1506-rev-parse-diagnosis.sh @@ -171,4 +171,15 @@ test_expect_success 'relative path when startup_info is NULL' ' grep "BUG: startup_info struct is not initialized." error ' +test_expect_success '<commit>:file correctly diagnosed after a pathname' ' + test_must_fail git rev-parse file.txt HEAD:file.txt 1>actual 2>error && + test_i18ngrep ! "exists on disk" error && + test_i18ngrep "no such path in the working tree" error && + cat >expect <<-\EOF && + file.txt + HEAD:file.txt + EOF + test_cmp expect actual +' + test_done diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh index 97f3710700..f4e6450d6a 100755 --- a/t/t3510-cherry-pick-sequence.sh +++ b/t/t3510-cherry-pick-sequence.sh @@ -31,7 +31,7 @@ test_cmp_rev () { } test_expect_success setup ' - git config advice.detachedhead false + git config advice.detachedhead false && echo unrelated >unrelated && git add unrelated && test_commit initial foo a && diff --git a/t/t4012-diff-binary.sh b/t/t4012-diff-binary.sh index 8b4e80de96..6cebb3951b 100755 --- a/t/t4012-diff-binary.sh +++ b/t/t4012-diff-binary.sh @@ -36,6 +36,18 @@ test_expect_success '"apply --stat" output for binary file change' ' test_i18ncmp expected current ' +test_expect_success 'diff --shortstat output for binary file change' ' + echo " 4 files changed, 2 insertions(+), 2 deletions(-)" >expected && + git diff --shortstat >current && + test_i18ncmp expected current +' + +test_expect_success 'diff --shortstat output for binary file change only' ' + echo " 1 file changed, 0 insertions(+), 0 deletions(-)" >expected && + git diff --shortstat -- b >current && + test_i18ncmp expected current +' + test_expect_success 'apply --numstat notices binary file change' ' git diff >diff && git apply --numstat <diff >current && diff --git a/t/t4253-am-keep-cr-dos.sh b/t/t4253-am-keep-cr-dos.sh index 735e55d77c..553fe3e88e 100755 --- a/t/t4253-am-keep-cr-dos.sh +++ b/t/t4253-am-keep-cr-dos.sh @@ -62,7 +62,7 @@ test_expect_success 'am with dos files config am.keepcr' ' git diff --exit-code master ' -test_expect_success 'am with dos files config am.keepcr overriden by --no-keep-cr' ' +test_expect_success 'am with dos files config am.keepcr overridden by --no-keep-cr' ' git config am.keepcr 1 && git checkout -b dosfiles-conf-keepcr-override initial && git format-patch -k initial..master && @@ -83,7 +83,7 @@ test_expect_success 'am with dos files with --keep-cr continue' ' git diff --exit-code master ' -test_expect_success 'am with unix files config am.keepcr overriden by --no-keep-cr' ' +test_expect_success 'am with unix files config am.keepcr overridden by --no-keep-cr' ' git config am.keepcr 1 && git checkout -b unixfiles-conf-keepcr-override initial && cp -f file1 file && diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index d9d856b87b..300ed910a5 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -418,4 +418,9 @@ test_expect_success \ 'test_must_fail git index-pack -o bad.idx test-3.pack 2>msg && grep "SHA1 COLLISION FOUND" msg' +test_expect_success \ + 'make sure index-pack detects the SHA1 collision (large blobs)' \ + 'test_must_fail git -c core.bigfilethreshold=1 index-pack -o bad.idx test-3.pack 2>msg && + grep "SHA1 COLLISION FOUND" msg' + test_done diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh index c6feca44e3..7ff6e0e16c 100755 --- a/t/t5701-clone-local.sh +++ b/t/t5701-clone-local.sh @@ -124,4 +124,14 @@ test_expect_success 'cloning non-git directory fails' ' test_must_fail git clone not-a-git-repo not-a-git-repo-clone ' +test_expect_success 'cloning file:// does not hardlink' ' + git clone --bare file://"$(pwd)"/a non-local && + ! repo_is_hardlinked non-local +' + +test_expect_success 'cloning a local path with --no-local does not hardlink' ' + git clone --bare --no-local a force-nonlocal && + ! repo_is_hardlinked force-nonlocal +' + test_done diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 9b50f54cc2..992c2a0467 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -102,8 +102,8 @@ test_expect_success '[merge] summary/log configuration' ' cat >expected <<-EOF && Merge branch ${apos}left${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: Left #5 Left #4 @@ -149,8 +149,8 @@ test_expect_success 'merge.log=3 limits shortlog length' ' cat >expected <<-EOF && Merge branch ${apos}left${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: (5 commits) Left #5 Left #4 @@ -166,8 +166,8 @@ test_expect_success 'merge.log=5 shows all 5 commits' ' cat >expected <<-EOF && Merge branch ${apos}left${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: Left #5 Left #4 @@ -190,8 +190,8 @@ test_expect_success '--log=3 limits shortlog length' ' cat >expected <<-EOF && Merge branch ${apos}left${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: (5 commits) Left #5 Left #4 @@ -207,8 +207,8 @@ test_expect_success '--log=5 shows all 5 commits' ' cat >expected <<-EOF && Merge branch ${apos}left${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: Left #5 Left #4 @@ -238,8 +238,8 @@ test_expect_success 'fmt-merge-msg -m' ' cat >expected.log <<-EOF && Sync with left - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * ${apos}left${apos} of $(pwd): Left #5 Left #4 @@ -271,8 +271,8 @@ test_expect_success 'setup: expected shortlog for two branches' ' cat >expected <<-EOF Merge branches ${apos}left${apos} and ${apos}right${apos} - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: Left #5 Left #4 @@ -396,8 +396,8 @@ test_expect_success 'merge-msg two tags' ' Common #2 Common #1 - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * tag ${apos}tag-l5${apos}: Left #5 Left #4 @@ -426,8 +426,8 @@ test_expect_success 'merge-msg tag and branch' ' Common #2 Common #1 - By Another Author (3) and A U Thor (2) - via Another Committer + # By Another Author (3) and A U Thor (2) + # Via Another Committer * left: Left #5 Left #4 diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index 2aa1824a94..c17f52e586 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -2117,7 +2117,7 @@ test_expect_success \ grep :1 git.marks' test_expect_success \ - 'R: export-marks options can be overriden by commandline options' \ + 'R: export-marks options can be overridden by commandline options' \ 'cat input | git fast-import --export-marks=other.marks && grep :1 other.marks' diff --git a/t/t9501-gitweb-standalone-http-status.sh b/t/t9501-gitweb-standalone-http-status.sh index fa2f65f6be..ef86948d21 100755 --- a/t/t9501-gitweb-standalone-http-status.sh +++ b/t/t9501-gitweb-standalone-http-status.sh @@ -12,6 +12,13 @@ code and message.' . ./gitweb-lib.sh +# +# Gitweb only provides the functionality tested by the 'modification times' +# tests if it can access a date parser from one of these modules: +# +perl -MHTTP::Date -e 0 >/dev/null 2>&1 && test_set_prereq DATE_PARSER +perl -MTime::ParseDate -e 0 >/dev/null 2>&1 && test_set_prereq DATE_PARSER + # ---------------------------------------------------------------------- # snapshot settings @@ -115,14 +122,14 @@ test_debug 'cat gitweb.output' # ---------------------------------------------------------------------- # modification times (Last-Modified and If-Modified-Since) -test_expect_success 'modification: feed last-modified' ' +test_expect_success DATE_PARSER 'modification: feed last-modified' ' gitweb_run "p=.git;a=atom;h=master" && grep "Status: 200 OK" gitweb.headers && grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: feed if-modified-since (modified)' ' +test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified)' ' export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && gitweb_run "p=.git;a=atom;h=master" && @@ -130,7 +137,7 @@ test_expect_success 'modification: feed if-modified-since (modified)' ' ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: feed if-modified-since (unmodified)' ' +test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodified)' ' export HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && gitweb_run "p=.git;a=atom;h=master" && @@ -138,14 +145,14 @@ test_expect_success 'modification: feed if-modified-since (unmodified)' ' ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: snapshot last-modified' ' +test_expect_success DATE_PARSER 'modification: snapshot last-modified' ' gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && grep "Status: 200 OK" gitweb.headers && grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: snapshot if-modified-since (modified)' ' +test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modified)' ' export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && @@ -153,7 +160,7 @@ test_expect_success 'modification: snapshot if-modified-since (modified)' ' ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: snapshot if-modified-since (unmodified)' ' +test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmodified)' ' export HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && @@ -161,7 +168,7 @@ test_expect_success 'modification: snapshot if-modified-since (unmodified)' ' ' test_debug 'cat gitweb.headers' -test_expect_success 'modification: tree snapshot' ' +test_expect_success DATE_PARSER 'modification: tree snapshot' ' ID=`git rev-parse --verify HEAD^{tree}` && export HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 9a80c60945..256e6a0b3f 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -63,7 +63,7 @@ run_completion () local _cword _words=( $1 ) (( _cword = ${#_words[@]} - 1 )) - __git_wrap_main_git && print_comp + __git_wrap__git_main && print_comp } test_completion () diff --git a/unpack-trees.c b/unpack-trees.c index ad40109432..33a581924e 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1023,6 +1023,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options o->el = ⪙ } + if (o->dir) { + o->path_exclude_check = xmalloc(sizeof(struct path_exclude_check)); + path_exclude_check_init(o->path_exclude_check, o->dir); + } memset(&o->result, 0, sizeof(o->result)); o->result.initialized = 1; o->result.timestamp.sec = o->src_index->timestamp.sec; @@ -1148,6 +1152,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options done: free_excludes(&el); + if (o->path_exclude_check) { + path_exclude_check_clear(o->path_exclude_check); + free(o->path_exclude_check); + } return ret; return_failed: @@ -1363,7 +1371,8 @@ static int check_ok_to_remove(const char *name, int len, int dtype, if (ignore_case && icase_exists(o, name, len, st)) return 0; - if (o->dir && excluded(o->dir, name, &dtype)) + if (o->dir && + path_excluded(o->path_exclude_check, name, -1, &dtype)) /* * ce->name is explicitly excluded, so it is Ok to * overwrite it. diff --git a/unpack-trees.h b/unpack-trees.h index 5e432f576e..ec74a9f19a 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -52,6 +52,7 @@ struct unpack_trees_options { const char *prefix; int cache_bottom; struct dir_struct *dir; + struct path_exclude_check *path_exclude_check; struct pathspec *pathspec; merge_fn_t fn; const char *msgs[NB_UNPACK_TREES_ERROR_TYPES]; diff --git a/version.c b/version.c new file mode 100644 index 0000000000..f98d5a654d --- /dev/null +++ b/version.c @@ -0,0 +1,17 @@ +#include "git-compat-util.h" +#include "version.h" + +const char git_version_string[] = GIT_VERSION; + +const char *git_user_agent(void) +{ + static const char *agent = NULL; + + if (!agent) { + agent = getenv("GIT_USER_AGENT"); + if (!agent) + agent = GIT_USER_AGENT; + } + + return agent; +} diff --git a/version.h b/version.h new file mode 100644 index 0000000000..fd9cdd6316 --- /dev/null +++ b/version.h @@ -0,0 +1,8 @@ +#ifndef VERSION_H +#define VERSION_H + +extern const char git_version_string[]; + +const char *git_user_agent(void); + +#endif /* VERSION_H */ |