From: Junio C Hamano Date: Thu, 15 Nov 2012 18:24:13 +0000 (-0800) Subject: Merge branch 'js/hp-nonstop' X-Git-Tag: v1.8.1-rc0~64 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1f0335a63fede94308050a70a47ab7ee92c25d95?hp=50e6af7daf88f42f146c9148df24f7824a1dffac Merge branch 'js/hp-nonstop' Finishing touches to port to HP NonStop continues. * js/hp-nonstop: fix 'make test' for HP NonStop --- diff --git a/.gitignore b/.gitignore index 68fe464090..f702415c12 100644 --- a/.gitignore +++ b/.gitignore @@ -125,6 +125,7 @@ /git-remote-fd /git-remote-ext /git-remote-testgit +/git-remote-testsvn /git-repack /git-replace /git-repo-config @@ -194,6 +195,7 @@ /test-run-command /test-sha1 /test-sigchain +/test-string-list /test-subprocess /test-svn-fe /common-cmds.h diff --git a/Documentation/Makefile b/Documentation/Makefile index cf5916fe8b..267dfe135d 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -44,9 +44,10 @@ man5dir=$(mandir)/man5 man7dir=$(mandir)/man7 # DESTDIR= -ASCIIDOC=asciidoc +ASCIIDOC = asciidoc ASCIIDOC_EXTRA = MANPAGE_XSL = manpage-normal.xsl +XMLTO = xmlto XMLTO_EXTRA = INSTALL?=install RM ?= rm -f @@ -245,7 +246,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in %.1 %.5 %.7 : %.xml manpage-base-url.xsl $(QUIET_XMLTO)$(RM) $@ && \ - xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< + $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $< %.xml : %.txt $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ diff --git a/Documentation/RelNotes/1.5.2.1.txt b/Documentation/RelNotes/1.5.2.1.txt index ebf20e22a7..d41984df0b 100644 --- a/Documentation/RelNotes/1.5.2.1.txt +++ b/Documentation/RelNotes/1.5.2.1.txt @@ -45,9 +45,3 @@ Fixes since v1.5.2 - git-fastimport --import-marks was broken; fixed. - A lot of documentation updates, clarifications and fixes. - --- -exec >/var/tmp/1 -O=v1.5.2-65-g996e2d6 -echo O=`git describe refs/heads/maint` -git shortlog --no-merges $O..refs/heads/maint diff --git a/Documentation/RelNotes/1.6.0.2.txt b/Documentation/RelNotes/1.6.0.2.txt index e1e24b3295..7d8fb85e1b 100644 --- a/Documentation/RelNotes/1.6.0.2.txt +++ b/Documentation/RelNotes/1.6.0.2.txt @@ -79,9 +79,3 @@ Fixes since v1.6.0.1 packfile. Also contains many documentation updates. - --- -exec >/var/tmp/1 -O=v1.6.0.1-78-g3632cfc -echo O=$(git describe maint) -git shortlog --no-merges $O..maint diff --git a/Documentation/RelNotes/1.6.1.3.txt b/Documentation/RelNotes/1.6.1.3.txt index 6f0bde156a..cd08d8174e 100644 --- a/Documentation/RelNotes/1.6.1.3.txt +++ b/Documentation/RelNotes/1.6.1.3.txt @@ -26,7 +26,3 @@ Fixes since v1.6.1.2 * RPM binary package installed the html manpages in a wrong place. Also includes minor documentation fixes and updates. - - --- -git shortlog --no-merges v1.6.1.2-33-gc789350.. diff --git a/Documentation/RelNotes/1.6.1.4.txt b/Documentation/RelNotes/1.6.1.4.txt index 0ce6316d75..ccbad794c0 100644 --- a/Documentation/RelNotes/1.6.1.4.txt +++ b/Documentation/RelNotes/1.6.1.4.txt @@ -39,6 +39,3 @@ Fixes since v1.6.1.3 This fix was first merged to 1.6.2.3. Also includes minor documentation fixes and updates. - --- -git shortlog --no-merges v1.6.1.3.. diff --git a/Documentation/RelNotes/1.6.1.txt b/Documentation/RelNotes/1.6.1.txt index adb7ccab0a..7b152a6fdc 100644 --- a/Documentation/RelNotes/1.6.1.txt +++ b/Documentation/RelNotes/1.6.1.txt @@ -278,9 +278,3 @@ release, unless otherwise noted. * "gitweb" did not mark non-ASCII characters imported from external HTML fragments correctly. - --- -exec >/var/tmp/1 -O=v1.6.1-rc3-74-gf66bc5f -echo O=$(git describe master) -git shortlog --no-merges $O..master ^maint diff --git a/Documentation/RelNotes/1.7.12.1.txt b/Documentation/RelNotes/1.7.12.1.txt index 671e3d2eb5..b8f04af19f 100644 --- a/Documentation/RelNotes/1.7.12.1.txt +++ b/Documentation/RelNotes/1.7.12.1.txt @@ -85,6 +85,12 @@ Fixes since v1.7.12 rely on being able to parse "ls-files -s | while read a b c..." started to fail. Protect them from such a misconfiguration. + * The attribute system may be asked for a path that itself or its + leading directories no longer exists in the working tree, and it is + fine if we cannot open .gitattribute file in such a case. Failure + to open per-directory .gitattributes with error status other than + ENOENT and ENOTDIR should be diagnosed, but it wasn't. + * After "gitk" showed the contents of a tag, neither "Reread references" nor "Reload" did not update what is shown as the contents of it, when the user overwrote the tag with "git tag -f". @@ -92,6 +98,9 @@ Fixes since v1.7.12 * "ciabot" script (in contrib/) has been updated with extensive documentation. + * "git-jump" script (in contrib/) did not work well when + diff.noprefix or diff.mnemonicprefix is in effect. + * Older parts of the documentation described as if having a regular file in .git/refs/ hierarchy were the only way to have branches and tags, which is not true for quite some time. @@ -121,3 +130,5 @@ Fixes since v1.7.12 branch name is a parameter to the option, but the heading for the option description was "-B::", not "-B branch::", making the documentation misleading. + +Also contains numerous documentation updates. diff --git a/Documentation/RelNotes/1.7.12.2.txt b/Documentation/RelNotes/1.7.12.2.txt new file mode 100644 index 0000000000..69255745e6 --- /dev/null +++ b/Documentation/RelNotes/1.7.12.2.txt @@ -0,0 +1,40 @@ +Git 1.7.12.2 Release Notes +========================== + +Fixes since v1.7.12.1 +--------------------- + + * When "git am" is fed an input that has multiple "Content-type: ..." + header, it did not grok charset= attribute correctly. + + * Even during a conflicted merge, "git blame $path" always meant to + blame uncommitted changes to the "working tree" version; make it + more useful by showing cleanly merged parts as coming from the other + branch that is being merged. + + * "git blame MAKEFILE" run in a history that has "Makefile" but not + "MAKEFILE" should say "No such file MAKEFILE in HEAD", but got + confused on a case insensitive filesystem and failed to do so. + + * "git fetch --all", when passed "--no-tags", did not honor the + "--no-tags" option while fetching from individual remotes (the same + issue existed with "--tags", but combination "--all --tags" makes + much less sense than "--all --no-tags"). + + * "git log/diff/format-patch --stat" showed the "N line(s) added" + comment in user's locale and caused careless submitters to send + patches with such a line in them to projects whose project language + is not their language, mildly irritating others. Localization to + the line has been disabled for now. + + * "git log --all-match --grep=A --grep=B" ought to show commits that + mention both A and B, but when these three options are used with + --author or --committer, it showed commits that mention either A or + B (or both) instead. + + * The subcommand to remove the definition of a remote in "git remote" + was named "rm" even though all other subcommands were spelled out. + Introduce "git remote remove" to remove confusion, and keep "rm" as + a backward compatible synonym. + +Also contains a handful of documentation updates. diff --git a/Documentation/RelNotes/1.7.12.3.txt b/Documentation/RelNotes/1.7.12.3.txt new file mode 100644 index 0000000000..ecda427a35 --- /dev/null +++ b/Documentation/RelNotes/1.7.12.3.txt @@ -0,0 +1,34 @@ +Git 1.7.12.3 Release Notes +========================== + +Fixes since v1.7.12.2 +--------------------- + + * "git am" mishandled a patch attached as application/octet-stream + (e.g. not text/*); Content-Transfer-Encoding (e.g. base64) was not + honored correctly. + + * It was unclear in the documentation for "git blame" that it is + unnecessary for users to use the "--follow" option. + + * A repository created with "git clone --single" had its fetch + refspecs set up just like a clone without "--single", leading the + subsequent "git fetch" to slurp all the other branches, defeating + the whole point of specifying "only this branch". + + * "git fetch" over http had an old workaround for an unlikely server + misconfiguration; it turns out that this hurts debuggability of the + configuration in general, and has been reverted. + + * "git fetch" over http advertised that it supports "deflate", which + is much less common, and did not advertise the more common "gzip" on + its Accept-Encoding header. + + * "git receive-pack" (the counterpart to "git push") did not give + progress output while processing objects it received to the puser + when run over the smart-http protocol. + + * "git status" honored the ignore=dirty settings in .gitmodules but + "git commit" didn't. + +Also contains a handful of documentation updates. diff --git a/Documentation/RelNotes/1.7.12.4.txt b/Documentation/RelNotes/1.7.12.4.txt new file mode 100644 index 0000000000..c6da3cc939 --- /dev/null +++ b/Documentation/RelNotes/1.7.12.4.txt @@ -0,0 +1,23 @@ +Git 1.7.12.4 Release Notes +========================== + +Fixes since v1.7.12.3 +--------------------- + + * "git fetch" over the dumb-http revision walker could segfault when + curl's multi interface was used. + + * It was possible to give specific paths for "asciidoc" and other + tools in the documentation toolchain, but not for "xmlto". + + * "gitweb" did not give the correct committer timezone in its feed + output due to a typo. + + * The "-Xours" (and similarly -Xtheirs) backend option to "git + merge -s recursive" was ignored for binary files. Now it is + honored. + + * The "binary" synthetic attribute made "diff" to treat the path as + binary, but not "merge". + +Also contains many documentation updates. diff --git a/Documentation/RelNotes/1.8.0.txt b/Documentation/RelNotes/1.8.0.txt index 90c4f4795f..43883c14f0 100644 --- a/Documentation/RelNotes/1.8.0.txt +++ b/Documentation/RelNotes/1.8.0.txt @@ -4,16 +4,18 @@ Git v1.8.0 Release Notes Backward compatibility notes ---------------------------- -In the next major release, we will change the behaviour of the "git -push" command. When "git push [$there]" does not say what to push, we -have used the traditional "matching" semantics (all your branches were -sent to the remote as long as there already are branches of the same -name over there). We will use the "simple" semantics, that pushes the -current branch to the branch with the same name only when the current +In the next major release (not *this* one), we will change the +behavior of the "git push" command. + +When "git push [$there]" does not say what to push, we have used the +traditional "matching" semantics so far (all your branches were sent +to the remote as long as there already are branches of the same name +over there). We will use the "simple" semantics that pushes the +current branch to the branch with the same name, only when the current branch is set to integrate with that remote branch. There is a user preference configuration variable "push.default" to change this, and "git push" will warn about the upcoming change until you set this -variable. +variable in this release. "git branch --set-upstream" is deprecated and may be removed in a relatively distant future. "git branch [-u|--set-upstream-to]" has @@ -28,12 +30,14 @@ UI, Workflows & Features * A credential helper for Win32 to allow access to the keychain of the logged-in user has been added. + * An initial port to HP NonStop. + * A credential helper to allow access to the Gnome keyring has been added. - * When "git am" sanitizes the Subject: line, we strip the prefix from + * When "git am" sanitizes the "Subject:" line, we strip the prefix from "Re: subject" and also from a less common "re: subject", but left - even less common "RE: subject" intact. + the even less common "RE: subject" intact. Now we strip that too. * It was tempting to say "git branch --set-upstream origin/master", but that tells Git to arrange the local branch "origin/master" to @@ -45,43 +49,64 @@ UI, Workflows & Features * "git cherry-pick" learned the "--allow-empty-message" option to allow it to replay a commit without any log message. + * After "git cherry-pick -s" gave control back to the user asking + help to resolve conflicts, concluding "git commit" used to need to + be run with "-s" if the user wants to sign it off; now the command + leaves the sign-off line in the log template. + * "git daemon" learned the "--access-hook" option to allow an external command to decline service based on the client address, repository path, etc. * "git difftool --dir-diff" learned to use symbolic links to prepare - temporary copy of the working tree when available. + a temporary copy of the working tree when available. * "git grep" learned to use a non-standard pattern type by default if a configuration variable tells it to. - * "git merge-base" learned "--is-ancestor A B" option to tell if A is + * Accumulated updates to "git gui" has been merged. + + * "git log -g" learned the "--grep-reflog=" option to limit + its output to commits with a reflog message that matches the given + pattern. + + * "git merge-base" learned the "--is-ancestor A B" option to tell if A is an ancestor of B. The result is indicated by its exit status code. - * The "-Xours" backend option to "git merge -s recursive" now takes - effect even on binary files. + * "git mergetool" now allows users to override the actual command used + with the mergetool.$name.cmd configuration variable even for built-in + mergetool backends. + + * "git rebase -i" learned the "--edit-todo" option to open an editor + to edit the instruction sheet. Foreign Interface * "git svn" has been updated to work with SVN 1.7. + * "git p4" learned the "--conflicts" option to specify what to do when + encountering a conflict during "p4 submit". + -Performance, Internal Implementation, etc. (please report possible regressions) +Performance, Internal Implementation, etc. * Git ships with a fall-back regexp implementation for platforms with buggy regexp library, but it was easy for people to keep using their - platform regexp. A new test has been added to check this. + platform regexp by mistake. A new test has been added to check this. * The "check-docs" build target has been updated and greatly simplified. + * The test suite is run under MALLOC_CHECK_ when running with a glibc + that supports the feature. + * The documentation in the TeXinfo format was using indented output for materials meant to be examples that are better typeset in monospace. * Compatibility wrapper around some mkdir(2) implementations that - reject parameter with trailing slash has been introduced. + reject parameters with trailing slash has been introduced. * Compatibility wrapper for systems that lack usable setitimer() has been added. @@ -93,7 +118,7 @@ Performance, Internal Implementation, etc. (please report possible regressions) when the user says "git checkout -b -t foo bar" (e.g. "-t" is not a good name for a branch). - * Many internal uses of "git merge-base" equivalent were only to see + * Many internal uses of a "git merge-base" equivalent were only to see if one commit fast-forwards to the other, which did not need the full set of merge bases to be computed. They have been updated to use less expensive checks. @@ -116,55 +141,127 @@ Unless otherwise noted, all the fixes since v1.7.12 in the maintenance track are contained in this release (see release notes to them for details). - * "git fetch --all", when passed "--no-tags", did not honor the - "--no-tags" option while fetching from individual remotes (the same - issue existed with "--tags", but combination "--all --tags" makes - much less sense than "--all --no-tags"). - (merge 8556646 dj/fetch-all-tags later to maint). + * The attribute system may be asked for a path that itself or its + leading directories no longer exists in the working tree, and it is + fine if we cannot open .gitattribute file in such a case. Failure + to open per-directory .gitattributes with error status other than + ENOENT and ENOTDIR should be diagnosed, but it wasn't. - * The subcommand in "git remote" to remove a defined remote was - "rm" and the command did not take a fully-spelled "remove". - (merge e17dba8 nd/maint-remote-remove later to maint). + * When looking for $HOME/.gitconfig etc., it is OK if we cannot read + them because they do not exist, but we did not diagnose existing + files that we cannot read. - * After "gitk" showed the contents of a tag, neither "Reread - references" nor "Reload" did not update what is shown as the - contents of it, when the user overwrote the tag with "git tag -f". + * When "git am" is fed an input that has multiple "Content-type: ..." + header, it did not grok charset= attribute correctly. - * "git cvsimport" did not thoroughly cleanse tag names that it - inferred from the names of the tags it obtained from CVS, which - caused "git tag" to barf and stop the import in the middle. + * "git am" mishandled a patch attached as application/octet-stream + (e.g. not text/*); Content-Transfer-Encoding (e.g. base64) was not + honored correctly. - * "git show --format='%ci'" did not give timestamp correctly for - commits created without human readable name on "committer" line. - (merge e27ddb6 jc/maint-ident-missing-human-name later to maint). + * "git blame MAKEFILE" run in a history that has "Makefile" but not + "MAKEFILE" should say "No such file MAKEFILE in HEAD", but got + confused on a case insensitive filesystem and failed to do so. + + * Even during a conflicted merge, "git blame $path" always meant to + blame uncommitted changes to the "working tree" version; make it + more useful by showing cleanly merged parts as coming from the other + branch that is being merged. + + * It was unclear in the documentation for "git blame" that it is + unnecessary for users to use the "--follow" option. + + * Output from "git branch -v" contains "(no branch)" that could be + localized, but the code to align it along with the names of + branches was counting in bytes, not in display columns. * "git cherry-pick A C B" used to replay changes in A and then B and then C if these three commits had committer timestamps in that order, which is not what the user who said "A C B" naturally expects. - (merge a73e22e mz/cherry-pick-cmdline-order later to maint). - * "git show --quiet" ought to be a synonym for "git show -s", but - wasn't. - (merge f9c75d8 jk/maint-quiet-is-synonym-to-s-in-log later to maint). + * A repository created with "git clone --single" had its fetch + refspecs set up just like a clone without "--single", leading the + subsequent "git fetch" to slurp all the other branches, defeating + the whole point of specifying "only this branch". + + * Documentation talked about "first line of commit log" when it meant + the title of the commit. The description was clarified by defining + how the title is decided and rewording the casual mention of "first + line" to "title". + + * "git cvsimport" did not thoroughly cleanse tag names that it + inferred from the names of the tags it obtained from CVS, which + caused "git tag" to barf and stop the import in the middle. + + * Earlier we made the diffstat summary line that shows the number of + lines added/deleted localizable, but it was found irritating having + to see them in various languages on a list whose discussion language + is English, and this change has been reverted. + + * "git fetch --all", when passed "--no-tags", did not honor the + "--no-tags" option while fetching from individual remotes (the same + issue existed with "--tags", but the combination "--all --tags" makes + much less sense than "--all --no-tags"). + + * "git fetch" over http had an old workaround for an unlikely server + misconfiguration; it turns out that this hurts debuggability of the + configuration in general, and has been reverted. + + * "git fetch" over http advertised that it supports "deflate", which + is much less common, and did not advertise the more common "gzip" on + its Accept-Encoding header. + + * "git fetch" over the dumb-http revision walker could segfault when + curl's multi interface was used. + + * "git gc --auto" notified the user that auto-packing has triggered + even under the "--quiet" option. + + * After "gitk" showed the contents of a tag, neither "Reread + references" nor "Reload" updated what is shown as the + contents of it when the user overwrote the tag with "git tag -f". + + * "git log --all-match --grep=A --grep=B" ought to show commits that + mention both A and B, but when these three options are used with + --author or --committer, it showed commits that mention either A or + B (or both) instead. + + * The "-Xours" backend option to "git merge -s recursive" was ignored + for binary files. * "git p4", when "--use-client-spec" and "--detect-branches" are used together, misdetected branches. - (merge 21ef5df pw/p4-use-client-spec-branch-detection later to maint). - * Output from "git branch -v" contains "(no branch)" that could be - localized, but the code to align it along with the names of - branches were counting in bytes, not in display columns. - (merge 1452bd6 nd/branch-v-alignment later to maint). + * "git receive-pack" (the counterpart to "git push") did not give + progress output while processing objects it received to the puser + when run over the smart-http protocol. - * When looking for $HOME/.gitconfig etc., it is OK if we cannot read - them because they do not exist, but we did not diagnose existing - files that we cannot read. + * When you misspell the command name you give to the "exec" action in + the "git rebase -i" instruction sheet you were told that 'rebase' is not a + git subcommand from "git rebase --continue". + + * The subcommand in "git remote" to remove a defined remote was + "rm" and the command did not take a fully-spelled "remove". - * The interactive prompt "git send-email" gives was error prone. It + * The interactive prompt that "git send-email" gives was error prone. It asked "What e-mail address do you want to use?" with the address it guessed (correctly) the user would want to use in its prompt, tempting the user to say "y". But the response was taken as "No, please use 'y' as the e-mail address instead", which is most certainly not what the user meant. - (merge 6183749 sb/send-email-reconfirm-fix later to maint). + + * "git show --format='%ci'" did not give the timestamp correctly for + commits created without human readable name on the "committer" line. + + * "git show --quiet" ought to be a synonym for "git show -s", but + wasn't. + + * "git submodule frotz" was not diagnosed as "frotz" being an unknown + subcommand to "git submodule"; the user instead got a complaint + that "git submodule status" was run with an unknown path "frotz". + + * "git status" honored the ignore=dirty settings in .gitmodules but + "git commit" didn't. + + * "gitweb" did not give the correct committer timezone in its feed + output due to a typo. diff --git a/Documentation/config.txt b/Documentation/config.txt index 6416cae511..9a0544cf1f 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -538,14 +538,14 @@ core.pager:: `LESS` variable to some other value. Alternately, these settings can be overridden on a project or global basis by setting the `core.pager` option. - Setting `core.pager` has no affect on the `LESS` + Setting `core.pager` has no effect on the `LESS` environment variable behaviour above, so if you want to override git's default settings this way, you need to be explicit. For example, to disable the S option in a backward compatible manner, set `core.pager` - to `less -+$LESS -FRX`. This will be passed to the - shell by git, which will translate the final command to - `LESS=FRSX less -+FRSX -FRX`. + to `less -+S`. This will be passed to the shell by + git, which will translate the final command to + `LESS=FRSX less -+S`. core.whitespace:: A comma separated list of common whitespace problems to @@ -559,8 +559,9 @@ core.whitespace:: * `space-before-tab` treats a space character that appears immediately before a tab character in the initial indent part of the line as an error (enabled by default). -* `indent-with-non-tab` treats a line that is indented with 8 or more - space characters as an error (not enabled by default). +* `indent-with-non-tab` treats a line that is indented with space + characters instead of the equivalent tabs as an error (not enabled by + default). * `tab-in-indent` treats a tab character in the initial indent part of the line as an error (not enabled by default). * `blank-at-eof` treats blank lines added at the end of file as an error diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt index 67a90a828c..75ab8a51ca 100644 --- a/Documentation/diff-config.txt +++ b/Documentation/diff-config.txt @@ -56,6 +56,10 @@ diff.statGraphWidth:: Limit the width of the graph part in --stat output. If set, applies to all commands generating --stat output except format-patch. +diff.context:: + Generate diffs with lines of context instead of the default of + 3. This value is overridden by the -U option. + diff.external:: If this config variable is set, diff generation is not performed using the internal diff machinery, but using the diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 39d326abc6..b4d6476ac8 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -10,7 +10,8 @@ --depth=:: Deepen the history of a 'shallow' repository created by `git clone` with `--depth=` option (see linkgit:git-clone[1]) - by the specified number of commits. + to the specified number of commits from the tip of each remote + branch history. Tags for the deepened commits are not fetched. ifndef::git-pull[] --dry-run:: diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 9c1d395722..fd9e36b99f 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -155,7 +155,7 @@ Configuration The optional configuration variable `core.excludesfile` indicates a path to a file containing patterns of file names to exclude from git-add, similar to $GIT_DIR/info/exclude. Patterns in the exclude file are used in addition to -those in info/exclude. See linkgit:gitrepository-layout[5]. +those in info/exclude. See linkgit:gitignore[5]. EXAMPLES diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index 7ee923629e..e44173f66a 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -20,6 +20,12 @@ last modified the line. Optionally, start annotating from the given revision. The command can also limit the range of lines annotated. +The origin of lines is automatically followed across whole-file +renames (currently there is no option to turn the rename-following +off). To follow lines moved from one file to another, or to follow +lines that were copied and pasted from another file, etc., see the +`-C` and `-M` options. + The report does not tell you anything about lines which have been deleted or replaced; you need to use a tool such as 'git diff' or the "pickaxe" interface briefly mentioned in the following paragraph. diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 9c1d2f1781..45a225e0aa 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -131,11 +131,13 @@ This option is only applicable in non-verbose mode. use `git branch --list ` to list matching branches. -v:: +-vv:: --verbose:: When in list mode, show sha1 and commit subject line for each head, along with relationship to upstream branch (if any). If given twice, print - the name of the upstream branch, as well. + the name of the upstream branch, as well (see also `git remote + show `). -q:: --quiet:: diff --git a/Documentation/git-clean.txt b/Documentation/git-clean.txt index 79fb984144..9f42c0d0e6 100644 --- a/Documentation/git-clean.txt +++ b/Documentation/git-clean.txt @@ -63,6 +63,10 @@ OPTIONS Remove only files ignored by git. This may be useful to rebuild everything from scratch, but keep manually created files. +SEE ALSO +-------- +linkgit:gitignore[5] + GIT --- Part of the linkgit:git[1] suite diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index c1ddd4c2cc..7fefdb0384 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -29,7 +29,8 @@ currently active branch. After the clone, a plain `git fetch` without arguments will update all the remote-tracking branches, and a `git pull` without arguments will in addition merge the remote master branch into the -current master branch, if any. +current master branch, if any (this is untrue when "--single-branch" +is given; see below). This default configuration is achieved by creating references to the remote branch heads under `refs/remotes/origin` and @@ -152,9 +153,10 @@ objects from the source repository into a pack in the cloned repository. -b :: Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to `` branch - instead. `--branch` can also take tags and treat them like - detached HEAD. In a non-bare repository, this is the branch - that will be checked out. + instead. In a non-bare repository, this is the branch that will + be checked out. + `--branch` can also take tags and detaches the HEAD at that commit + in the resulting repository. --upload-pack :: -u :: @@ -193,6 +195,11 @@ objects from the source repository into a pack in the cloned repository. clone with the `--depth` option, this is the default, unless `--no-single-branch` is given to fetch the histories near the tips of all branches. + Further fetches into the resulting repository will only update the + remote-tracking branch for the branch this option was used for the + initial cloning. If the HEAD at the remote did not point at any + branch when `--single-branch` clone was made, no remote-tracking + branch is created. --recursive:: --recurse-submodules:: diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt index 4622297ec9..0295890621 100644 --- a/Documentation/git-commit.txt +++ b/Documentation/git-commit.txt @@ -13,7 +13,7 @@ SYNOPSIS [-F | -m ] [--reset-author] [--allow-empty] [--allow-empty-message] [--no-verify] [-e] [--author=] [--date=] [--cleanup=] [--status | --no-status] - [-i | -o] [--] [...] + [-i | -o] [-S[]] [--] [...] DESCRIPTION ----------- @@ -109,6 +109,10 @@ OPTIONS format. See linkgit:git-status[1] for details. Implies `--dry-run`. +--long:: + When doing a dry-run, give the output in a the long-format. + Implies `--dry-run`. + -z:: --null:: When showing `short` or `porcelain` status output, terminate @@ -276,6 +280,10 @@ configuration variable documented in linkgit:git-config[1]. commit message template when using an editor to prepare the default commit message. +-S[]:: +--gpg-sign[=]:: + GPG-sign commit. + \--:: Do not interpret any more arguments as options. @@ -389,8 +397,10 @@ DISCUSSION Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. -Tools that turn commits into email, for example, use the first line -on the Subject: line and the rest of the commit in the body. +The text up to the first blank line in a commit message is treated +as the commit title, and that title is used throughout git. +For example, linkgit:git-format-patch[1] turns a commit into email, and it uses +the title on the Subject line and the rest of the commit in the body. include::i18n.txt[] diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index 6695ab3b4b..98d9881d7e 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -137,17 +137,19 @@ This option can be used several times to provide several detection regexes. -A :: CVS by default uses the Unix username when writing its commit logs. Using this option and an author-conv-file - in this format + maps the name recorded in CVS to author name, e-mail and + optional timezone: + --------- exon=Andreas Ericsson - spawn=Simon Pawn + spawn=Simon Pawn America/Chicago --------- + 'git cvsimport' will make it appear as those authors had their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly -all along. +all along. If a timezone is specified, GIT_AUTHOR_DATE will +have the corresponding offset applied. + For convenience, this data is saved to `$GIT_DIR/cvs-authors` each time the '-A' option is provided and read from that same diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index 2620d28b4b..6603a7ab73 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -39,6 +39,10 @@ OPTIONS See ``Date Formats'' below for details about which formats are supported, and their syntax. +-- done:: + Terminate with error if there is no 'done' command at the + end of the stream. + --force:: Force updating modified existing branches, even if doing so would cause commits to be lost (as the new commit does @@ -1047,7 +1051,9 @@ done:: Error out if the stream ends without a 'done' command. Without this feature, errors causing the frontend to end abruptly at a convenient point in the stream can go - undetected. + undetected. This may occur, for example, if an import + front end dies in mid-operation without emitting SIGTERM + or SIGKILL at its subordinate git fast-import instance. `option` ~~~~~~~~ diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 15e7ac80c0..e2301f5c01 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -304,6 +304,11 @@ committed a merge between P1 and P2, it will be propagated properly and all children of the merge will become merge commits with P1,P2 as their parents instead of the merge commit. +*NOTE* the changes introduced by the commits, and which are not reverted +by subsequent commits, will still be in the rewritten branch. If you want +to throw out _changes_ together with the commits, you should use the +interactive mode of 'git rebase'. + You can rewrite the commit log messages using `--msg-filter`. For example, 'git svn-id' strings in a repository created by 'git svn' can be removed this way: @@ -314,11 +319,6 @@ git filter-branch --msg-filter ' ' ------------------------------------------------------- -To restrict rewriting to only part of the history, specify a revision -range in addition to the new branch name. The new branch name will -point to the top-most revision that a 'git rev-list' of this range -will print. - If you need to add 'Acked-by' lines to, say, the last 10 commits (none of which is a merge), use this command: @@ -329,11 +329,10 @@ git filter-branch --msg-filter ' ' HEAD~10..HEAD -------------------------------------------------------- -*NOTE* the changes introduced by the commits, and which are not reverted -by subsequent commits, will still be in the rewritten branch. If you want -to throw out _changes_ together with the commits, you should use the -interactive mode of 'git rebase'. - +To restrict rewriting to only part of the history, specify a revision +range in addition to the new branch name. The new branch name will +point to the top-most revision that a 'git rev-list' of this range +will print. Consider this history: diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt index c872b883ba..db55a4e0bb 100644 --- a/Documentation/git-for-each-ref.txt +++ b/Documentation/git-for-each-ref.txt @@ -102,9 +102,10 @@ Fields that have name-email-date tuple as its value (`author`, and `date` to extract the named component. The complete message in a commit and tag object is `contents`. -Its first line is `contents:subject`, the remaining lines -are `contents:body` and the optional GPG signature -is `contents:signature`. +Its first line is `contents:subject`, where subject is the concatenation +of all lines of the commit message up to the first blank line. The next +line is 'contents:body', where body is all of the lines after the first +blank line. Finally, the optional GPG signature is `contents:signature`. For sorting purposes, fields with numeric values sort in numeric order (`objectsize`, `authordate`, `committerdate`, `taggerdate`). diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 04c7346e3e..6d43f56279 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -58,10 +58,13 @@ output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in . Otherwise they are created in the current working directory. -By default, the subject of a single patch is "[PATCH] First Line" and -the subject when multiple patches are output is "[PATCH n/m] First -Line". To force 1/1 to be added for a single patch, use `-n`. To omit -patch numbers from the subject, use `-N`. +By default, the subject of a single patch is "[PATCH] " followed by +the concatenation of lines from the commit message up to the first blank +line (see the DISCUSSION section of linkgit:git-commit[1]). + +When multiple patches are output, the subject prefix will instead be +"[PATCH n/m] ". To force 1/1 to be added for a single patch, use `-n`. +To omit patch numbers from the subject, use `-N`. If given `--thread`, `git-format-patch` will generate `In-Reply-To` and `References` headers to make the second and subsequent patch mails appear diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 20f9228511..d34ea3c50b 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -99,7 +99,7 @@ commit or stash your changes before running 'git merge'. more than two parents (affectionately called an Octopus merge). + If no commit is given from the command line, and if `merge.defaultToUpstream` -configuration variable is set, merge the remote tracking branches +configuration variable is set, merge the remote-tracking branches that the current branch is configured to use as its upstream. See also the configuration section of this manual page. diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index 8228f33e3f..beff6229c8 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -163,7 +163,7 @@ All commands except clone accept these options. --git-dir :: Set the 'GIT_DIR' environment variable. See linkgit:git[1]. ---verbose:: +--verbose, -v:: Provide more progress information. Sync options @@ -269,6 +269,24 @@ These options can be used to modify 'git p4 submit' behavior. Export tags from git as p4 labels. Tags found in git are applied to the perforce working directory. +--dry-run, -n:: + Show just what commits would be submitted to p4; do not change + state in git or p4. + +--prepare-p4-only:: + Apply a commit to the p4 workspace, opening, adding and deleting + files in p4 as for a normal submit operation. Do not issue the + final "p4 submit", but instead print a message about how to + submit manually or revert. This option always stops after the + first (oldest) commit. Git tags are not exported to p4. + +--conflict=(ask|skip|quit):: + Conflicts can occur when applying a commit to p4. When this + happens, the default behavior ("ask") is to prompt whether to + skip this commit and continue, or quit. This option can be used + to bypass the prompt, causing conflicting commits to be automatically + skipped, or to quit trying to apply commits, without prompting. + Rebase options ~~~~~~~~~~~~~~ These options can be used to modify 'git p4 rebase' behavior. @@ -519,6 +537,10 @@ git-p4.labelExportRegexp:: Only p4 labels matching this regular expression will be exported. The default value is '[a-zA-Z0-9_\-.]+$'. +git-p4.conflict:: + Specify submit behavior when a conflict with p4 is found, as per + --conflict. The default behavior is 'ask'. + IMPLEMENTATION DETAILS ---------------------- * Changesets from p4 are imported using git fast-import. diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index cb97cc1c3b..fe46c4258a 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -37,7 +37,9 @@ OPTIONS[[OPTIONS]] `+`, followed by the source ref , followed by a colon `:`, followed by the destination ref . It is used to specify with what object the ref - in the remote repository is to be updated. + in the remote repository is to be updated. If not specified, + the behavior of the command is controlled by the `push.default` + configuration variable. + The is often the name of the branch you would want to push, but it can be any arbitrary "SHA-1 expression", such as `master~4` or @@ -65,7 +67,8 @@ directs git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side. This is the default operation mode if no explicit refspec is found (that is neither on the command line -nor in any Push line of the corresponding remotes file---see below). +nor in any Push line of the corresponding remotes file---see below) and +no `push.default` configuration variable is set. --all:: Instead of naming each ref to push, specifies that all @@ -172,7 +175,7 @@ useful if you write an alias or script around 'git push'. --recurse-submodules=check|on-demand:: Make sure all submodule commits used by the revisions to be - pushed are available on a remote tracking branch. If 'check' is + pushed are available on a remote-tracking branch. If 'check' is used git will verify that all submodule commits that changed in the revisions to be pushed are available on at least one remote of the submodule. If any commits are missing the push will be @@ -357,7 +360,8 @@ Examples `git push origin :`. + The default behavior of this command when no is given can be -configured by setting the `push` option of the remote. +configured by setting the `push` option of the remote, or the `push.default` +configuration variable. + For example, to default to pushing only the current branch to `origin` use `git config remote.origin.push HEAD`. Any valid (like diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index fd535b06ab..da067ecafa 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -12,7 +12,7 @@ SYNOPSIS [] [] 'git rebase' [-i | --interactive] [options] [--exec ] [--onto ] --root [] -'git rebase' --continue | --skip | --abort +'git rebase' --continue | --skip | --abort | --edit-todo DESCRIPTION ----------- @@ -245,6 +245,9 @@ leave out at most one of A and B, in which case it defaults to HEAD. --skip:: Restart the rebasing process by skipping the current patch. +--edit-todo:: + Edit the todo list during an interactive rebase. + -m:: --merge:: Use merging strategies to rebase. When the recursive (default) merge diff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt index f5836e46d0..5ce4cda8e7 100644 --- a/Documentation/git-remote-helpers.txt +++ b/Documentation/git-remote-helpers.txt @@ -98,6 +98,20 @@ advertised with this capability must cover all refs reported by the list command. If no 'refspec' capability is advertised, there is an implied `refspec *:*`. +'bidi-import':: + The fast-import commands 'cat-blob' and 'ls' can be used by remote-helpers + to retrieve information about blobs and trees that already exist in + fast-import's memory. This requires a channel from fast-import to the + remote-helper. + If it is advertised in addition to "import", git establishes a pipe from + fast-import to the remote-helper's stdin. + It follows that git and fast-import are both connected to the + remote-helper's stdin. Because git can send multiple commands to + the remote-helper it is required that helpers that use 'bidi-import' + buffer all 'import' commands of a batch before sending data to fast-import. + This is to prevent mixing commands and fast-import responses on the + helper's stdin. + Capabilities for Pushing ~~~~~~~~~~~~~~~~~~~~~~~~ 'connect':: @@ -286,7 +300,12 @@ terminated with a blank line. For each batch of 'import', the remote helper should produce a fast-import stream terminated by a 'done' command. + -Supported if the helper has the "import" capability. +Note that if the 'bidi-import' capability is used the complete batch +sequence has to be buffered before starting to send data to fast-import +to prevent mixing of commands and fast-import responses on the helper's +stdin. ++ +Supported if the helper has the 'import' capability. 'connect' :: Connects to given service. Standard input and standard output diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 117e3743a6..978d8da50c 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git reset' [-q] [] [--] ... 'git reset' (--patch | -p) [] [--] [...] -'git reset' (--soft | --mixed | --hard | --merge | --keep) [-q] [] +'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [] DESCRIPTION ----------- @@ -43,11 +43,11 @@ This means that `git reset -p` is the opposite of `git add -p`, i.e. you can use it to selectively reset hunks. See the ``Interactive Mode'' section of linkgit:git-add[1] to learn how to operate the `--patch` mode. -'git reset' -- []:: +'git reset' [] []:: This form resets the current branch head to and possibly updates the index (resetting it to the tree of ) and - the working tree depending on , which - must be one of the following: + the working tree depending on . If is omitted, + defaults to "--mixed". The must be one of the following: + -- --soft:: diff --git a/Documentation/git-rm.txt b/Documentation/git-rm.txt index 5d31860eb1..882cb1171b 100644 --- a/Documentation/git-rm.txt +++ b/Documentation/git-rm.txt @@ -107,6 +107,21 @@ as well as modifications of existing paths. Typically you would first remove all tracked files from the working tree using this command: +Submodules +~~~~~~~~~~ +Only submodules using a gitfile (which means they were cloned +with a git version 1.7.8 or newer) will be removed from the work +tree, as their repository lives inside the .git directory of the +superproject. If a submodule (or one of those nested inside it) +still uses a .git directory, `git rm` will fail - no matter if forced +or not - to protect the submodule's history. + +A submodule is considered up-to-date when the HEAD is the same as +recorded in the index, no tracked files are modified and no untracked +files that aren't ignored are present in the submodules work tree. +Ignored files are deemed expendable and won't stop a submodule's work +tree from being removed. + ---------------- git ls-files -z | xargs -0 rm -f ---------------- diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 324117072d..eeb561cf14 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -126,6 +126,10 @@ The --to option must be repeated for each user you want on the to list. + Note that no attempts whatsoever are made to validate the encoding. +--compose-encoding=:: + Specify encoding of compose message. Default is the value of the + 'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed. + Sending ~~~~~~~ diff --git a/Documentation/git-shortlog.txt b/Documentation/git-shortlog.txt index 01d8417316..afeb4cdf16 100644 --- a/Documentation/git-shortlog.txt +++ b/Documentation/git-shortlog.txt @@ -14,8 +14,7 @@ git log --pretty=short | 'git shortlog' [-h] [-n] [-s] [-e] [-w] DESCRIPTION ----------- Summarizes 'git log' output in a format suitable for inclusion -in release announcements. Each commit will be grouped by author and -the first line of the commit message will be shown. +in release announcements. Each commit will be grouped by author and title. Additionally, "[PATCH]" will be stripped from the commit description. diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt index 67e5f53a9e..9f1ef9a463 100644 --- a/Documentation/git-status.txt +++ b/Documentation/git-status.txt @@ -38,6 +38,9 @@ OPTIONS across git versions and regardless of user configuration. See below for details. +--long:: + Give the output in the long-format. This is the default. + -u[]:: --untracked-files[=]:: Show untracked files. diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 2de7bf0900..1d6527ab9f 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -9,7 +9,7 @@ git-submodule - Initialize, update or inspect submodules SYNOPSIS -------- [verse] -'git submodule' [--quiet] add [-b branch] [-f|--force] +'git submodule' [--quiet] add [-b branch] [-f|--force] [--name ] [--reference ] [--] [] 'git submodule' [--quiet] status [--cached] [--recursive] [--] [...] 'git submodule' [--quiet] init [--] [...] @@ -112,7 +112,6 @@ status:: initialized, `+` if the currently checked out submodule commit does not match the SHA-1 found in the index of the containing repository and `U` if the submodule has merge conflicts. - This command is the default command for 'git submodule'. + If `--recursive` is specified, this command will recurse into nested submodules, and show their status as well. @@ -266,6 +265,11 @@ OPTIONS Initialize all submodules for which "git submodule init" has not been called so far before updating. +--name:: + This option is only valid for the add command. It sets the submodule's + name to the given string instead of defaulting to its path. The name + must be valid as a directory name and may not end with a '/'. + --reference :: This option is only valid for add and update commands. These commands sometimes need to clone a remote repository. In this case, diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index cfe8d2b5df..8b0d3adfed 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -146,6 +146,13 @@ Skip "branches" and "tags" of first level directories;; ------------------------------------------------------------------------ -- +--log-window-size=;; + Fetch log entries per request when scanning Subversion history. + The default is 100. For very large Subversion repositories, larger + values may be needed for 'clone'/'fetch' to complete in reasonable + time. But overly large values may lead to higher memory usage and + request timeouts. + 'clone':: Runs 'init' and 'fetch'. It will automatically create a directory based on the basename of the URL passed to it; diff --git a/Documentation/git-symbolic-ref.txt b/Documentation/git-symbolic-ref.txt index 981d3a8fc1..ef68ad2b71 100644 --- a/Documentation/git-symbolic-ref.txt +++ b/Documentation/git-symbolic-ref.txt @@ -3,13 +3,14 @@ git-symbolic-ref(1) NAME ---- -git-symbolic-ref - Read and modify symbolic refs +git-symbolic-ref - Read, modify and delete symbolic refs SYNOPSIS -------- [verse] 'git symbolic-ref' [-m ] 'git symbolic-ref' [-q] [--short] +'git symbolic-ref' --delete [-q] DESCRIPTION ----------- @@ -21,6 +22,9 @@ argument to see which branch your working tree is on. Given two arguments, creates or updates a symbolic ref to point at the given branch . +Given `--delete` and an additional argument, deletes the given +symbolic ref. + A symbolic ref is a regular file that stores a string that begins with `ref: refs/`. For example, your `.git/HEAD` is a regular file whose contents is `ref: refs/heads/master`. @@ -28,6 +32,10 @@ a regular file whose contents is `ref: refs/heads/master`. OPTIONS ------- +-d:: +--delete:: + Delete the symbolic ref . + -q:: --quiet:: Do not issue an error message if the is not a diff --git a/Documentation/git.txt b/Documentation/git.txt index 34d8a1bbdf..4a89a12513 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,18 @@ 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.12/git.html[documentation for release 1.7.12] +* link:v1.8.0/git.html[documentation for release 1.8.0] * release notes for + link:RelNotes/1.8.0.txt[1.8.0], + +* link:v1.7.12.4/git.html[documentation for release 1.7.12.4] + +* release notes for + link:RelNotes/1.7.12.4.txt[1.7.12.4], + link:RelNotes/1.7.12.3.txt[1.7.12.3], + link:RelNotes/1.7.12.2.txt[1.7.12.2], + link:RelNotes/1.7.12.1.txt[1.7.12.1], link:RelNotes/1.7.12.txt[1.7.12]. * link:v1.7.11.7/git.html[documentation for release 1.7.11.7] diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 462b79c120..2698f63cf9 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -56,6 +56,7 @@ When more than one pattern matches the path, a later line overrides an earlier line. This overriding is done per attribute. The rules how the pattern matches paths are the same as in `.gitignore` files; see linkgit:gitignore[5]. +Unlike `.gitignore`, negative patterns are forbidden. When deciding what attributes are assigned to a path, git consults `$GIT_DIR/info/attributes` file (which has the highest @@ -66,6 +67,11 @@ is from the path in question, the lower its precedence). Finally global and system-wide files are considered (they have the lowest precedence). +When the `.gitattributes` file is missing from the work tree, the +path in the index is used as a fall-back. During checkout process, +`.gitattributes` in the index is used and then the file in the +working tree is used as a fall-back. + If you wish to affect only a single repository (i.e., to assign attributes to files that are particular to one user's workflow for that repository), then @@ -511,6 +517,8 @@ configuration file (you still need to enable this with the attribute mechanism, via `.gitattributes`). The following built in patterns are available: +- `ada` suitable for source code in the Ada language. + - `bibtex` suitable for files with BibTeX coded references. - `cpp` suitable for source code in the C and C++ languages. diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt index f6ba90c2da..3bc1500eda 100644 --- a/Documentation/gitcli.txt +++ b/Documentation/gitcli.txt @@ -93,7 +93,7 @@ ENHANCED OPTION PARSER From the git 1.5.4 series and further, many git commands (not all of them at the time of the writing though) come with an enhanced option parser. -Here is an exhaustive list of the facilities provided by this option parser. +Here is a list of the facilities provided by this option parser. Magic Options @@ -137,6 +137,16 @@ options. This means that you can for example use `git rm -rf` or `git clean -fdx`. +Abbreviating long options +~~~~~~~~~~~~~~~~~~~~~~~~~ +Commands that support the enhanced option parser accepts unique +prefix of a long option as if it is fully spelled out, but use this +with a caution. For example, `git commit --amen` behaves as if you +typed `git commit --amend`, but that is true only until a later version +of Git introduces another option that shares the same prefix, +e.g `git commit --amenity" option. + + Separating argument from the option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can write the mandatory option parameter to an option as a separate diff --git a/Documentation/gitcore-tutorial.txt b/Documentation/gitcore-tutorial.txt index 9d893369a0..5325c5a7d5 100644 --- a/Documentation/gitcore-tutorial.txt +++ b/Documentation/gitcore-tutorial.txt @@ -956,12 +956,11 @@ $ git show-branch --topo-order --more=1 master mybranch ------------------------------------------------ The first two lines indicate that it is showing the two branches -and the first line of the commit log message from their -top-of-the-tree commits, you are currently on `master` branch -(notice the asterisk `*` character), and the first column for -the later output lines is used to show commits contained in the +with the titles of their top-of-the-tree commits, you are currently on +`master` branch (notice the asterisk `*` character), and the first +column for the later output lines is used to show commits contained in the `master` branch, and the second column for the `mybranch` -branch. Three commits are shown along with their log messages. +branch. Three commits are shown along with their titles. All of them have non blank characters in the first column (`*` shows an ordinary commit on the current branch, `-` is a merge commit), which means they are now part of the `master` branch. Only the "Some diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index c1f692a71e..1b82fe1969 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -41,18 +41,24 @@ precedence, the last matching pattern decides the outcome): variable 'core.excludesfile'. Which file to place a pattern in depends on how the pattern is meant to -be used. Patterns which should be version-controlled and distributed to -other repositories via clone (i.e., files that all developers will want -to ignore) should go into a `.gitignore` file. Patterns which are -specific to a particular repository but which do not need to be shared -with other related repositories (e.g., auxiliary files that live inside -the repository but are specific to one user's workflow) should go into -the `$GIT_DIR/info/exclude` file. Patterns which a user wants git to -ignore in all situations (e.g., backup or temporary files generated by -the user's editor of choice) generally go into a file specified by -`core.excludesfile` in the user's `~/.gitconfig`. Its default value is -$XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or empty, -$HOME/.config/git/ignore is used instead. +be used. + + * Patterns which should be version-controlled and distributed to + other repositories via clone (i.e., files that all developers will want + to ignore) should go into a `.gitignore` file. + + * Patterns which are + specific to a particular repository but which do not need to be shared + with other related repositories (e.g., auxiliary files that live inside + the repository but are specific to one user's workflow) should go into + the `$GIT_DIR/info/exclude` file. + + * Patterns which a user wants git to + ignore in all situations (e.g., backup or temporary files generated by + the user's editor of choice) generally go into a file specified by + `core.excludesfile` in the user's `~/.gitconfig`. Its default value is + $XDG_CONFIG_HOME/git/ignore. If $XDG_CONFIG_HOME is either not set or + empty, $HOME/.config/git/ignore is used instead. The underlying git plumbing tools, such as 'git ls-files' and 'git read-tree', read @@ -68,11 +74,15 @@ PATTERN FORMAT for readability. - A line starting with # serves as a comment. + Put a backslash ("`\`") in front of the first hash for patterns + that begin with a hash. - - An optional prefix '!' which negates the pattern; any + - An optional prefix "`!`" which negates the pattern; any matching file excluded by a previous pattern will become included again. If a negated pattern matches, this will override lower precedence patterns sources. + Put a backslash ("`\`") in front of the first "`!`" for patterns + that begin with a literal "`!`", for example, "`\!important!.txt`". - If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find diff --git a/Documentation/gitmodules.txt b/Documentation/gitmodules.txt index 4effd78902..ab3e91c054 100644 --- a/Documentation/gitmodules.txt +++ b/Documentation/gitmodules.txt @@ -18,7 +18,9 @@ working tree, is a text file with a syntax matching the requirements of linkgit:git-config[1]. The file contains one subsection per submodule, and the subsection value -is the name of the submodule. Each submodule section also contains the +is the name of the submodule. The name is set to the path where the +submodule has been added unless it was customized with the '--name' +option of 'git submodule add'. Each submodule section also contains the following required keys: submodule..path:: diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt index 5c891f1169..9f628862b4 100644 --- a/Documentation/gitrepository-layout.txt +++ b/Documentation/gitrepository-layout.txt @@ -93,6 +93,12 @@ refs/remotes/`name`:: records tip-of-the-tree commit objects of branches copied from a remote repository. +refs/replace/``:: + records the SHA1 of the object that replaces ``. + This is similar to info/grafts and is internally used and + maintained by linkgit:git-replace[1]. Such refs can be exchanged + between repositories while grafts are not. + packed-refs:: records the same information as refs/heads/, refs/tags/, and friends record in a more efficient way. See diff --git a/Documentation/gittutorial.txt b/Documentation/gittutorial.txt index dee050567e..f1cb6f3be6 100644 --- a/Documentation/gittutorial.txt +++ b/Documentation/gittutorial.txt @@ -139,9 +139,11 @@ them to the index, and commit, all in one step. A note on commit messages: Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more -thorough description. Tools that turn commits into email, for -example, use the first line on the Subject: line and the rest of the -commit in the body. +thorough description. The text up to the first blank line in a commit +message is treated as the commit title, and that title is used +throughout git. For example, linkgit:git-format-patch[1] turns a +commit into email, and it uses the title on the Subject line and the +rest of the commit in the body. Git tracks content not files ---------------------------- diff --git a/Documentation/merge-config.txt b/Documentation/merge-config.txt index 861bd6f553..9bb4956ccd 100644 --- a/Documentation/merge-config.txt +++ b/Documentation/merge-config.txt @@ -9,11 +9,11 @@ merge.conflictstyle:: merge.defaultToUpstream:: If merge is called without any commit argument, merge the upstream branches configured for the current branch by using their last - observed values stored in their remote tracking branches. + observed values stored in their remote-tracking branches. The values of the `branch..merge` that name the branches at the remote named by `branch..remote` are consulted, and then they are mapped via `remote..fetch` - to their corresponding remote tracking branches, and the tips of + to their corresponding remote-tracking branches, and the tips of these tracking branches are merged. merge.ff:: diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index e3d8a83b23..d9eddedc72 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -130,6 +130,9 @@ The placeholders are: - '%b': body - '%B': raw body (unwrapped subject and body) - '%N': commit notes +- '%GG': raw verification message from GPG for a signed commit +- '%G?': show either "G" for Good or "B" for Bad for a signed commit +- '%GS': show the name of the signer for a signed commit - '%gD': reflog selector, e.g., `refs/stash@{1}` - '%gd': shortened reflog selector, e.g., `stash@{1}` - '%gn': reflog identity name diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt index 2a3dc8664f..5e499421a4 100644 --- a/Documentation/pretty-options.txt +++ b/Documentation/pretty-options.txt @@ -66,3 +66,7 @@ being displayed. Examples: "--notes=foo" will show only notes from --[no-]standard-notes:: These options are deprecated. Use the above --notes/--no-notes options instead. + +--show-signature:: + Check the validity of a signed commit object by passing the signature + to `gpg --verify` and show the output. diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 918c1109f2..1ec14a068e 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -3,8 +3,15 @@ Commit Limiting Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit -limiting may be applied. Note that they are applied before commit -ordering and formatting options, such as '--reverse'. +limiting may be applied. + +Using more options generally further limits the output (e.g. +`--since=` limits to commits newer than ``, and using it +with `--grep=` further limits to commits whose log message +has a line that matches ``), unless otherwise noted. + +Note that these are applied before commit +ordering and formatting options, such as `--reverse`. -- @@ -39,22 +46,44 @@ endif::git-rev-list[] --committer=:: Limit the commits output to ones with author/committer - header lines that match the specified pattern (regular expression). + header lines that match the specified pattern (regular + expression). With more than one `--author=`, + commits whose author matches any of the given patterns are + chosen (similarly for multiple `--committer=`). + +--grep-reflog=:: + + Limit the commits output to ones with reflog entries that + match the specified pattern (regular expression). With + more than one `--grep-reflog`, commits whose reflog message + matches any of the given patterns are chosen. It is an + error to use this option unless `--walk-reflogs` is in use. --grep=:: Limit the commits output to ones with log message that - matches the specified pattern (regular expression). + matches the specified pattern (regular expression). With + more than one `--grep=`, commits whose message + matches any of the given patterns are chosen (but see + `--all-match`). ++ +When `--show-notes` is in effect, the message from the notes as +if it is part of the log message. --all-match:: Limit the commits output to ones that match all given --grep, - --author and --committer instead of ones that match at least one. + instead of ones that match at least one. -i:: --regexp-ignore-case:: Match the regexp limiting patterns without regard to letters case. +--basic-regexp:: + + Consider the limiting patterns to be basic regular expressions; + this is the default. + -E:: --extended-regexp:: @@ -67,6 +96,11 @@ endif::git-rev-list[] Consider the limiting patterns to be fixed strings (don't interpret pattern as a regular expression). +--perl-regexp:: + + Consider the limiting patterns to be Perl-compatible regexp. + Requires libpcre to be compiled in. + --remove-empty:: Stop when a given path disappears from the tree. diff --git a/Documentation/technical/api-argv-array.txt b/Documentation/technical/api-argv-array.txt index 1a797812fb..a959517b23 100644 --- a/Documentation/technical/api-argv-array.txt +++ b/Documentation/technical/api-argv-array.txt @@ -53,3 +53,11 @@ Functions `argv_array_clear`:: Free all memory associated with the array and return it to the initial, empty state. + +`argv_array_detach`:: + Detach the argv array from the `struct argv_array`, transfering + ownership of the allocated array and strings. + +`argv_array_free_detached`:: + Free the memory allocated by a `struct argv_array` that was later + detached and is now no longer needed. diff --git a/Documentation/technical/api-sha1-array.txt b/Documentation/technical/api-sha1-array.txt index 4a4bae8109..45d1c517cd 100644 --- a/Documentation/technical/api-sha1-array.txt +++ b/Documentation/technical/api-sha1-array.txt @@ -25,9 +25,6 @@ Functions the array (but note that some operations below may lose this ordering). -`sha1_array_sort`:: - Sort the elements in the array. - `sha1_array_lookup`:: Perform a binary search of the array for a specific sha1. If found, returns the offset (in number of elements) of the diff --git a/Documentation/technical/api-string-list.txt b/Documentation/technical/api-string-list.txt index 5a0c14fceb..94d7a2bd99 100644 --- a/Documentation/technical/api-string-list.txt +++ b/Documentation/technical/api-string-list.txt @@ -1,8 +1,9 @@ string-list API =============== -The string_list API offers a data structure and functions to handle sorted -and unsorted string lists. +The string_list API offers a data structure and functions to handle +sorted and unsorted string lists. A "sorted" list is one whose +entries are sorted by string value in `strcmp()` order. The 'string_list' struct used to be called 'path_list', but was renamed because it is not specific to paths. @@ -20,8 +21,9 @@ If you need something advanced, you can manually malloc() the `items` member (you need this if you add things later) and you should set the `nr` and `alloc` members in that case, too. -. Adds new items to the list, using `string_list_append` or - `string_list_insert`. +. Adds new items to the list, using `string_list_append`, + `string_list_append_nodup`, `string_list_insert`, + `string_list_split`, and/or `string_list_split_in_place`. . Can check if a string is in the list using `string_list_has_string` or `unsorted_string_list_has_string` and get it from the list using @@ -29,18 +31,23 @@ member (you need this if you add things later) and you should set the . Can sort an unsorted list using `sort_string_list`. +. Can remove duplicate items from a sorted list using + `string_list_remove_duplicates`. + . Can remove individual items of an unsorted list using `unsorted_string_list_delete_item`. +. Can remove items not matching a criterion from a sorted or unsorted + list using `filter_string_list`. + . Finally it should free the list using `string_list_clear`. Example: ---- -struct string_list list; +struct string_list list = STRING_LIST_INIT_NODUP; int i; -memset(&list, 0, sizeof(struct string_list)); string_list_append(&list, "foo"); string_list_append(&list, "bar"); for (i = 0; i < list.nr; i++) @@ -60,6 +67,22 @@ Functions * General ones (works with sorted and unsorted lists as well) +`filter_string_list`:: + + Apply a function to each item in a list, retaining only the + items for which the function returns true. If free_util is + true, call free() on the util members of any items that have + to be deleted. Preserve the order of the items that are + retained. + +`string_list_longest_prefix`:: + + Return the longest string within a string_list that is a + prefix (in the sense of prefixcmp()) of the specified string, + or NULL if no such prefix exists. This function does not + require the string_list to be sorted (it does a linear + search). + `print_string_list`:: Dump a string_list to stdout, useful mainly for debugging purposes. It @@ -96,15 +119,32 @@ write `string_list_insert(...)->util = ...;`. Look up a given string in the string_list, returning the containing string_list_item. If the string is not found, NULL is returned. +`string_list_remove_duplicates`:: + + Remove all but the first of consecutive entries that have the + same string value. If free_util is true, call free() on the + util members of any items that have to be deleted. + * Functions for unsorted lists only `string_list_append`:: - Append a new string to the end of the string_list. + Append a new string to the end of the string_list. If + `strdup_string` is set, then the string argument is copied; + otherwise the new `string_list_entry` refers to the input + string. + +`string_list_append_nodup`:: + + Append a new string to the end of the string_list. The new + `string_list_entry` always refers to the input string, even if + `strdup_string` is set. This function can be used to hand + ownership of a malloc()ed string to a `string_list` that has + `strdup_string` set. `sort_string_list`:: - Make an unsorted list sorted. + Sort the list's entries by string value in `strcmp()` order. `unsorted_string_list_has_string`:: @@ -124,6 +164,25 @@ counterpart for sorted lists, which performs a binary search. is set. The third parameter controls if the `util` pointer of the items should be freed or not. +`string_list_split`:: +`string_list_split_in_place`:: + + Split a string into substrings on a delimiter character and + append the substrings to a `string_list`. If `maxsplit` is + non-negative, then split at most `maxsplit` times. Return the + number of substrings appended to the list. ++ +`string_list_split` requires a `string_list` that has `strdup_strings` +set to true; it leaves the input string untouched and makes copies of +the substrings in newly-allocated memory. +`string_list_split_in_place` requires a `string_list` that has +`strdup_strings` set to false; it splits the input string in place, +overwriting the delimiter characters with NULs and creating new +string_list_items that point into the original string (the original +string must therefore not be modified or freed while the `string_list` +is in use). + + Data structures --------------- diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt index 49cdc571cd..d51e20f352 100644 --- a/Documentation/technical/pack-protocol.txt +++ b/Documentation/technical/pack-protocol.txt @@ -259,8 +259,10 @@ a positive depth, this step is skipped. ---- If the client has requested a positive depth, the server will compute -the set of commits which are no deeper than the desired depth, starting -at the client's wants. The server writes 'shallow' lines for each +the set of commits which are no deeper than the desired depth. The set +of commits start at the client's wants. + +The server writes 'shallow' lines for each commit whose parents will not be sent as a result. The server writes an 'unshallow' line for each commit which the client has indicated is shallow, but is no longer shallow at the currently requested depth diff --git a/Documentation/urls.txt b/Documentation/urls.txt index 289019478d..1d15ee7e52 100644 --- a/Documentation/urls.txt +++ b/Documentation/urls.txt @@ -6,8 +6,12 @@ address of the remote server, and the path to the repository. Depending on the transport protocol, some of this information may be absent. -Git natively supports ssh, git, http, https, ftp, ftps, and rsync -protocols. The following syntaxes may be used with them: +Git supports ssh, git, http, and https protocols (in addition, ftp, +and ftps can be used for fetching and rsync can be used for fetching +and pushing, but these are inefficient and deprecated; do not use +them). + +The following syntaxes may be used with them: - ssh://{startsb}user@{endsb}host.xz{startsb}:port{endsb}/path/to/repo.git/ - git://host.xz{startsb}:port{endsb}/path/to/repo.git/ diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index 03d95dc290..85651b57ae 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1136,9 +1136,12 @@ Creating good commit messages Though not required, it's a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough -description. Tools that turn commits into email, for example, use -the first line on the Subject line and the rest of the commit in the -body. +description. The text up to the first blank line in a commit +message is treated as the commit title, and that title is used +throughout git. For example, linkgit:git-format-patch[1] turns a +commit into email, and it uses the title on the Subject line and the +rest of the commit in the body. + [[ignoring-files]] Ignoring files diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index d2d2d699e1..b09d264a86 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.12.GIT +DEF_VER=v1.8.0 LF=' ' diff --git a/Makefile b/Makefile index 1f81685f06..ea5c106bb2 100644 --- a/Makefile +++ b/Makefile @@ -495,6 +495,7 @@ PROGRAM_OBJS += sh-i18n--envsubst.o PROGRAM_OBJS += shell.o PROGRAM_OBJS += show-index.o PROGRAM_OBJS += upload-pack.o +PROGRAM_OBJS += remote-testsvn.o # Binary suffix, set to .exe for Windows builds X = @@ -520,6 +521,7 @@ TEST_PROGRAMS_NEED_X += test-run-command TEST_PROGRAMS_NEED_X += test-scrap-cache-tree TEST_PROGRAMS_NEED_X += test-sha1 TEST_PROGRAMS_NEED_X += test-sigchain +TEST_PROGRAMS_NEED_X += test-string-list TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe @@ -744,6 +746,7 @@ LIB_OBJS += editor.o LIB_OBJS += entry.o LIB_OBJS += environment.o LIB_OBJS += exec_cmd.o +LIB_OBJS += fetch-pack.o LIB_OBJS += fsck.o LIB_OBJS += gettext.o LIB_OBJS += gpg-interface.o @@ -761,6 +764,7 @@ LIB_OBJS += lockfile.o LIB_OBJS += log-tree.o LIB_OBJS += mailmap.o LIB_OBJS += match-trees.o +LIB_OBJS += merge.o LIB_OBJS += merge-file.o LIB_OBJS += merge-recursive.o LIB_OBJS += mergesort.o @@ -795,6 +799,7 @@ LIB_OBJS += rerere.o LIB_OBJS += resolve-undo.o LIB_OBJS += revision.o LIB_OBJS += run-command.o +LIB_OBJS += send-pack.o LIB_OBJS += sequencer.o LIB_OBJS += server-info.o LIB_OBJS += setup.o @@ -2452,6 +2457,10 @@ git-http-push$X: revision.o http.o http-push.o GIT-LDFLAGS $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \ $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT) +git-remote-testsvn$X: remote-testsvn.o GIT-LDFLAGS $(GITLIBS) $(VCSSVN_LIB) + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS) \ + $(VCSSVN_LIB) + $(REMOTE_CURL_ALIASES): $(REMOTE_CURL_PRIMARY) $(QUIET_LNCP)$(RM) $@ && \ ln $< $@ 2>/dev/null || \ @@ -2639,6 +2648,7 @@ bin-wrappers/%: wrap-for-bin.sh # with that. export NO_SVN_TESTS +export TEST_NO_MALLOC_CHECK ### Testing rules diff --git a/archive-zip.c b/archive-zip.c index f5af81f904..55f66b4060 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -4,6 +4,7 @@ #include "cache.h" #include "archive.h" #include "streaming.h" +#include "utf8.h" static int zip_date; static int zip_time; @@ -16,7 +17,8 @@ static unsigned int zip_dir_offset; static unsigned int zip_dir_entries; #define ZIP_DIRECTORY_MIN_SIZE (1024 * 1024) -#define ZIP_STREAM (8) +#define ZIP_STREAM (1 << 3) +#define ZIP_UTF8 (1 << 11) struct zip_local_header { unsigned char magic[4]; @@ -74,6 +76,14 @@ struct zip_dir_trailer { unsigned char _end[1]; }; +struct zip_extra_mtime { + unsigned char magic[2]; + unsigned char extra_size[2]; + unsigned char flags[1]; + unsigned char mtime[4]; + unsigned char _end[1]; +}; + /* * On ARM, padding is added at the end of the struct, so a simple * sizeof(struct ...) reports two bytes more than the payload size @@ -83,6 +93,9 @@ struct zip_dir_trailer { #define ZIP_DATA_DESC_SIZE offsetof(struct zip_data_desc, _end) #define ZIP_DIR_HEADER_SIZE offsetof(struct zip_dir_header, _end) #define ZIP_DIR_TRAILER_SIZE offsetof(struct zip_dir_trailer, _end) +#define ZIP_EXTRA_MTIME_SIZE offsetof(struct zip_extra_mtime, _end) +#define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \ + (ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags)) static void copy_le16(unsigned char *dest, unsigned int n) { @@ -164,6 +177,17 @@ static void set_zip_header_data_desc(struct zip_local_header *header, copy_le32(header->size, size); } +static int has_only_ascii(const char *s) +{ + for (;;) { + int c = *s++; + if (c == '\0') + return 1; + if (!isascii(c)) + return 0; + } +} + #define STREAM_BUFFER_SIZE (1024 * 16) static int write_zip_entry(struct archiver_args *args, @@ -173,6 +197,7 @@ static int write_zip_entry(struct archiver_args *args, { struct zip_local_header header; struct zip_dir_header dirent; + struct zip_extra_mtime extra; unsigned long attr2; unsigned long compressed_size; unsigned long crc; @@ -187,6 +212,13 @@ static int write_zip_entry(struct archiver_args *args, crc = crc32(0, NULL, 0); + if (!has_only_ascii(path)) { + if (is_utf8(path)) + flags |= ZIP_UTF8; + else + warning("Path is not valid UTF-8: %s", path); + } + if (pathlen > 0xffff) { return error("path too long (%d chars, SHA1: %s): %s", (int)pathlen, sha1_to_hex(sha1), path); @@ -246,8 +278,13 @@ static int write_zip_entry(struct archiver_args *args, } } + copy_le16(extra.magic, 0x5455); + copy_le16(extra.extra_size, ZIP_EXTRA_MTIME_PAYLOAD_SIZE); + extra.flags[0] = 1; /* just mtime */ + copy_le32(extra.mtime, args->time); + /* make sure we have enough free space in the dictionary */ - direntsize = ZIP_DIR_HEADER_SIZE + pathlen; + direntsize = ZIP_DIR_HEADER_SIZE + pathlen + ZIP_EXTRA_MTIME_SIZE; while (zip_dir_size < zip_dir_offset + direntsize) { zip_dir_size += ZIP_DIRECTORY_MIN_SIZE; zip_dir = xrealloc(zip_dir, zip_dir_size); @@ -263,7 +300,7 @@ static int write_zip_entry(struct archiver_args *args, copy_le16(dirent.mdate, zip_date); set_zip_dir_data_desc(&dirent, size, compressed_size, crc); copy_le16(dirent.filename_length, pathlen); - copy_le16(dirent.extra_length, 0); + copy_le16(dirent.extra_length, ZIP_EXTRA_MTIME_SIZE); copy_le16(dirent.comment_length, 0); copy_le16(dirent.disk, 0); copy_le16(dirent.attr1, 0); @@ -281,11 +318,13 @@ static int write_zip_entry(struct archiver_args *args, else set_zip_header_data_desc(&header, size, compressed_size, crc); copy_le16(header.filename_length, pathlen); - copy_le16(header.extra_length, 0); + copy_le16(header.extra_length, ZIP_EXTRA_MTIME_SIZE); write_or_die(1, &header, ZIP_LOCAL_HEADER_SIZE); zip_offset += ZIP_LOCAL_HEADER_SIZE; write_or_die(1, path, pathlen); zip_offset += pathlen; + write_or_die(1, &extra, ZIP_EXTRA_MTIME_SIZE); + zip_offset += ZIP_EXTRA_MTIME_SIZE; if (stream && method == 0) { unsigned char buf[STREAM_BUFFER_SIZE]; ssize_t readlen; @@ -382,6 +421,8 @@ static int write_zip_entry(struct archiver_args *args, zip_dir_offset += ZIP_DIR_HEADER_SIZE; memcpy(zip_dir + zip_dir_offset, path, pathlen); zip_dir_offset += pathlen; + memcpy(zip_dir + zip_dir_offset, &extra, ZIP_EXTRA_MTIME_SIZE); + zip_dir_offset += ZIP_EXTRA_MTIME_SIZE; zip_dir_entries++; return 0; diff --git a/argv-array.c b/argv-array.c index 256741d226..9e960d549c 100644 --- a/argv-array.c +++ b/argv-array.c @@ -68,3 +68,23 @@ void argv_array_clear(struct argv_array *array) } argv_array_init(array); } + +const char **argv_array_detach(struct argv_array *array, int *argc) +{ + const char **argv = + array->argv == empty_argv || array->argc == 0 ? NULL : array->argv; + if (argc) + *argc = array->argc; + argv_array_init(array); + return argv; +} + +void argv_array_free_detached(const char **argv) +{ + if (argv) { + int i; + for (i = 0; argv[i]; i++) + free((char **)argv[i]); + free(argv); + } +} diff --git a/argv-array.h b/argv-array.h index f4b98660f8..40248d424c 100644 --- a/argv-array.h +++ b/argv-array.h @@ -18,5 +18,7 @@ void argv_array_pushf(struct argv_array *, const char *fmt, ...); void argv_array_pushl(struct argv_array *, ...); void argv_array_pop(struct argv_array *); void argv_array_clear(struct argv_array *); +const char **argv_array_detach(struct argv_array *array, int *argc); +void argv_array_free_detached(const char **argv); #endif /* ARGV_ARRAY_H */ diff --git a/attr.c b/attr.c index 3430faf2cc..097ae87f3c 100644 --- a/attr.c +++ b/attr.c @@ -115,6 +115,13 @@ struct attr_state { const char *setto; }; +struct pattern { + const char *pattern; + int patternlen; + int nowildcardlen; + int flags; /* EXC_FLAG_* */ +}; + /* * One rule, as from a .gitattributes file. * @@ -131,7 +138,7 @@ struct attr_state { */ struct match_attr { union { - char *pattern; + struct pattern pat; struct git_attr *attr; } u; char is_macro; @@ -241,9 +248,16 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, if (is_macro) res->u.attr = git_attr_internal(name, namelen); else { - res->u.pattern = (char *)&(res->state[num_attr]); - memcpy(res->u.pattern, name, namelen); - res->u.pattern[namelen] = 0; + char *p = (char *)&(res->state[num_attr]); + memcpy(p, name, namelen); + res->u.pat.pattern = p; + parse_exclude_pattern(&res->u.pat.pattern, + &res->u.pat.patternlen, + &res->u.pat.flags, + &res->u.pat.nowildcardlen); + if (res->u.pat.flags & EXC_FLAG_NEGATIVE) + die(_("Negative patterns are forbidden in git attributes\n" + "Use '\\!' for literal leading exclamation.")); } res->is_macro = is_macro; res->num_attr = num_attr; @@ -277,6 +291,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, static struct attr_stack { struct attr_stack *prev; char *origin; + size_t originlen; unsigned num_matches; unsigned alloc; struct match_attr **attrs; @@ -353,7 +368,7 @@ static struct attr_stack *read_attr_from_file(const char *path, int macro_ok) int lineno = 0; if (!fp) { - if (errno != ENOENT) + if (errno != ENOENT && errno != ENOTDIR) warn_on_inaccessible(path); return NULL; } @@ -535,6 +550,7 @@ static void bootstrap_attr_stack(void) if (!is_bare_repository() || direction == GIT_ATTR_INDEX) { elem = read_attr(GITATTRIBUTES_FILE, 1); elem->origin = xstrdup(""); + elem->originlen = 0; elem->prev = attr_stack; attr_stack = elem; debug_push(elem); @@ -628,7 +644,7 @@ static void prepare_attr_stack(const char *path) strbuf_addstr(&pathbuf, GITATTRIBUTES_FILE); elem = read_attr(pathbuf.buf, 0); strbuf_setlen(&pathbuf, cp - path); - elem->origin = strbuf_detach(&pathbuf, NULL); + elem->origin = strbuf_detach(&pathbuf, &elem->originlen); elem->prev = attr_stack; attr_stack = elem; debug_push(elem); @@ -645,28 +661,22 @@ static void prepare_attr_stack(const char *path) } static int path_matches(const char *pathname, int pathlen, - const char *pattern, + const char *basename, + const struct pattern *pat, const char *base, int baselen) { - if (!strchr(pattern, '/')) { - /* match basename */ - const char *basename = strrchr(pathname, '/'); - basename = basename ? basename + 1 : pathname; - return (fnmatch_icase(pattern, basename, 0) == 0); + const char *pattern = pat->pattern; + int prefix = pat->nowildcardlen; + + if (pat->flags & EXC_FLAG_NODIR) { + return match_basename(basename, + pathlen - (basename - pathname), + pattern, prefix, + pat->patternlen, pat->flags); } - /* - * match with FNM_PATHNAME; the pattern has base implicitly - * in front of it. - */ - if (*pattern == '/') - pattern++; - if (pathlen < baselen || - (baselen && pathname[baselen] != '/') || - strncmp(pathname, base, baselen)) - return 0; - if (baselen != 0) - baselen++; - return fnmatch_icase(pattern, pathname + baselen, FNM_PATHNAME) == 0; + return match_pathname(pathname, pathlen, + base, baselen, + pattern, prefix, pat->patternlen, pat->flags); } static int macroexpand_one(int attr_nr, int rem); @@ -693,7 +703,8 @@ static int fill_one(const char *what, struct match_attr *a, int rem) return rem; } -static int fill(const char *path, int pathlen, struct attr_stack *stk, int rem) +static int fill(const char *path, int pathlen, const char *basename, + struct attr_stack *stk, int rem) { int i; const char *base = stk->origin ? stk->origin : ""; @@ -702,8 +713,8 @@ static int fill(const char *path, int pathlen, struct attr_stack *stk, int rem) struct match_attr *a = stk->attrs[i]; if (a->is_macro) continue; - if (path_matches(path, pathlen, - a->u.pattern, base, strlen(base))) + if (path_matches(path, pathlen, basename, + &a->u.pat, base, stk->originlen)) rem = fill_one("fill", a, rem); } return rem; @@ -741,15 +752,19 @@ static void collect_all_attrs(const char *path) { struct attr_stack *stk; int i, pathlen, rem; + const char *basename; prepare_attr_stack(path); for (i = 0; i < attr_nr; i++) check_all_attr[i].value = ATTR__UNKNOWN; + basename = strrchr(path, '/'); + basename = basename ? basename + 1 : path; + pathlen = strlen(path); rem = attr_nr; for (stk = attr_stack; 0 < rem && stk; stk = stk->prev) - rem = fill(path, pathlen, stk, rem); + rem = fill(path, pathlen, basename, stk, rem); } int git_check_attr(const char *path, int num, struct git_attr_check *check) diff --git a/bisect.c b/bisect.c index 1aad49b1a6..bd1b7b5dac 100644 --- a/bisect.c +++ b/bisect.c @@ -956,3 +956,41 @@ int bisect_next_all(const char *prefix, int no_checkout) return bisect_checkout(bisect_rev_hex, no_checkout); } +static inline int log2i(int n) +{ + int log2 = 0; + + for (; n > 1; n >>= 1) + log2++; + + return log2; +} + +static inline int exp2i(int n) +{ + return 1 << n; +} + +/* + * Estimate the number of bisect steps left (after the current step) + * + * For any x between 0 included and 2^n excluded, the probability for + * n - 1 steps left looks like: + * + * P(2^n + x) == (2^n - x) / (2^n + x) + * + * and P(2^n + x) < 0.5 means 2^n < 3x + */ +int estimate_bisect_steps(int all) +{ + int n, x, e; + + if (all < 3) + return 0; + + n = log2i(all); + e = exp2i(n); + x = all - e; + + return (e < 3 * x) ? n : n - 1; +} diff --git a/bisect.h b/bisect.h index ec3c3ff007..2a6c831f3e 100644 --- a/bisect.h +++ b/bisect.h @@ -11,10 +11,6 @@ extern struct commit_list *filter_skipped(struct commit_list *list, int *count, int *skipped_first); -extern void print_commit_list(struct commit_list *list, - const char *format_cur, - const char *format_last); - #define BISECT_SHOW_ALL (1<<0) #define REV_LIST_QUIET (1<<1) diff --git a/builtin.h b/builtin.h index 8e377522fe..3faf9d6691 100644 --- a/builtin.h +++ b/builtin.h @@ -21,7 +21,6 @@ struct fmt_merge_msg_opts { extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out, struct fmt_merge_msg_opts *); -extern void commit_notes(struct notes_tree *t, const char *msg); struct notes_rewrite_cfg { struct notes_tree **trees; @@ -33,16 +32,11 @@ struct notes_rewrite_cfg { int mode_from_env; }; -combine_notes_fn parse_combine_notes_fn(const char *v); struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd); int copy_note_for_rewrite(struct notes_rewrite_cfg *c, const unsigned char *from_obj, const unsigned char *to_obj); 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, int sha1_valid, char **buf, unsigned long *buf_size); extern int cmd_add(int argc, const char **argv, const char *prefix); diff --git a/builtin/blame.c b/builtin/blame.c index 0e102bf2c2..c27ef21c23 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2069,6 +2069,55 @@ static int git_blame_config(const char *var, const char *value, void *cb) return git_default_config(var, value, cb); } +static void verify_working_tree_path(struct commit *work_tree, const char *path) +{ + struct commit_list *parents; + + for (parents = work_tree->parents; parents; parents = parents->next) { + const unsigned char *commit_sha1 = parents->item->object.sha1; + unsigned char blob_sha1[20]; + unsigned mode; + + if (!get_tree_entry(commit_sha1, path, blob_sha1, &mode) && + sha1_object_info(blob_sha1, NULL) == OBJ_BLOB) + return; + } + die("no such path '%s' in HEAD", path); +} + +static struct commit_list **append_parent(struct commit_list **tail, const unsigned char *sha1) +{ + struct commit *parent; + + parent = lookup_commit_reference(sha1); + if (!parent) + die("no such commit %s", sha1_to_hex(sha1)); + return &commit_list_insert(parent, tail)->next; +} + +static void append_merge_parents(struct commit_list **tail) +{ + int merge_head; + const char *merge_head_file = git_path("MERGE_HEAD"); + struct strbuf line = STRBUF_INIT; + + merge_head = open(merge_head_file, O_RDONLY); + if (merge_head < 0) { + if (errno == ENOENT) + return; + die("cannot open '%s' for reading", merge_head_file); + } + + while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) { + unsigned char sha1[20]; + if (line.len < 40 || get_sha1_hex(line.buf, sha1)) + die("unknown line in '%s': %s", merge_head_file, line.buf); + tail = append_parent(tail, sha1); + } + close(merge_head); + strbuf_release(&line); +} + /* * Prepare a dummy commit that represents the work tree (or staged) item. * Note that annotating work tree item never works in the reverse. @@ -2079,6 +2128,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, { struct commit *commit; struct origin *origin; + struct commit_list **parent_tail, *parent; unsigned char head_sha1[20]; struct strbuf buf = STRBUF_INIT; const char *ident; @@ -2086,20 +2136,38 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, int size, len; struct cache_entry *ce; unsigned mode; - - if (get_sha1("HEAD", head_sha1)) - die("No such ref: HEAD"); + struct strbuf msg = STRBUF_INIT; time(&now); commit = xcalloc(1, sizeof(*commit)); - commit->parents = xcalloc(1, sizeof(*commit->parents)); - commit->parents->item = lookup_commit_reference(head_sha1); commit->object.parsed = 1; commit->date = now; commit->object.type = OBJ_COMMIT; + parent_tail = &commit->parents; + + if (!resolve_ref_unsafe("HEAD", head_sha1, 1, NULL)) + die("no such ref: HEAD"); + + parent_tail = append_parent(parent_tail, head_sha1); + append_merge_parents(parent_tail); + verify_working_tree_path(commit, path); origin = make_origin(commit, path); + ident = fmt_ident("Not Committed Yet", "not.committed.yet", NULL, 0); + strbuf_addstr(&msg, "tree 0000000000000000000000000000000000000000\n"); + for (parent = commit->parents; parent; parent = parent->next) + strbuf_addf(&msg, "parent %s\n", + sha1_to_hex(parent->item->object.sha1)); + strbuf_addf(&msg, + "author %s\n" + "committer %s\n\n" + "Version of %s from %s\n", + ident, ident, path, + (!contents_from ? path : + (!strcmp(contents_from, "-") ? "standard input" : contents_from))); + commit->buffer = strbuf_detach(&msg, NULL); + if (!contents_from || strcmp("-", contents_from)) { struct stat st; const char *read_from; @@ -2136,7 +2204,6 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, } else { /* Reading from stdin */ - contents_from = "standard input"; mode = 0; if (strbuf_read(&buf, 0, 0) < 0) die_errno("failed to read from stdin"); @@ -2181,16 +2248,6 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, */ cache_tree_invalidate_path(active_cache_tree, path); - commit->buffer = xmalloc(400); - ident = fmt_ident("Not Committed Yet", "not.committed.yet", NULL, 0); - snprintf(commit->buffer, 400, - "tree 0000000000000000000000000000000000000000\n" - "parent %s\n" - "author %s\n" - "committer %s\n\n" - "Version of %s from %s\n", - sha1_to_hex(head_sha1), - ident, ident, path, contents_from ? contents_from : path); return commit; } diff --git a/builtin/branch.c b/builtin/branch.c index ffd26849c7..1ec9c02612 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -154,10 +154,37 @@ static int branch_merged(int kind, const char *name, return merged; } +static int check_branch_commit(const char *branchname, const char *refname, + unsigned char *sha1, struct commit *head_rev, + int kinds, int force) +{ + struct commit *rev = lookup_commit_reference(sha1); + if (!rev) { + error(_("Couldn't look up commit object for '%s'"), refname); + return -1; + } + if (!force && !branch_merged(kinds, branchname, rev, head_rev)) { + error(_("The branch '%s' is not fully merged.\n" + "If you are sure you want to delete it, " + "run 'git branch -D %s'."), branchname, branchname); + return -1; + } + return 0; +} + +static void delete_branch_config(const char *branchname) +{ + struct strbuf buf = STRBUF_INIT; + strbuf_addf(&buf, "branch.%s", branchname); + if (git_config_rename_section(buf.buf, NULL) < 0) + warning(_("Update of config-file failed")); + strbuf_release(&buf); +} + static int delete_branches(int argc, const char **argv, int force, int kinds, int quiet) { - struct commit *rev, *head_rev = NULL; + struct commit *head_rev = NULL; unsigned char sha1[20]; char *name = NULL; const char *fmt; @@ -187,6 +214,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, die(_("Couldn't look up commit object for HEAD")); } for (i = 0; i < argc; i++, strbuf_release(&bname)) { + const char *target; + int flags = 0; + strbuf_branchname(&bname, argv[i]); if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) { error(_("Cannot delete the branch '%s' " @@ -198,7 +228,9 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, free(name); name = mkpathdup(fmt, bname.buf); - if (read_ref(name, sha1)) { + target = resolve_ref_unsafe(name, sha1, 0, &flags); + if (!target || + (!(flags & REF_ISSYMREF) && is_null_sha1(sha1))) { error(remote_branch ? _("remote branch '%s' not found.") : _("branch '%s' not found."), bname.buf); @@ -206,40 +238,31 @@ static int delete_branches(int argc, const char **argv, int force, int kinds, continue; } - rev = lookup_commit_reference(sha1); - if (!rev) { - error(_("Couldn't look up commit object for '%s'"), name); - ret = 1; - continue; - } - - if (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) { - error(_("The branch '%s' is not fully merged.\n" - "If you are sure you want to delete it, " - "run 'git branch -D %s'."), bname.buf, bname.buf); + if (!(flags & REF_ISSYMREF) && + check_branch_commit(bname.buf, name, sha1, head_rev, kinds, + force)) { ret = 1; continue; } - if (delete_ref(name, sha1, 0)) { + if (delete_ref(name, sha1, REF_NODEREF)) { error(remote_branch ? _("Error deleting remote branch '%s'") : _("Error deleting branch '%s'"), bname.buf); ret = 1; - } else { - struct strbuf buf = STRBUF_INIT; - if (!quiet) - printf(remote_branch - ? _("Deleted remote branch %s (was %s).\n") - : _("Deleted branch %s (was %s).\n"), - bname.buf, - find_unique_abbrev(sha1, DEFAULT_ABBREV)); - strbuf_addf(&buf, "branch.%s", bname.buf); - if (git_config_rename_section(buf.buf, NULL) < 0) - warning(_("Update of config-file failed")); - strbuf_release(&buf); + continue; + } + if (!quiet) { + printf(remote_branch + ? _("Deleted remote branch %s (was %s).\n") + : _("Deleted branch %s (was %s).\n"), + bname.buf, + (flags & REF_ISSYMREF) + ? target + : find_unique_abbrev(sha1, DEFAULT_ABBREV)); } + delete_branch_config(bname.buf); } free(name); diff --git a/builtin/check-attr.c b/builtin/check-attr.c index e1ff575daa..075d01d30c 100644 --- a/builtin/check-attr.c +++ b/builtin/check-attr.c @@ -9,7 +9,7 @@ static int cached_attrs; static int stdin_paths; static const char * const check_attr_usage[] = { N_("git check-attr [-a | --all | attr...] [--] pathname..."), -N_("git check-attr --stdin [-a | --all | attr...] < "), +N_("git check-attr --stdin [-z] [-a | --all | attr...] < "), NULL }; diff --git a/builtin/clone.c b/builtin/clone.c index 5a9b2bce24..ec2f75b4f3 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -610,6 +610,54 @@ static void write_config(struct string_list *config) } } +static void write_refspec_config(const char* src_ref_prefix, + const struct ref* our_head_points_at, + const struct ref* remote_head_points_at, struct strbuf* branch_top) +{ + struct strbuf key = STRBUF_INIT; + struct strbuf value = STRBUF_INIT; + + if (option_mirror || !option_bare) { + if (option_single_branch && !option_mirror) { + if (option_branch) { + if (strstr(our_head_points_at->name, "refs/tags/")) + strbuf_addf(&value, "+%s:%s", our_head_points_at->name, + our_head_points_at->name); + else + strbuf_addf(&value, "+%s:%s%s", our_head_points_at->name, + branch_top->buf, option_branch); + } else if (remote_head_points_at) { + strbuf_addf(&value, "+%s:%s%s", remote_head_points_at->name, + branch_top->buf, + skip_prefix(remote_head_points_at->name, "refs/heads/")); + } + /* + * otherwise, the next "git fetch" will + * simply fetch from HEAD without updating + * any remote tracking branch, which is what + * we want. + */ + } else { + strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top->buf); + } + /* Configure the remote */ + if (value.len) { + strbuf_addf(&key, "remote.%s.fetch", option_origin); + git_config_set_multivar(key.buf, value.buf, "^$", 0); + strbuf_reset(&key); + + if (option_mirror) { + strbuf_addf(&key, "remote.%s.mirror", option_origin); + git_config_set(key.buf, "true"); + strbuf_reset(&key); + } + } + } + + strbuf_release(&key); + strbuf_release(&value); +} + int cmd_clone(int argc, const char **argv, const char *prefix) { int is_bundle = 0, is_local; @@ -755,20 +803,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix) } strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top.buf); - - if (option_mirror || !option_bare) { - /* Configure the remote */ - strbuf_addf(&key, "remote.%s.fetch", option_origin); - git_config_set_multivar(key.buf, value.buf, "^$", 0); - strbuf_reset(&key); - - if (option_mirror) { - strbuf_addf(&key, "remote.%s.mirror", option_origin); - git_config_set(key.buf, "true"); - strbuf_reset(&key); - } - } - strbuf_addf(&key, "remote.%s.url", option_origin); git_config_set(key.buf, repo); strbuf_reset(&key); @@ -853,6 +887,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) "refs/heads/master"); } + write_refspec_config(src_ref_prefix, our_head_points_at, + remote_head_points_at, &branch_top); + if (is_local) clone_local(path, git_dir); else if (refs && complete_refs_before_fetch) diff --git a/builtin/commit.c b/builtin/commit.c index 778cf16fde..1dd2ec5e6f 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -28,6 +28,7 @@ #include "submodule.h" #include "gpg-interface.h" #include "column.h" +#include "sequencer.h" static const char * const builtin_commit_usage[] = { N_("git commit [options] [--] ..."), @@ -111,10 +112,11 @@ static const char *only_include_assumed; static struct strbuf message = STRBUF_INIT; static enum { + STATUS_FORMAT_NONE = 0, STATUS_FORMAT_LONG, STATUS_FORMAT_SHORT, STATUS_FORMAT_PORCELAIN -} status_format = STATUS_FORMAT_LONG; +} status_format; static int opt_parse_m(const struct option *opt, const char *arg, int unset) { @@ -453,6 +455,7 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int case STATUS_FORMAT_PORCELAIN: wt_porcelain_print(s); break; + case STATUS_FORMAT_NONE: case STATUS_FORMAT_LONG: wt_status_print(s); break; @@ -466,8 +469,6 @@ static int is_a_merge(const struct commit *current_head) return !!(current_head->parents && current_head->parents->next); } -static const char sign_off_header[] = "Signed-off-by: "; - static void export_one(const char *var, const char *s, const char *e, int hack) { struct strbuf buf = STRBUF_INIT; @@ -552,47 +553,6 @@ static void determine_author_info(struct strbuf *author_ident) } } -static int ends_rfc2822_footer(struct strbuf *sb) -{ - int ch; - int hit = 0; - int i, j, k; - int len = sb->len; - int first = 1; - const char *buf = sb->buf; - - for (i = len - 1; i > 0; i--) { - if (hit && buf[i] == '\n') - break; - hit = (buf[i] == '\n'); - } - - while (i < len - 1 && buf[i] == '\n') - i++; - - for (; i < len; i = k) { - for (k = i; k < len && buf[k] != '\n'; k++) - ; /* do nothing */ - k++; - - if ((buf[k] == ' ' || buf[k] == '\t') && !first) - continue; - - first = 0; - - for (j = 0; i + j < len; j++) { - ch = buf[i + j]; - if (ch == ':') - break; - if (isalnum(ch) || - (ch == '-')) - continue; - return 0; - } - } - return 1; -} - static char *cut_ident_timestamp_part(char *string) { char *ket = strrchr(string, '>'); @@ -717,21 +677,30 @@ static int prepare_to_commit(const char *index_file, const char *prefix, stripspace(&sb, 0); if (signoff) { - struct strbuf sob = STRBUF_INIT; - int i; - - strbuf_addstr(&sob, sign_off_header); - strbuf_addstr(&sob, fmt_name(getenv("GIT_COMMITTER_NAME"), - getenv("GIT_COMMITTER_EMAIL"))); - strbuf_addch(&sob, '\n'); - for (i = sb.len - 1; i > 0 && sb.buf[i - 1] != '\n'; i--) - ; /* do nothing */ - if (prefixcmp(sb.buf + i, sob.buf)) { - if (!i || !ends_rfc2822_footer(&sb)) - strbuf_addch(&sb, '\n'); - strbuf_addbuf(&sb, &sob); + /* + * See if we have a Conflicts: block at the end. If yes, count + * its size, so we can ignore it. + */ + int ignore_footer = 0; + int i, eol, previous = 0; + const char *nl; + + for (i = 0; i < sb.len; i++) { + nl = memchr(sb.buf + i, '\n', sb.len - i); + if (nl) + eol = nl - sb.buf; + else + eol = sb.len; + if (!prefixcmp(sb.buf + previous, "\nConflicts:\n")) { + ignore_footer = sb.len - previous; + break; + } + while (i < eol) + i++; + previous = eol; } - strbuf_release(&sob); + + append_signoff(&sb, ignore_footer); } if (fwrite(sb.buf, 1, sb.len, s->fp) < sb.len) @@ -1091,9 +1060,13 @@ static int parse_and_validate_options(int argc, const char *argv[], if (all && argc > 0) die(_("Paths with -a does not make sense.")); - if (s->null_termination && status_format == STATUS_FORMAT_LONG) - status_format = STATUS_FORMAT_PORCELAIN; - if (status_format != STATUS_FORMAT_LONG) + if (s->null_termination) { + if (status_format == STATUS_FORMAT_NONE) + status_format = STATUS_FORMAT_PORCELAIN; + else if (status_format == STATUS_FORMAT_LONG) + die(_("--long and -z are incompatible")); + } + if (status_format != STATUS_FORMAT_NONE) dry_run = 1; return argc; @@ -1192,6 +1165,9 @@ int cmd_status(int argc, const char **argv, const char *prefix) OPT_SET_INT(0, "porcelain", &status_format, N_("machine-readable output"), STATUS_FORMAT_PORCELAIN), + OPT_SET_INT(0, "long", &status_format, + N_("show status in long format (default)"), + STATUS_FORMAT_LONG), OPT_BOOLEAN('z', "null", &s.null_termination, N_("terminate entries with NUL")), { OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, @@ -1219,8 +1195,12 @@ int cmd_status(int argc, const char **argv, const char *prefix) builtin_status_usage, 0); finalize_colopts(&s.colopts, -1); - if (s.null_termination && status_format == STATUS_FORMAT_LONG) - status_format = STATUS_FORMAT_PORCELAIN; + if (s.null_termination) { + if (status_format == STATUS_FORMAT_NONE) + status_format = STATUS_FORMAT_PORCELAIN; + else if (status_format == STATUS_FORMAT_LONG) + die(_("--long and -z are incompatible")); + } handle_untracked_files_arg(&s); if (show_ignored_in_status) @@ -1249,6 +1229,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) case STATUS_FORMAT_PORCELAIN: wt_porcelain_print(&s); break; + case STATUS_FORMAT_NONE: case STATUS_FORMAT_LONG: s.verbose = verbose; s.ignore_submodule_arg = ignore_submodule_arg; @@ -1419,6 +1400,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix) OPT_BOOLEAN(0, "branch", &s.show_branch, N_("show branch information")), OPT_SET_INT(0, "porcelain", &status_format, N_("machine-readable output"), STATUS_FORMAT_PORCELAIN), + OPT_SET_INT(0, "long", &status_format, + N_("show status in long format (default)"), + STATUS_FORMAT_LONG), OPT_BOOLEAN('z', "null", &s.null_termination, N_("terminate entries with NUL")), OPT_BOOLEAN(0, "amend", &amend, N_("amend previous commit")), @@ -1452,6 +1436,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix) usage_with_options(builtin_commit_usage, builtin_commit_options); wt_status_prepare(&s); + gitmodules_config(); git_config(git_commit_config, &s); determine_whence(&s); s.colopts = 0; diff --git a/builtin/describe.c b/builtin/describe.c index 9fe11ed9de..04c185b1fb 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -144,7 +144,7 @@ static int get_name(const char *path, const unsigned char *sha1, int flag, void if (!all && !might_be_tag) return 0; - if (!peel_ref(path, peeled) && !is_null_sha1(peeled)) { + if (!peel_ref(path, peeled)) { is_tag = !!hashcmp(sha1, peeled); } else { hashcpy(peeled, sha1); diff --git a/builtin/diff.c b/builtin/diff.c index 9650be2c50..9c70e40809 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -418,19 +418,3 @@ 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/fetch-pack.c b/builtin/fetch-pack.c index fdda36f149..940ae35dc2 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pack.c @@ -1,936 +1,29 @@ #include "builtin.h" -#include "refs.h" #include "pkt-line.h" -#include "commit.h" -#include "tag.h" -#include "exec_cmd.h" -#include "pack.h" -#include "sideband.h" #include "fetch-pack.h" -#include "remote.h" -#include "run-command.h" -#include "transport.h" -#include "version.h" - -static int transfer_unpack_limit = -1; -static int fetch_unpack_limit = -1; -static int unpack_limit = 100; -static int prefer_ofs_delta = 1; -static int no_done; -static int fetch_fsck_objects = -1; -static int transfer_fsck_objects = -1; -static int agent_supported; -static struct fetch_pack_args args = { - /* .uploadpack = */ "git-upload-pack", -}; static const char fetch_pack_usage[] = "git fetch-pack [--all] [--stdin] [--quiet|-q] [--keep|-k] [--thin] " "[--include-tag] [--upload-pack=] [--depth=] " "[--no-progress] [-v] [:] [...]"; -#define COMPLETE (1U << 0) -#define COMMON (1U << 1) -#define COMMON_REF (1U << 2) -#define SEEN (1U << 3) -#define POPPED (1U << 4) - -static int marked; - -/* - * After sending this many "have"s if we do not get any new ACK , we - * give up traversing our history. - */ -#define MAX_IN_VAIN 256 - -static struct commit_list *rev_list; -static int non_common_revs, multi_ack, use_sideband; - -static void rev_list_push(struct commit *commit, int mark) -{ - if (!(commit->object.flags & mark)) { - commit->object.flags |= mark; - - if (!(commit->object.parsed)) - if (parse_commit(commit)) - return; - - commit_list_insert_by_date(commit, &rev_list); - - if (!(commit->object.flags & COMMON)) - non_common_revs++; - } -} - -static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data) -{ - struct object *o = deref_tag(parse_object(sha1), refname, 0); - - if (o && o->type == OBJ_COMMIT) - rev_list_push((struct commit *)o, SEEN); - - return 0; -} - -static int clear_marks(const char *refname, const unsigned char *sha1, int flag, void *cb_data) -{ - struct object *o = deref_tag(parse_object(sha1), refname, 0); - - if (o && o->type == OBJ_COMMIT) - clear_commit_marks((struct commit *)o, - COMMON | COMMON_REF | SEEN | POPPED); - return 0; -} - -/* - This function marks a rev and its ancestors as common. - In some cases, it is desirable to mark only the ancestors (for example - when only the server does not yet know that they are common). -*/ - -static void mark_common(struct commit *commit, - int ancestors_only, int dont_parse) -{ - if (commit != NULL && !(commit->object.flags & COMMON)) { - struct object *o = (struct object *)commit; - - if (!ancestors_only) - o->flags |= COMMON; - - if (!(o->flags & SEEN)) - rev_list_push(commit, SEEN); - else { - struct commit_list *parents; - - if (!ancestors_only && !(o->flags & POPPED)) - non_common_revs--; - if (!o->parsed && !dont_parse) - if (parse_commit(commit)) - return; - - for (parents = commit->parents; - parents; - parents = parents->next) - mark_common(parents->item, 0, dont_parse); - } - } -} - -/* - Get the next rev to send, ignoring the common. -*/ - -static const unsigned char *get_rev(void) -{ - struct commit *commit = NULL; - - while (commit == NULL) { - unsigned int mark; - struct commit_list *parents; - - if (rev_list == NULL || non_common_revs == 0) - return NULL; - - commit = rev_list->item; - if (!commit->object.parsed) - parse_commit(commit); - parents = commit->parents; - - commit->object.flags |= POPPED; - if (!(commit->object.flags & COMMON)) - non_common_revs--; - - if (commit->object.flags & COMMON) { - /* do not send "have", and ignore ancestors */ - commit = NULL; - mark = COMMON | SEEN; - } else if (commit->object.flags & COMMON_REF) - /* send "have", and ignore ancestors */ - mark = COMMON | SEEN; - else - /* send "have", also for its ancestors */ - mark = SEEN; - - while (parents) { - if (!(parents->item->object.flags & SEEN)) - rev_list_push(parents->item, mark); - if (mark & COMMON) - mark_common(parents->item, 1, 0); - parents = parents->next; - } - - rev_list = rev_list->next; - } - - return commit->object.sha1; -} - -enum ack_type { - NAK = 0, - ACK, - ACK_continue, - ACK_common, - ACK_ready -}; - -static void consume_shallow_list(int fd) -{ - if (args.stateless_rpc && args.depth > 0) { - /* If we sent a depth we will get back "duplicate" - * shallow and unshallow commands every time there - * is a block of have lines exchanged. - */ - char line[1000]; - while (packet_read_line(fd, line, sizeof(line))) { - if (!prefixcmp(line, "shallow ")) - continue; - if (!prefixcmp(line, "unshallow ")) - continue; - die("git fetch-pack: expected shallow list"); - } - } -} - -struct write_shallow_data { - struct strbuf *out; - int use_pack_protocol; - int count; -}; - -static int write_one_shallow(const struct commit_graft *graft, void *cb_data) -{ - struct write_shallow_data *data = cb_data; - const char *hex = sha1_to_hex(graft->sha1); - data->count++; - if (data->use_pack_protocol) - packet_buf_write(data->out, "shallow %s", hex); - else { - strbuf_addstr(data->out, hex); - strbuf_addch(data->out, '\n'); - } - return 0; -} - -static int write_shallow_commits(struct strbuf *out, int use_pack_protocol) -{ - struct write_shallow_data data; - data.out = out; - data.use_pack_protocol = use_pack_protocol; - data.count = 0; - for_each_commit_graft(write_one_shallow, &data); - return data.count; -} - -static enum ack_type get_ack(int fd, unsigned char *result_sha1) -{ - static char line[1000]; - int len = packet_read_line(fd, line, sizeof(line)); - - if (!len) - die("git fetch-pack: expected ACK/NAK, got EOF"); - if (line[len-1] == '\n') - line[--len] = 0; - if (!strcmp(line, "NAK")) - return NAK; - if (!prefixcmp(line, "ACK ")) { - if (!get_sha1_hex(line+4, result_sha1)) { - if (strstr(line+45, "continue")) - return ACK_continue; - if (strstr(line+45, "common")) - return ACK_common; - if (strstr(line+45, "ready")) - return ACK_ready; - return ACK; - } - } - die("git fetch_pack: expected ACK/NAK, got '%s'", line); -} - -static void send_request(int fd, struct strbuf *buf) -{ - if (args.stateless_rpc) { - send_sideband(fd, -1, buf->buf, buf->len, LARGE_PACKET_MAX); - packet_flush(fd); - } else - safe_write(fd, buf->buf, buf->len); -} - -static void insert_one_alternate_ref(const struct ref *ref, void *unused) -{ - rev_list_insert_ref(NULL, ref->old_sha1, 0, NULL); -} - -#define INITIAL_FLUSH 16 -#define PIPESAFE_FLUSH 32 -#define LARGE_FLUSH 1024 - -static int next_flush(int count) -{ - int flush_limit = args.stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH; - - if (count < flush_limit) - count <<= 1; - else - count += flush_limit; - return count; -} - -static int find_common(int fd[2], unsigned char *result_sha1, - struct ref *refs) -{ - int fetching; - int count = 0, flushes = 0, flush_at = INITIAL_FLUSH, retval; - const unsigned char *sha1; - unsigned in_vain = 0; - int got_continue = 0; - int got_ready = 0; - struct strbuf req_buf = STRBUF_INIT; - size_t state_len = 0; - - if (args.stateless_rpc && multi_ack == 1) - die("--stateless-rpc requires multi_ack_detailed"); - if (marked) - for_each_ref(clear_marks, NULL); - marked = 1; - - for_each_ref(rev_list_insert_ref, NULL); - for_each_alternate_ref(insert_one_alternate_ref, NULL); - - fetching = 0; - for ( ; refs ; refs = refs->next) { - unsigned char *remote = refs->old_sha1; - const char *remote_hex; - struct object *o; - - /* - * If that object is complete (i.e. it is an ancestor of a - * local ref), we tell them we have it but do not have to - * tell them about its ancestors, which they already know - * about. - * - * We use lookup_object here because we are only - * interested in the case we *know* the object is - * reachable and we have already scanned it. - */ - if (((o = lookup_object(remote)) != NULL) && - (o->flags & COMPLETE)) { - continue; - } - - remote_hex = sha1_to_hex(remote); - if (!fetching) { - struct strbuf c = STRBUF_INIT; - if (multi_ack == 2) strbuf_addstr(&c, " multi_ack_detailed"); - if (multi_ack == 1) strbuf_addstr(&c, " multi_ack"); - if (no_done) strbuf_addstr(&c, " no-done"); - if (use_sideband == 2) strbuf_addstr(&c, " side-band-64k"); - if (use_sideband == 1) strbuf_addstr(&c, " side-band"); - if (args.use_thin_pack) strbuf_addstr(&c, " thin-pack"); - if (args.no_progress) strbuf_addstr(&c, " no-progress"); - if (args.include_tag) strbuf_addstr(&c, " include-tag"); - if (prefer_ofs_delta) strbuf_addstr(&c, " ofs-delta"); - if (agent_supported) strbuf_addf(&c, " agent=%s", - git_user_agent_sanitized()); - packet_buf_write(&req_buf, "want %s%s\n", remote_hex, c.buf); - strbuf_release(&c); - } else - packet_buf_write(&req_buf, "want %s\n", remote_hex); - fetching++; - } - - if (!fetching) { - strbuf_release(&req_buf); - packet_flush(fd[1]); - return 1; - } - - if (is_repository_shallow()) - write_shallow_commits(&req_buf, 1); - if (args.depth > 0) - packet_buf_write(&req_buf, "deepen %d", args.depth); - packet_buf_flush(&req_buf); - state_len = req_buf.len; - - if (args.depth > 0) { - char line[1024]; - unsigned char sha1[20]; - - send_request(fd[1], &req_buf); - while (packet_read_line(fd[0], line, sizeof(line))) { - if (!prefixcmp(line, "shallow ")) { - if (get_sha1_hex(line + 8, sha1)) - die("invalid shallow line: %s", line); - register_shallow(sha1); - continue; - } - if (!prefixcmp(line, "unshallow ")) { - if (get_sha1_hex(line + 10, sha1)) - die("invalid unshallow line: %s", line); - if (!lookup_object(sha1)) - die("object not found: %s", line); - /* make sure that it is parsed as shallow */ - if (!parse_object(sha1)) - die("error in object: %s", line); - if (unregister_shallow(sha1)) - die("no shallow found: %s", line); - continue; - } - die("expected shallow/unshallow, got %s", line); - } - } else if (!args.stateless_rpc) - send_request(fd[1], &req_buf); - - if (!args.stateless_rpc) { - /* If we aren't using the stateless-rpc interface - * we don't need to retain the headers. - */ - strbuf_setlen(&req_buf, 0); - state_len = 0; - } - - flushes = 0; - retval = -1; - while ((sha1 = get_rev())) { - packet_buf_write(&req_buf, "have %s\n", sha1_to_hex(sha1)); - if (args.verbose) - fprintf(stderr, "have %s\n", sha1_to_hex(sha1)); - in_vain++; - if (flush_at <= ++count) { - int ack; - - packet_buf_flush(&req_buf); - send_request(fd[1], &req_buf); - strbuf_setlen(&req_buf, state_len); - flushes++; - flush_at = next_flush(count); - - /* - * We keep one window "ahead" of the other side, and - * will wait for an ACK only on the next one - */ - if (!args.stateless_rpc && count == INITIAL_FLUSH) - continue; - - consume_shallow_list(fd[0]); - do { - ack = get_ack(fd[0], result_sha1); - if (args.verbose && ack) - fprintf(stderr, "got ack %d %s\n", ack, - sha1_to_hex(result_sha1)); - switch (ack) { - case ACK: - flushes = 0; - multi_ack = 0; - retval = 0; - goto done; - case ACK_common: - case ACK_ready: - case ACK_continue: { - struct commit *commit = - lookup_commit(result_sha1); - if (!commit) - die("invalid commit %s", sha1_to_hex(result_sha1)); - if (args.stateless_rpc - && ack == ACK_common - && !(commit->object.flags & COMMON)) { - /* We need to replay the have for this object - * on the next RPC request so the peer knows - * it is in common with us. - */ - const char *hex = sha1_to_hex(result_sha1); - packet_buf_write(&req_buf, "have %s\n", hex); - state_len = req_buf.len; - } - mark_common(commit, 0, 1); - retval = 0; - in_vain = 0; - got_continue = 1; - if (ack == ACK_ready) { - rev_list = NULL; - got_ready = 1; - } - break; - } - } - } while (ack); - flushes--; - if (got_continue && MAX_IN_VAIN < in_vain) { - if (args.verbose) - fprintf(stderr, "giving up\n"); - break; /* give up */ - } - } - } -done: - if (!got_ready || !no_done) { - packet_buf_write(&req_buf, "done\n"); - send_request(fd[1], &req_buf); - } - if (args.verbose) - fprintf(stderr, "done\n"); - if (retval != 0) { - multi_ack = 0; - flushes++; - } - strbuf_release(&req_buf); - - consume_shallow_list(fd[0]); - while (flushes || multi_ack) { - int ack = get_ack(fd[0], result_sha1); - if (ack) { - if (args.verbose) - fprintf(stderr, "got ack (%d) %s\n", ack, - sha1_to_hex(result_sha1)); - if (ack == ACK) - return 0; - multi_ack = 1; - continue; - } - flushes--; - } - /* it is no error to fetch into a completely empty repo */ - return count ? retval : 0; -} - -static struct commit_list *complete; - -static int mark_complete(const char *refname, const unsigned char *sha1, int flag, void *cb_data) -{ - struct object *o = parse_object(sha1); - - while (o && o->type == OBJ_TAG) { - struct tag *t = (struct tag *) o; - if (!t->tagged) - break; /* broken repository */ - o->flags |= COMPLETE; - o = parse_object(t->tagged->sha1); - } - if (o && o->type == OBJ_COMMIT) { - struct commit *commit = (struct commit *)o; - if (!(commit->object.flags & COMPLETE)) { - commit->object.flags |= COMPLETE; - commit_list_insert_by_date(commit, &complete); - } - } - return 0; -} - -static void mark_recent_complete_commits(unsigned long cutoff) -{ - while (complete && cutoff <= complete->item->date) { - if (args.verbose) - fprintf(stderr, "Marking %s as complete\n", - sha1_to_hex(complete->item->object.sha1)); - pop_most_recent_commit(&complete, COMPLETE); - } -} - -static void filter_refs(struct ref **refs, int nr_match, char **match) -{ - struct ref **return_refs; - struct ref *newlist = NULL; - struct ref **newtail = &newlist; - struct ref *ref, *next; - struct ref *fastarray[32]; - int match_pos; - - if (nr_match && !args.fetch_all) { - if (ARRAY_SIZE(fastarray) < nr_match) - return_refs = xcalloc(nr_match, sizeof(struct ref *)); - else { - return_refs = fastarray; - memset(return_refs, 0, sizeof(struct ref *) * nr_match); - } - } - else - return_refs = NULL; - - match_pos = 0; - for (ref = *refs; ref; ref = next) { - next = ref->next; - if (!memcmp(ref->name, "refs/", 5) && - check_refname_format(ref->name + 5, 0)) - ; /* trash */ - else if (args.fetch_all && - (!args.depth || prefixcmp(ref->name, "refs/tags/") )) { - *newtail = ref; - ref->next = NULL; - newtail = &ref->next; - continue; - } - else { - int cmp = -1; - while (match_pos < nr_match) { - cmp = strcmp(ref->name, match[match_pos]); - if (cmp < 0) /* definitely do not have it */ - break; - else if (cmp == 0) { /* definitely have it */ - match[match_pos][0] = '\0'; - return_refs[match_pos] = ref; - break; - } - else /* might have it; keep looking */ - match_pos++; - } - if (!cmp) - continue; /* we will link it later */ - } - free(ref); - } - - if (!args.fetch_all) { - int i; - for (i = 0; i < nr_match; i++) { - ref = return_refs[i]; - if (ref) { - *newtail = ref; - ref->next = NULL; - newtail = &ref->next; - } - } - if (return_refs != fastarray) - free(return_refs); - } - *refs = newlist; -} - -static void mark_alternate_complete(const struct ref *ref, void *unused) -{ - mark_complete(NULL, ref->old_sha1, 0, NULL); -} - -static int everything_local(struct ref **refs, int nr_match, char **match) -{ - struct ref *ref; - int retval; - unsigned long cutoff = 0; - - save_commit_buffer = 0; - - for (ref = *refs; ref; ref = ref->next) { - struct object *o; - - o = parse_object(ref->old_sha1); - if (!o) - continue; - - /* We already have it -- which may mean that we were - * in sync with the other side at some time after - * that (it is OK if we guess wrong here). - */ - if (o->type == OBJ_COMMIT) { - struct commit *commit = (struct commit *)o; - if (!cutoff || cutoff < commit->date) - cutoff = commit->date; - } - } - - if (!args.depth) { - for_each_ref(mark_complete, NULL); - for_each_alternate_ref(mark_alternate_complete, NULL); - if (cutoff) - mark_recent_complete_commits(cutoff); - } - - /* - * Mark all complete remote refs as common refs. - * Don't mark them common yet; the server has to be told so first. - */ - for (ref = *refs; ref; ref = ref->next) { - struct object *o = deref_tag(lookup_object(ref->old_sha1), - NULL, 0); - - if (!o || o->type != OBJ_COMMIT || !(o->flags & COMPLETE)) - continue; - - if (!(o->flags & SEEN)) { - rev_list_push((struct commit *)o, COMMON_REF | SEEN); - - mark_common((struct commit *)o, 1, 1); - } - } - - filter_refs(refs, nr_match, match); - - for (retval = 1, ref = *refs; ref ; ref = ref->next) { - const unsigned char *remote = ref->old_sha1; - unsigned char local[20]; - struct object *o; - - o = lookup_object(remote); - if (!o || !(o->flags & COMPLETE)) { - retval = 0; - if (!args.verbose) - continue; - fprintf(stderr, - "want %s (%s)\n", sha1_to_hex(remote), - ref->name); - continue; - } - - hashcpy(ref->new_sha1, local); - if (!args.verbose) - continue; - fprintf(stderr, - "already have %s (%s)\n", sha1_to_hex(remote), - ref->name); - } - return retval; -} - -static int sideband_demux(int in, int out, void *data) -{ - int *xd = data; - - int ret = recv_sideband("fetch-pack", xd[0], out); - close(out); - return ret; -} - -static int get_pack(int xd[2], char **pack_lockfile) -{ - struct async demux; - const char *argv[20]; - char keep_arg[256]; - char hdr_arg[256]; - const char **av; - int do_keep = args.keep_pack; - struct child_process cmd; - - memset(&demux, 0, sizeof(demux)); - if (use_sideband) { - /* xd[] is talking with upload-pack; subprocess reads from - * xd[0], spits out band#2 to stderr, and feeds us band#1 - * through demux->out. - */ - demux.proc = sideband_demux; - demux.data = xd; - demux.out = -1; - if (start_async(&demux)) - die("fetch-pack: unable to fork off sideband" - " demultiplexer"); - } - else - demux.out = xd[0]; - - memset(&cmd, 0, sizeof(cmd)); - cmd.argv = argv; - av = argv; - *hdr_arg = 0; - if (!args.keep_pack && unpack_limit) { - struct pack_header header; - - if (read_pack_header(demux.out, &header)) - die("protocol error: bad pack header"); - snprintf(hdr_arg, sizeof(hdr_arg), - "--pack_header=%"PRIu32",%"PRIu32, - ntohl(header.hdr_version), ntohl(header.hdr_entries)); - if (ntohl(header.hdr_entries) < unpack_limit) - do_keep = 0; - else - do_keep = 1; - } - - if (do_keep) { - if (pack_lockfile) - cmd.out = -1; - *av++ = "index-pack"; - *av++ = "--stdin"; - if (!args.quiet && !args.no_progress) - *av++ = "-v"; - if (args.use_thin_pack) - *av++ = "--fix-thin"; - if (args.lock_pack || unpack_limit) { - int s = sprintf(keep_arg, - "--keep=fetch-pack %"PRIuMAX " on ", (uintmax_t) getpid()); - if (gethostname(keep_arg + s, sizeof(keep_arg) - s)) - strcpy(keep_arg + s, "localhost"); - *av++ = keep_arg; - } - } - else { - *av++ = "unpack-objects"; - if (args.quiet || args.no_progress) - *av++ = "-q"; - } - if (*hdr_arg) - *av++ = hdr_arg; - if (fetch_fsck_objects >= 0 - ? fetch_fsck_objects - : transfer_fsck_objects >= 0 - ? transfer_fsck_objects - : 0) - *av++ = "--strict"; - *av++ = NULL; - - cmd.in = demux.out; - cmd.git_cmd = 1; - if (start_command(&cmd)) - die("fetch-pack: unable to fork off %s", argv[0]); - if (do_keep && pack_lockfile) { - *pack_lockfile = index_pack_lockfile(cmd.out); - close(cmd.out); - } - - if (finish_command(&cmd)) - die("%s failed", argv[0]); - if (use_sideband && finish_async(&demux)) - die("error in sideband demultiplexer"); - return 0; -} - -static struct ref *do_fetch_pack(int fd[2], - const struct ref *orig_ref, - int nr_match, - char **match, - char **pack_lockfile) -{ - struct ref *ref = copy_ref_list(orig_ref); - unsigned char sha1[20]; - const char *agent_feature; - int agent_len; - - sort_ref_list(&ref, ref_compare_name); - - if (is_repository_shallow() && !server_supports("shallow")) - die("Server does not support shallow clients"); - if (server_supports("multi_ack_detailed")) { - if (args.verbose) - fprintf(stderr, "Server supports multi_ack_detailed\n"); - multi_ack = 2; - if (server_supports("no-done")) { - if (args.verbose) - fprintf(stderr, "Server supports no-done\n"); - if (args.stateless_rpc) - no_done = 1; - } - } - else if (server_supports("multi_ack")) { - if (args.verbose) - fprintf(stderr, "Server supports multi_ack\n"); - multi_ack = 1; - } - if (server_supports("side-band-64k")) { - if (args.verbose) - fprintf(stderr, "Server supports side-band-64k\n"); - use_sideband = 2; - } - else if (server_supports("side-band")) { - if (args.verbose) - fprintf(stderr, "Server supports side-band\n"); - use_sideband = 1; - } - if (!server_supports("thin-pack")) - args.use_thin_pack = 0; - if (!server_supports("no-progress")) - args.no_progress = 0; - if (!server_supports("include-tag")) - args.include_tag = 0; - if (server_supports("ofs-delta")) { - if (args.verbose) - fprintf(stderr, "Server supports ofs-delta\n"); - } else - prefer_ofs_delta = 0; - - if ((agent_feature = server_feature_value("agent", &agent_len))) { - agent_supported = 1; - if (args.verbose && agent_len) - fprintf(stderr, "Server version is %.*s\n", - agent_len, agent_feature); - } - - if (everything_local(&ref, nr_match, match)) { - packet_flush(fd[1]); - goto all_done; - } - if (find_common(fd, sha1, ref) < 0) - if (!args.keep_pack) - /* When cloning, it is not unusual to have - * no common commit. - */ - warning("no common commits"); - - if (args.stateless_rpc) - packet_flush(fd[1]); - if (get_pack(fd, pack_lockfile)) - die("git fetch-pack: fetch failed."); - - all_done: - return ref; -} - -static int remove_duplicates(int nr_heads, char **heads) -{ - int src, dst; - - if (!nr_heads) - return 0; - - for (src = dst = 1; src < nr_heads; src++) - if (strcmp(heads[src], heads[dst-1])) - heads[dst++] = heads[src]; - return dst; -} - -static int fetch_pack_config(const char *var, const char *value, void *cb) -{ - if (strcmp(var, "fetch.unpacklimit") == 0) { - fetch_unpack_limit = git_config_int(var, value); - return 0; - } - - if (strcmp(var, "transfer.unpacklimit") == 0) { - transfer_unpack_limit = git_config_int(var, value); - return 0; - } - - if (strcmp(var, "repack.usedeltabaseoffset") == 0) { - prefer_ofs_delta = git_config_bool(var, value); - return 0; - } - - if (!strcmp(var, "fetch.fsckobjects")) { - fetch_fsck_objects = git_config_bool(var, value); - return 0; - } - - if (!strcmp(var, "transfer.fsckobjects")) { - transfer_fsck_objects = git_config_bool(var, value); - return 0; - } - - return git_default_config(var, value, cb); -} - -static struct lock_file lock; - -static void fetch_pack_setup(void) -{ - static int did_setup; - if (did_setup) - return; - git_config(fetch_pack_config, NULL); - if (0 <= transfer_unpack_limit) - unpack_limit = transfer_unpack_limit; - else if (0 <= fetch_unpack_limit) - unpack_limit = fetch_unpack_limit; - did_setup = 1; -} - int cmd_fetch_pack(int argc, const char **argv, const char *prefix) { int i, ret; struct ref *ref = NULL; const char *dest = NULL; - int alloc_heads = 0, nr_heads = 0; - char **heads = NULL; + struct string_list sought = STRING_LIST_INIT_DUP; int fd[2]; char *pack_lockfile = NULL; char **pack_lockfile_ptr = NULL; struct child_process *conn; + struct fetch_pack_args args; packet_trace_identity("fetch-pack"); + memset(&args, 0, sizeof(args)); + args.uploadpack = "git-upload-pack"; + for (i = 1; i < argc && *argv[i] == '-'; i++) { const char *arg = argv[i]; @@ -1000,9 +93,8 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) * Copy refs from cmdline to growable list, then append any * refs from the standard input: */ - ALLOC_GROW(heads, argc - i, alloc_heads); for (; i < argc; i++) - heads[nr_heads++] = xstrdup(argv[i]); + string_list_append(&sought, xstrdup(argv[i])); if (args.stdin_refs) { if (args.stateless_rpc) { /* in stateless RPC mode we use pkt-line to read @@ -1015,17 +107,14 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) break; if (line[n-1] == '\n') n--; - ALLOC_GROW(heads, nr_heads + 1, alloc_heads); - heads[nr_heads++] = xmemdupz(line, n); + string_list_append(&sought, xmemdupz(line, n)); } } else { /* read from stdin one ref per line, until EOF */ struct strbuf line = STRBUF_INIT; - while (strbuf_getline(&line, stdin, '\n') != EOF) { - ALLOC_GROW(heads, nr_heads + 1, alloc_heads); - heads[nr_heads++] = strbuf_detach(&line, NULL); - } + while (strbuf_getline(&line, stdin, '\n') != EOF) + string_list_append(&sought, strbuf_detach(&line, NULL)); strbuf_release(&line); } } @@ -1042,7 +131,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) get_remote_heads(fd[0], &ref, 0, NULL); ref = fetch_pack(&args, fd, conn, ref, dest, - nr_heads, heads, pack_lockfile_ptr); + &sought, pack_lockfile_ptr); if (pack_lockfile) { printf("lock %s\n", pack_lockfile); fflush(stdout); @@ -1050,21 +139,18 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) close(fd[0]); close(fd[1]); if (finish_connect(conn)) - ref = NULL; - ret = !ref; + return 1; - if (!ret && nr_heads) { - /* If the heads to pull were given, we should have - * consumed all of them by matching the remote. - * Otherwise, 'git fetch remote no-such-ref' would - * silently succeed without issuing an error. - */ - for (i = 0; i < nr_heads; i++) - if (heads[i] && heads[i][0]) { - error("no such remote ref %s", heads[i]); - ret = 1; - } - } + ret = !ref || sought.nr; + + /* + * If the heads to pull were given, we should have consumed + * all of them by matching the remote. Otherwise, 'git fetch + * remote no-such-ref' would silently succeed without issuing + * an error. + */ + for (i = 0; i < sought.nr; i++) + error("no such remote ref %s", sought.items[i].string); while (ref) { printf("%s %s\n", sha1_to_hex(ref->old_sha1), ref->name); @@ -1073,72 +159,3 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix) return ret; } - -static int compare_heads(const void *a, const void *b) -{ - return strcmp(*(const char **)a, *(const char **)b); -} - -struct ref *fetch_pack(struct fetch_pack_args *my_args, - int fd[], struct child_process *conn, - const struct ref *ref, - const char *dest, - int nr_heads, - char **heads, - char **pack_lockfile) -{ - struct stat st; - struct ref *ref_cpy; - - fetch_pack_setup(); - if (&args != my_args) - memcpy(&args, my_args, sizeof(args)); - if (args.depth > 0) { - if (stat(git_path("shallow"), &st)) - st.st_mtime = 0; - } - - if (heads && nr_heads) { - qsort(heads, nr_heads, sizeof(*heads), compare_heads); - nr_heads = remove_duplicates(nr_heads, heads); - } - - if (!ref) { - packet_flush(fd[1]); - die("no matching remote head"); - } - ref_cpy = do_fetch_pack(fd, ref, nr_heads, heads, pack_lockfile); - - if (args.depth > 0) { - struct cache_time mtime; - struct strbuf sb = STRBUF_INIT; - char *shallow = git_path("shallow"); - int fd; - - mtime.sec = st.st_mtime; - mtime.nsec = ST_MTIME_NSEC(st); - if (stat(shallow, &st)) { - if (mtime.sec) - die("shallow file was removed during fetch"); - } else if (st.st_mtime != mtime.sec -#ifdef USE_NSEC - || ST_MTIME_NSEC(st) != mtime.nsec -#endif - ) - die("shallow file was changed during fetch"); - - fd = hold_lock_file_for_update(&lock, shallow, - LOCK_DIE_ON_ERROR); - if (!write_shallow_commits(&sb, 0) - || write_in_full(fd, sb.buf, sb.len) != sb.len) { - unlink_or_warn(shallow); - rollback_lock_file(&lock); - } else { - commit_lock_file(&lock); - } - strbuf_release(&sb); - } - - reprepare_packed_git(); - return ref_cpy; -} diff --git a/builtin/fetch.c b/builtin/fetch.c index d0dcc8888f..4b5a89839b 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -256,9 +256,8 @@ static int update_local_ref(struct ref *ref, if (!hashcmp(ref->old_sha1, ref->new_sha1)) { if (verbosity > 0) strbuf_addf(display, "= %-*s %-*s -> %s", - TRANSPORT_SUMMARY_WIDTH, - _("[up to date]"), REFCOL_WIDTH, - remote, pretty_ref); + TRANSPORT_SUMMARY(_("[up to date]")), + REFCOL_WIDTH, remote, pretty_ref); return 0; } @@ -272,7 +271,7 @@ static int update_local_ref(struct ref *ref, */ strbuf_addf(display, _("! %-*s %-*s -> %s (can't fetch in current branch)"), - TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), + TRANSPORT_SUMMARY(_("[rejected]")), REFCOL_WIDTH, remote, pretty_ref); return 1; } @@ -283,7 +282,7 @@ static int update_local_ref(struct ref *ref, r = s_update_ref("updating tag", ref, 0); strbuf_addf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-', - TRANSPORT_SUMMARY_WIDTH, _("[tag update]"), + TRANSPORT_SUMMARY(_("[tag update]")), REFCOL_WIDTH, remote, pretty_ref, r ? _(" (unable to update local ref)") : ""); return r; @@ -318,7 +317,7 @@ static int update_local_ref(struct ref *ref, r = s_update_ref(msg, ref, 0); strbuf_addf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '*', - TRANSPORT_SUMMARY_WIDTH, what, + TRANSPORT_SUMMARY(what), REFCOL_WIDTH, remote, pretty_ref, r ? _(" (unable to update local ref)") : ""); return r; @@ -358,7 +357,7 @@ static int update_local_ref(struct ref *ref, return r; } else { strbuf_addf(display, "! %-*s %-*s -> %s %s", - TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), + TRANSPORT_SUMMARY(_("[rejected]")), REFCOL_WIDTH, remote, pretty_ref, _("(non-fast-forward)")); return 1; @@ -555,7 +554,7 @@ static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map) result |= delete_ref(ref->name, NULL, 0); if (verbosity >= 0) { fprintf(stderr, " x %-*s %-*s -> %s\n", - TRANSPORT_SUMMARY_WIDTH, _("[deleted]"), + TRANSPORT_SUMMARY(_("[deleted]")), REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name)); warn_dangling_symref(stderr, dangling_msg, ref->name); } diff --git a/builtin/gc.c b/builtin/gc.c index 6d46608fc9..6be6c8d65b 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -217,9 +217,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) */ if (!need_to_gc()) return 0; - if (quiet) - fprintf(stderr, _("Auto packing the repository for optimum performance.\n")); - else + if (!quiet) fprintf(stderr, _("Auto packing the repository for optimum performance. You may also\n" "run \"git gc\" manually. See " diff --git a/builtin/grep.c b/builtin/grep.c index 09ca4c980e..0e1b6c860e 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -86,7 +86,7 @@ static pthread_cond_t cond_result; static int skip_first_line; static void add_work(struct grep_opt *opt, enum grep_source_type type, - const char *name, const void *id) + const char *name, const char *path, const void *id) { grep_lock(); @@ -94,7 +94,7 @@ static void add_work(struct grep_opt *opt, enum grep_source_type type, pthread_cond_wait(&cond_write, &grep_mutex); } - grep_source_init(&todo[todo_end].source, type, name, id); + grep_source_init(&todo[todo_end].source, type, name, path, id); if (opt->binary != GREP_BINARY_TEXT) grep_source_load_driver(&todo[todo_end].source); todo[todo_end].done = 0; @@ -209,6 +209,7 @@ static void start_threads(struct grep_opt *opt) int err; struct grep_opt *o = grep_opt_dup(opt); o->output = strbuf_out; + o->debug = 0; compile_grep_patterns(o); err = pthread_create(&threads[i], NULL, run, o); @@ -260,103 +261,12 @@ static int wait_all(void) } #endif -static int parse_pattern_type_arg(const char *opt, const char *arg) +static int grep_cmd_config(const char *var, const char *value, void *cb) { - if (!strcmp(arg, "default")) - return GREP_PATTERN_TYPE_UNSPECIFIED; - else if (!strcmp(arg, "basic")) - return GREP_PATTERN_TYPE_BRE; - else if (!strcmp(arg, "extended")) - return GREP_PATTERN_TYPE_ERE; - else if (!strcmp(arg, "fixed")) - return GREP_PATTERN_TYPE_FIXED; - else if (!strcmp(arg, "perl")) - return GREP_PATTERN_TYPE_PCRE; - die("bad %s argument: %s", opt, arg); -} - -static void grep_pattern_type_options(const int pattern_type, struct grep_opt *opt) -{ - switch (pattern_type) { - case GREP_PATTERN_TYPE_UNSPECIFIED: - /* fall through */ - - case GREP_PATTERN_TYPE_BRE: - opt->fixed = 0; - opt->pcre = 0; - opt->regflags &= ~REG_EXTENDED; - break; - - case GREP_PATTERN_TYPE_ERE: - opt->fixed = 0; - opt->pcre = 0; - opt->regflags |= REG_EXTENDED; - break; - - case GREP_PATTERN_TYPE_FIXED: - opt->fixed = 1; - opt->pcre = 0; - opt->regflags &= ~REG_EXTENDED; - break; - - case GREP_PATTERN_TYPE_PCRE: - opt->fixed = 0; - opt->pcre = 1; - opt->regflags &= ~REG_EXTENDED; - break; - } -} - -static int grep_config(const char *var, const char *value, void *cb) -{ - struct grep_opt *opt = cb; - char *color = NULL; - - if (userdiff_config(var, value) < 0) - return -1; - - if (!strcmp(var, "grep.extendedregexp")) { - if (git_config_bool(var, value)) - opt->extended_regexp_option = 1; - else - opt->extended_regexp_option = 0; - return 0; - } - - if (!strcmp(var, "grep.patterntype")) { - opt->pattern_type_option = parse_pattern_type_arg(var, value); - return 0; - } - - if (!strcmp(var, "grep.linenumber")) { - opt->linenum = git_config_bool(var, value); - return 0; - } - - if (!strcmp(var, "color.grep")) - opt->color = git_config_colorbool(var, value); - else if (!strcmp(var, "color.grep.context")) - color = opt->color_context; - else if (!strcmp(var, "color.grep.filename")) - color = opt->color_filename; - else if (!strcmp(var, "color.grep.function")) - color = opt->color_function; - else if (!strcmp(var, "color.grep.linenumber")) - color = opt->color_lineno; - else if (!strcmp(var, "color.grep.match")) - color = opt->color_match; - else if (!strcmp(var, "color.grep.selected")) - color = opt->color_selected; - else if (!strcmp(var, "color.grep.separator")) - color = opt->color_sep; - else - return git_color_default_config(var, value, cb); - if (color) { - if (!value) - return config_error_nonbool(var); - color_parse(value, var, color); - } - return 0; + int st = grep_config(var, value, cb); + if (git_color_default_config(var, value, cb) < 0) + st = -1; + return st; } static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size) @@ -370,7 +280,8 @@ static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type } static int grep_sha1(struct grep_opt *opt, const unsigned char *sha1, - const char *filename, int tree_name_len) + const char *filename, int tree_name_len, + const char *path) { struct strbuf pathbuf = STRBUF_INIT; @@ -384,7 +295,7 @@ static int grep_sha1(struct grep_opt *opt, const unsigned char *sha1, #ifndef NO_PTHREADS if (use_threads) { - add_work(opt, GREP_SOURCE_SHA1, pathbuf.buf, sha1); + add_work(opt, GREP_SOURCE_SHA1, pathbuf.buf, path, sha1); strbuf_release(&pathbuf); return 0; } else @@ -393,7 +304,7 @@ static int grep_sha1(struct grep_opt *opt, const unsigned char *sha1, struct grep_source gs; int hit; - grep_source_init(&gs, GREP_SOURCE_SHA1, pathbuf.buf, sha1); + grep_source_init(&gs, GREP_SOURCE_SHA1, pathbuf.buf, path, sha1); strbuf_release(&pathbuf); hit = grep_source(opt, &gs); @@ -413,7 +324,7 @@ static int grep_file(struct grep_opt *opt, const char *filename) #ifndef NO_PTHREADS if (use_threads) { - add_work(opt, GREP_SOURCE_FILE, buf.buf, filename); + add_work(opt, GREP_SOURCE_FILE, buf.buf, filename, filename); strbuf_release(&buf); return 0; } else @@ -422,7 +333,7 @@ static int grep_file(struct grep_opt *opt, const char *filename) struct grep_source gs; int hit; - grep_source_init(&gs, GREP_SOURCE_FILE, buf.buf, filename); + grep_source_init(&gs, GREP_SOURCE_FILE, buf.buf, filename, filename); strbuf_release(&buf); hit = grep_source(opt, &gs); @@ -478,7 +389,7 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int if (cached || (ce->ce_flags & CE_VALID) || ce_skip_worktree(ce)) { if (ce_stage(ce)) continue; - hit |= grep_sha1(opt, ce->sha1, ce->name, 0); + hit |= grep_sha1(opt, ce->sha1, ce->name, 0, ce->name); } else hit |= grep_file(opt, ce->name); @@ -496,7 +407,8 @@ static int grep_cache(struct grep_opt *opt, const struct pathspec *pathspec, int } static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec, - struct tree_desc *tree, struct strbuf *base, int tn_len) + struct tree_desc *tree, struct strbuf *base, int tn_len, + int check_attr) { int hit = 0; enum interesting match = entry_not_interesting; @@ -517,7 +429,8 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec, strbuf_add(base, entry.path, te_len); if (S_ISREG(entry.mode)) { - hit |= grep_sha1(opt, entry.sha1, base->buf, tn_len); + hit |= grep_sha1(opt, entry.sha1, base->buf, tn_len, + check_attr ? base->buf + tn_len : NULL); } else if (S_ISDIR(entry.mode)) { enum object_type type; @@ -532,7 +445,8 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec, strbuf_addch(base, '/'); init_tree_desc(&sub, data, size); - hit |= grep_tree(opt, pathspec, &sub, base, tn_len); + hit |= grep_tree(opt, pathspec, &sub, base, tn_len, + check_attr); free(data); } strbuf_setlen(base, old_baselen); @@ -547,7 +461,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec, struct object *obj, const char *name) { if (obj->type == OBJ_BLOB) - return grep_sha1(opt, obj->sha1, name, 0); + return grep_sha1(opt, obj->sha1, name, 0, NULL); if (obj->type == OBJ_COMMIT || obj->type == OBJ_TREE) { struct tree_desc tree; void *data; @@ -570,7 +484,8 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec, strbuf_addch(&base, ':'); } init_tree_desc(&tree, data, size); - hit = grep_tree(opt, pathspec, &tree, &base, base.len); + hit = grep_tree(opt, pathspec, &tree, &base, base.len, + obj->type == OBJ_COMMIT); strbuf_release(&base); free(data); return hit; @@ -817,6 +732,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) N_("indicate hit with exit status without output")), OPT_BOOLEAN(0, "all-match", &opt.all_match, N_("show only matches from files that match all patterns")), + { OPTION_SET_INT, 0, "debug", &opt.debug, NULL, + N_("show parse tree for grep expression"), + PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1 }, OPT_GROUP(""), { OPTION_STRING, 'O', "open-files-in-pager", &show_in_pager, N_("pager"), N_("show matching files in the pager"), @@ -835,27 +753,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (argc == 2 && !strcmp(argv[1], "-h")) usage_with_options(grep_usage, options); - memset(&opt, 0, sizeof(opt)); - opt.prefix = prefix; - opt.prefix_length = (prefix && *prefix) ? strlen(prefix) : 0; - opt.relative = 1; - opt.pathname = 1; - opt.pattern_tail = &opt.pattern_list; - opt.header_tail = &opt.header_list; - opt.regflags = REG_NEWLINE; - opt.max_depth = -1; - opt.pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED; - opt.extended_regexp_option = 0; - - strcpy(opt.color_context, ""); - strcpy(opt.color_filename, ""); - strcpy(opt.color_function, ""); - strcpy(opt.color_lineno, ""); - strcpy(opt.color_match, GIT_COLOR_BOLD_RED); - strcpy(opt.color_selected, ""); - strcpy(opt.color_sep, GIT_COLOR_CYAN); - opt.color = -1; - git_config(grep_config, &opt); + init_grep_defaults(); + git_config(grep_cmd_config, NULL); + grep_init(&opt, prefix); /* * If there is no -- then the paths must exist in the working @@ -871,13 +771,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) PARSE_OPT_KEEP_DASHDASH | PARSE_OPT_STOP_AT_NON_OPTION | PARSE_OPT_NO_INTERNAL_HELP); - - if (pattern_type_arg != GREP_PATTERN_TYPE_UNSPECIFIED) - grep_pattern_type_options(pattern_type_arg, &opt); - else if (opt.pattern_type_option != GREP_PATTERN_TYPE_UNSPECIFIED) - grep_pattern_type_options(opt.pattern_type_option, &opt); - else if (opt.extended_regexp_option) - grep_pattern_type_options(GREP_PATTERN_TYPE_ERE, &opt); + grep_commit_pattern_type(pattern_type_arg, &opt); if (use_index && !startup_info->have_repository) /* die the same way as if we did it at the beginning */ diff --git a/builtin/log.c b/builtin/log.c index 09cf43e6d4..e7b7db1cac 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -351,7 +351,8 @@ static int git_log_config(const char *var, const char *value, void *cb) } if (!prefixcmp(var, "color.decorate.")) return parse_decorate_color_config(var, 15, value); - + if (grep_config(var, value, cb) < 0) + return -1; return git_diff_ui_config(var, value, cb); } @@ -360,6 +361,7 @@ int cmd_whatchanged(int argc, const char **argv, const char *prefix) struct rev_info rev; struct setup_revision_opt opt; + init_grep_defaults(); git_config(git_log_config, NULL); init_revisions(&rev, prefix); @@ -450,6 +452,7 @@ int cmd_show(int argc, const char **argv, const char *prefix) struct pathspec match_all; int i, count, ret = 0; + init_grep_defaults(); git_config(git_log_config, NULL); init_pathspec(&match_all, NULL); @@ -530,6 +533,7 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix) struct rev_info rev; struct setup_revision_opt opt; + init_grep_defaults(); git_config(git_log_config, NULL); init_revisions(&rev, prefix); @@ -552,6 +556,7 @@ int cmd_log(int argc, const char **argv, const char *prefix) struct rev_info rev; struct setup_revision_opt opt; + init_grep_defaults(); git_config(git_log_config, NULL); init_revisions(&rev, prefix); @@ -1121,6 +1126,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) extra_hdr.strdup_strings = 1; extra_to.strdup_strings = 1; extra_cc.strdup_strings = 1; + init_grep_defaults(); git_config(git_format_config, NULL); init_revisions(&rev, prefix); rev.commit_format = CMIT_FMT_EMAIL; diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c index b691b77158..24a772d8e1 100644 --- a/builtin/mailinfo.c +++ b/builtin/mailinfo.c @@ -19,9 +19,6 @@ static struct strbuf email = STRBUF_INIT; static enum { TE_DONTCARE, TE_QP, TE_BASE64 } transfer_encoding; -static enum { - TYPE_TEXT, TYPE_OTHER -} message_type; static struct strbuf charset = STRBUF_INIT; static int patch_lines; @@ -160,10 +157,9 @@ static int slurp_attr(const char *line, const char *name, struct strbuf *attr) const char *ends, *ap = strcasestr(line, name); size_t sz; - if (!ap) { - strbuf_setlen(attr, 0); + strbuf_setlen(attr, 0); + if (!ap) return 0; - } ap += strlen(name); if (*ap == '"') { ap++; @@ -185,8 +181,6 @@ static void handle_content_type(struct strbuf *line) struct strbuf *boundary = xmalloc(sizeof(struct strbuf)); strbuf_init(boundary, line->len); - if (!strcasestr(line->buf, "text/")) - message_type = TYPE_OTHER; if (slurp_attr(line->buf, "boundary=", boundary)) { strbuf_insert(boundary, 0, "--", 2); if (++content_top > &content[MAX_BOUNDARIES]) { @@ -489,7 +483,8 @@ static void convert_to_utf8(struct strbuf *line, const char *charset) if (!charset || !*charset) return; - if (!strcasecmp(metainfo_charset, charset)) + + if (same_encoding(metainfo_charset, charset)) return; out = reencode_string(line->buf, metainfo_charset, charset); if (!out) @@ -658,7 +653,6 @@ static int handle_boundary(void) /* set some defaults */ transfer_encoding = TE_DONTCARE; strbuf_reset(&charset); - message_type = TYPE_TEXT; /* slurp in this section's info */ while (read_one_header_line(&line, fin)) @@ -872,11 +866,6 @@ static void handle_body(void) strbuf_insert(&line, 0, prev.buf, prev.len); strbuf_reset(&prev); - /* binary data most likely doesn't have newlines */ - if (message_type != TYPE_TEXT) { - handle_filter(&line); - break; - } /* * This is a decoded line that may contain * multiple new lines. Pass only one chunk diff --git a/builtin/merge.c b/builtin/merge.c index 0ec8f0d449..a96e8eac19 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -628,59 +628,6 @@ static void write_tree_trivial(unsigned char *sha1) die(_("git write-tree failed to write a tree")); } -static const char *merge_argument(struct commit *commit) -{ - if (commit) - return sha1_to_hex(commit->object.sha1); - else - return EMPTY_TREE_SHA1_HEX; -} - -int try_merge_command(const char *strategy, size_t xopts_nr, - const char **xopts, struct commit_list *common, - const char *head_arg, struct commit_list *remotes) -{ - const char **args; - int i = 0, x = 0, ret; - struct commit_list *j; - struct strbuf buf = STRBUF_INIT; - - args = xmalloc((4 + xopts_nr + commit_list_count(common) + - commit_list_count(remotes)) * sizeof(char *)); - strbuf_addf(&buf, "merge-%s", strategy); - args[i++] = buf.buf; - for (x = 0; x < xopts_nr; x++) { - char *s = xmalloc(strlen(xopts[x])+2+1); - strcpy(s, "--"); - strcpy(s+2, xopts[x]); - args[i++] = s; - } - for (j = common; j; j = j->next) - args[i++] = xstrdup(merge_argument(j->item)); - args[i++] = "--"; - args[i++] = head_arg; - for (j = remotes; j; j = j->next) - args[i++] = xstrdup(merge_argument(j->item)); - args[i] = NULL; - ret = run_command_v_opt(args, RUN_GIT_CMD); - strbuf_release(&buf); - i = 1; - for (x = 0; x < xopts_nr; x++) - free((void *)args[i++]); - for (j = common; j; j = j->next) - free((void *)args[i++]); - i += 2; - for (j = remotes; j; j = j->next) - free((void *)args[i++]); - free(args); - discard_cache(); - if (read_cache() < 0) - die(_("failed to read the cache")); - resolve_undo_clear(); - - return ret; -} - static int try_merge_strategy(const char *strategy, struct commit_list *common, struct commit_list *remoteheads, struct commit *head, const char *head_arg) @@ -762,56 +709,6 @@ static int count_unmerged_entries(void) return ret; } -int checkout_fast_forward(const unsigned char *head, const unsigned char *remote) -{ - struct tree *trees[MAX_UNPACK_TREES]; - struct unpack_trees_options opts; - struct tree_desc t[MAX_UNPACK_TREES]; - int i, fd, nr_trees = 0; - struct dir_struct dir; - struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); - - refresh_cache(REFRESH_QUIET); - - fd = hold_locked_index(lock_file, 1); - - memset(&trees, 0, sizeof(trees)); - memset(&opts, 0, sizeof(opts)); - memset(&t, 0, sizeof(t)); - if (overwrite_ignore) { - memset(&dir, 0, sizeof(dir)); - dir.flags |= DIR_SHOW_IGNORED; - setup_standard_excludes(&dir); - opts.dir = &dir; - } - - opts.head_idx = 1; - opts.src_index = &the_index; - opts.dst_index = &the_index; - opts.update = 1; - opts.verbose_update = 1; - opts.merge = 1; - opts.fn = twoway_merge; - setup_unpack_trees_porcelain(&opts, "merge"); - - trees[nr_trees] = parse_tree_indirect(head); - if (!trees[nr_trees++]) - return -1; - trees[nr_trees] = parse_tree_indirect(remote); - if (!trees[nr_trees++]) - return -1; - for (i = 0; i < nr_trees; i++) { - parse_tree(trees[i]); - init_tree_desc(t+i, trees[i]->buffer, trees[i]->size); - } - if (unpack_trees(nr_trees, t, &opts)) - return -1; - if (write_cache(fd, active_cache, active_nr) || - commit_locked_index(lock_file)) - die(_("unable to write new index file")); - return 0; -} - static void split_merge_strategies(const char *string, struct strategy **list, int *nr, int *alloc) { @@ -1424,7 +1321,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix) } if (checkout_fast_forward(head_commit->object.sha1, - commit->object.sha1)) { + commit->object.sha1, + overwrite_ignore)) { ret = 1; goto done; } diff --git a/builtin/notes.c b/builtin/notes.c index 554c80167c..453457adb9 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -19,6 +19,9 @@ #include "string-list.h" #include "notes-merge.h" +static void commit_notes(struct notes_tree *t, const char *msg); +static combine_notes_fn parse_combine_notes_fn(const char *v); + static const char * const git_notes_usage[] = { N_("git notes [--ref ] [list []]"), N_("git notes [--ref ] add [-f] [-m | -F | (-c | -C) ] []"), @@ -288,7 +291,7 @@ static int parse_reedit_arg(const struct option *opt, const char *arg, int unset return parse_reuse_arg(opt, arg, unset); } -void commit_notes(struct notes_tree *t, const char *msg) +static void commit_notes(struct notes_tree *t, const char *msg) { struct strbuf buf = STRBUF_INIT; unsigned char commit_sha1[20]; @@ -312,7 +315,7 @@ void commit_notes(struct notes_tree *t, const char *msg) strbuf_release(&buf); } -combine_notes_fn parse_combine_notes_fn(const char *v) +static combine_notes_fn parse_combine_notes_fn(const char *v) { if (!strcasecmp(v, "overwrite")) return combine_notes_overwrite; diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 5e14064094..f069462cb0 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -2033,7 +2033,6 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo if (!prefixcmp(path, "refs/tags/") && /* is a tag? */ !peel_ref(path, peeled) && /* peelable? */ - !is_null_sha1(peeled) && /* annotated tag? */ locate_object_entry(peeled)) /* object packed? */ add_object_entry(sha1, OBJ_TAG, NULL, 0); return 0; diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 9145f1a595..ff781febca 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -695,7 +695,7 @@ static void execute_commands(struct command *commands, const char *unpacker_erro if (unpacker_error) { for (cmd = commands; cmd; cmd = cmd->next) - cmd->error_string = "n/a (unpacker error)"; + cmd->error_string = "unpacker error"; return; } @@ -795,7 +795,7 @@ static const char *parse_pack_header(struct pack_header *hdr) static const char *pack_lockfile; -static const char *unpack(void) +static const char *unpack(int err_fd) { struct pack_header hdr; const char *hdr_err; @@ -815,6 +815,7 @@ static const char *unpack(void) if (ntohl(hdr.hdr_entries) < unpack_limit) { int code, i = 0; + struct child_process child; const char *unpacker[5]; unpacker[i++] = "unpack-objects"; if (quiet) @@ -823,7 +824,12 @@ static const char *unpack(void) unpacker[i++] = "--strict"; unpacker[i++] = hdr_arg; unpacker[i++] = NULL; - code = run_command_v_opt(unpacker, RUN_GIT_CMD); + memset(&child, 0, sizeof(child)); + child.argv = unpacker; + child.no_stdout = 1; + child.err = err_fd; + child.git_cmd = 1; + code = run_command(&child); if (!code) return NULL; return "unpack-objects abnormal exit"; @@ -848,6 +854,7 @@ static const char *unpack(void) memset(&ip, 0, sizeof(ip)); ip.argv = keeper; ip.out = -1; + ip.err = err_fd; ip.git_cmd = 1; status = start_command(&ip); if (status) { @@ -864,6 +871,26 @@ static const char *unpack(void) } } +static const char *unpack_with_sideband(void) +{ + struct async muxer; + const char *ret; + + if (!use_sideband) + return unpack(0); + + memset(&muxer, 0, sizeof(muxer)); + muxer.proc = copy_to_sideband; + muxer.in = -1; + if (start_async(&muxer)) + return NULL; + + ret = unpack(muxer.in); + + finish_async(&muxer); + return ret; +} + static void report(struct command *commands, const char *unpack_status) { struct command *cmd; @@ -961,7 +988,7 @@ int cmd_receive_pack(int argc, const char **argv, const char *prefix) const char *unpack_status = NULL; if (!delete_only(commands)) - unpack_status = unpack(); + unpack_status = unpack_with_sideband(); execute_commands(commands, unpack_status); if (pack_lockfile) unlink_or_warn(pack_lockfile); diff --git a/builtin/rev-list.c b/builtin/rev-list.c index ff5a38372d..67701be551 100644 --- a/builtin/rev-list.c +++ b/builtin/rev-list.c @@ -201,55 +201,6 @@ static void show_edge(struct commit *commit) printf("-%s\n", sha1_to_hex(commit->object.sha1)); } -static inline int log2i(int n) -{ - int log2 = 0; - - for (; n > 1; n >>= 1) - log2++; - - return log2; -} - -static inline int exp2i(int n) -{ - return 1 << n; -} - -/* - * Estimate the number of bisect steps left (after the current step) - * - * For any x between 0 included and 2^n excluded, the probability for - * n - 1 steps left looks like: - * - * P(2^n + x) == (2^n - x) / (2^n + x) - * - * and P(2^n + x) < 0.5 means 2^n < 3x - */ -int estimate_bisect_steps(int all) -{ - int n, x, e; - - if (all < 3) - return 0; - - n = log2i(all); - e = exp2i(n); - x = all - e; - - return (e < 3 * x) ? n : n - 1; -} - -void print_commit_list(struct commit_list *list, - const char *format_cur, - const char *format_last) -{ - for ( ; list; list = list->next) { - const char *format = list->next ? format_cur : format_last; - printf(format, sha1_to_hex(list->item->object.sha1)); - } -} - static void print_var_str(const char *var, const char *val) { printf("%s='%s'\n", var, val); diff --git a/builtin/rm.c b/builtin/rm.c index b384c4c3cf..2aea3b5653 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -9,6 +9,7 @@ #include "cache-tree.h" #include "tree-walk.h" #include "parse-options.h" +#include "submodule.h" static const char * const builtin_rm_usage[] = { N_("git rm [options] [--] ..."), @@ -17,9 +18,58 @@ static const char * const builtin_rm_usage[] = { static struct { int nr, alloc; - const char **name; + struct { + const char *name; + char is_submodule; + } *entry; } list; +static int get_ours_cache_pos(const char *path, int pos) +{ + int i = -pos - 1; + + while ((i < active_nr) && !strcmp(active_cache[i]->name, path)) { + if (ce_stage(active_cache[i]) == 2) + return i; + i++; + } + return -1; +} + +static int check_submodules_use_gitfiles(void) +{ + int i; + int errs = 0; + + for (i = 0; i < list.nr; i++) { + const char *name = list.entry[i].name; + int pos; + struct cache_entry *ce; + struct stat st; + + pos = cache_name_pos(name, strlen(name)); + if (pos < 0) { + pos = get_ours_cache_pos(name, pos); + if (pos < 0) + continue; + } + ce = active_cache[pos]; + + if (!S_ISGITLINK(ce->ce_mode) || + (lstat(ce->name, &st) < 0) || + is_empty_dir(name)) + continue; + + if (!submodule_uses_gitfile(name)) + errs = error(_("submodule '%s' (or one of its nested " + "submodules) uses a .git directory\n" + "(use 'rm -rf' if you really want to remove " + "it including all of its history)"), name); + } + + return errs; +} + static int check_local_mod(unsigned char *head, int index_only) { /* @@ -37,15 +87,26 @@ static int check_local_mod(unsigned char *head, int index_only) struct stat st; int pos; struct cache_entry *ce; - const char *name = list.name[i]; + const char *name = list.entry[i].name; unsigned char sha1[20]; unsigned mode; int local_changes = 0; int staged_changes = 0; pos = cache_name_pos(name, strlen(name)); - if (pos < 0) - continue; /* removing unmerged entry */ + if (pos < 0) { + /* + * Skip unmerged entries except for populated submodules + * that could lose history when removed. + */ + pos = get_ours_cache_pos(name, pos); + if (pos < 0) + continue; + + if (!S_ISGITLINK(active_cache[pos]->ce_mode) || + is_empty_dir(name)) + continue; + } ce = active_cache[pos]; if (lstat(ce->name, &st) < 0) { @@ -58,9 +119,10 @@ static int check_local_mod(unsigned char *head, int index_only) /* if a file was removed and it is now a * directory, that is the same as ENOENT as * far as git is concerned; we do not track - * directories. + * directories unless they are submodules. */ - continue; + if (!S_ISGITLINK(ce->ce_mode)) + continue; } /* @@ -80,8 +142,11 @@ static int check_local_mod(unsigned char *head, int index_only) /* * Is the index different from the file in the work tree? + * If it's a submodule, is its work tree modified? */ - if (ce_match_stat(ce, &st, 0)) + if (ce_match_stat(ce, &st, 0) || + (S_ISGITLINK(ce->ce_mode) && + !ok_to_remove_submodule(ce->name))) local_changes = 1; /* @@ -115,10 +180,18 @@ static int check_local_mod(unsigned char *head, int index_only) errs = error(_("'%s' has changes staged in the index\n" "(use --cached to keep the file, " "or -f to force removal)"), name); - if (local_changes) - errs = error(_("'%s' has local modifications\n" - "(use --cached to keep the file, " - "or -f to force removal)"), name); + if (local_changes) { + if (S_ISGITLINK(ce->ce_mode) && + !submodule_uses_gitfile(name)) { + errs = error(_("submodule '%s' (or one of its nested " + "submodules) uses a .git directory\n" + "(use 'rm -rf' if you really want to remove " + "it including all of its history)"), name); + } else + errs = error(_("'%s' has local modifications\n" + "(use --cached to keep the file, " + "or -f to force removal)"), name); + } } } return errs; @@ -173,8 +246,9 @@ int cmd_rm(int argc, const char **argv, const char *prefix) struct cache_entry *ce = active_cache[i]; if (!match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen)) continue; - ALLOC_GROW(list.name, list.nr + 1, list.alloc); - list.name[list.nr++] = ce->name; + ALLOC_GROW(list.entry, list.nr + 1, list.alloc); + list.entry[list.nr].name = ce->name; + list.entry[list.nr++].is_submodule = S_ISGITLINK(ce->ce_mode); } if (pathspec) { @@ -215,6 +289,9 @@ int cmd_rm(int argc, const char **argv, const char *prefix) hashclr(sha1); if (check_local_mod(sha1, index_only)) exit(1); + } else if (!index_only) { + if (check_submodules_use_gitfiles()) + exit(1); } /* @@ -222,7 +299,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) * the index unless all of them succeed. */ for (i = 0; i < list.nr; i++) { - const char *path = list.name[i]; + const char *path = list.entry[i].name; if (!quiet) printf("rm '%s'\n", path); @@ -244,7 +321,25 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (!index_only) { int removed = 0; for (i = 0; i < list.nr; i++) { - const char *path = list.name[i]; + const char *path = list.entry[i].name; + if (list.entry[i].is_submodule) { + if (is_empty_dir(path)) { + if (!rmdir(path)) { + removed = 1; + continue; + } + } else { + struct strbuf buf = STRBUF_INIT; + strbuf_addstr(&buf, path); + if (!remove_dir_recursively(&buf, 0)) { + removed = 1; + strbuf_release(&buf); + continue; + } + strbuf_release(&buf); + /* Fallthrough and let remove_path() fail. */ + } + } if (!remove_path(path)) { removed = 1; continue; diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 7d05064218..d34201372d 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -16,164 +16,6 @@ static const char send_pack_usage[] = static struct send_pack_args args; -static int feed_object(const unsigned char *sha1, int fd, int negative) -{ - char buf[42]; - - if (negative && !has_sha1_file(sha1)) - return 1; - - memcpy(buf + negative, sha1_to_hex(sha1), 40); - if (negative) - buf[0] = '^'; - buf[40 + negative] = '\n'; - return write_or_whine(fd, buf, 41 + negative, "send-pack: send refs"); -} - -/* - * Make a pack stream and spit it out into file descriptor fd - */ -static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *extra, struct send_pack_args *args) -{ - /* - * The child becomes pack-objects --revs; we feed - * the revision parameters to it via its stdin and - * let its stdout go back to the other end. - */ - const char *argv[] = { - "pack-objects", - "--all-progress-implied", - "--revs", - "--stdout", - NULL, - NULL, - NULL, - NULL, - NULL, - }; - struct child_process po; - int i; - - i = 4; - if (args->use_thin_pack) - argv[i++] = "--thin"; - if (args->use_ofs_delta) - argv[i++] = "--delta-base-offset"; - if (args->quiet || !args->progress) - argv[i++] = "-q"; - if (args->progress) - argv[i++] = "--progress"; - memset(&po, 0, sizeof(po)); - po.argv = argv; - po.in = -1; - po.out = args->stateless_rpc ? -1 : fd; - po.git_cmd = 1; - if (start_command(&po)) - die_errno("git pack-objects failed"); - - /* - * We feed the pack-objects we just spawned with revision - * parameters by writing to the pipe. - */ - for (i = 0; i < extra->nr; i++) - if (!feed_object(extra->array[i], po.in, 1)) - break; - - while (refs) { - if (!is_null_sha1(refs->old_sha1) && - !feed_object(refs->old_sha1, po.in, 1)) - break; - if (!is_null_sha1(refs->new_sha1) && - !feed_object(refs->new_sha1, po.in, 0)) - break; - refs = refs->next; - } - - close(po.in); - - if (args->stateless_rpc) { - char *buf = xmalloc(LARGE_PACKET_MAX); - while (1) { - ssize_t n = xread(po.out, buf, LARGE_PACKET_MAX); - if (n <= 0) - break; - send_sideband(fd, -1, buf, n, LARGE_PACKET_MAX); - } - free(buf); - close(po.out); - po.out = -1; - } - - if (finish_command(&po)) - return -1; - return 0; -} - -static int receive_status(int in, struct ref *refs) -{ - struct ref *hint; - char line[1000]; - int ret = 0; - int len = packet_read_line(in, line, sizeof(line)); - if (len < 10 || memcmp(line, "unpack ", 7)) - return error("did not receive remote status"); - if (memcmp(line, "unpack ok\n", 10)) { - char *p = line + strlen(line) - 1; - if (*p == '\n') - *p = '\0'; - error("unpack failed: %s", line + 7); - ret = -1; - } - hint = NULL; - while (1) { - char *refname; - char *msg; - len = packet_read_line(in, line, sizeof(line)); - if (!len) - break; - if (len < 3 || - (memcmp(line, "ok ", 3) && memcmp(line, "ng ", 3))) { - fprintf(stderr, "protocol error: %s\n", line); - ret = -1; - break; - } - - line[strlen(line)-1] = '\0'; - refname = line + 3; - msg = strchr(refname, ' '); - if (msg) - *msg++ = '\0'; - - /* first try searching at our hint, falling back to all refs */ - if (hint) - hint = find_ref_by_name(hint, refname); - if (!hint) - hint = find_ref_by_name(refs, refname); - if (!hint) { - warning("remote reported status on unknown ref: %s", - refname); - continue; - } - if (hint->status != REF_STATUS_EXPECTING_REPORT) { - warning("remote reported status on unexpected ref: %s", - refname); - continue; - } - - if (line[0] == 'o' && line[1] == 'k') - hint->status = REF_STATUS_OK; - else { - hint->status = REF_STATUS_REMOTE_REJECT; - ret = -1; - } - if (msg) - hint->remote_status = xstrdup(msg); - /* start our next search from the next ref */ - hint = hint->next; - } - return ret; -} - static void print_helper_status(struct ref *ref) { struct strbuf buf = STRBUF_INIT; @@ -227,181 +69,6 @@ static void print_helper_status(struct ref *ref) strbuf_release(&buf); } -static int sideband_demux(int in, int out, void *data) -{ - int *fd = data, ret; -#ifdef NO_PTHREADS - close(fd[1]); -#endif - ret = recv_sideband("send-pack", fd[0], out); - close(out); - return ret; -} - -int send_pack(struct send_pack_args *args, - int fd[], struct child_process *conn, - struct ref *remote_refs, - struct extra_have_objects *extra_have) -{ - int in = fd[0]; - int out = fd[1]; - struct strbuf req_buf = STRBUF_INIT; - struct ref *ref; - int new_refs; - int allow_deleting_refs = 0; - int status_report = 0; - int use_sideband = 0; - int quiet_supported = 0; - int agent_supported = 0; - unsigned cmds_sent = 0; - int ret; - struct async demux; - - /* Does the other end support the reporting? */ - if (server_supports("report-status")) - status_report = 1; - if (server_supports("delete-refs")) - allow_deleting_refs = 1; - if (server_supports("ofs-delta")) - args->use_ofs_delta = 1; - if (server_supports("side-band-64k")) - use_sideband = 1; - if (server_supports("quiet")) - quiet_supported = 1; - if (server_supports("agent")) - agent_supported = 1; - - if (!remote_refs) { - fprintf(stderr, "No refs in common and none specified; doing nothing.\n" - "Perhaps you should specify a branch such as 'master'.\n"); - return 0; - } - - /* - * Finally, tell the other end! - */ - new_refs = 0; - for (ref = remote_refs; ref; ref = ref->next) { - if (!ref->peer_ref && !args->send_mirror) - continue; - - /* Check for statuses set by set_ref_status_for_push() */ - switch (ref->status) { - case REF_STATUS_REJECT_NONFASTFORWARD: - case REF_STATUS_UPTODATE: - continue; - default: - ; /* do nothing */ - } - - if (ref->deletion && !allow_deleting_refs) { - ref->status = REF_STATUS_REJECT_NODELETE; - continue; - } - - if (!ref->deletion) - new_refs++; - - if (args->dry_run) { - ref->status = REF_STATUS_OK; - } else { - char *old_hex = sha1_to_hex(ref->old_sha1); - char *new_hex = sha1_to_hex(ref->new_sha1); - int quiet = quiet_supported && (args->quiet || !args->progress); - - if (!cmds_sent && (status_report || use_sideband || - quiet || agent_supported)) { - packet_buf_write(&req_buf, - "%s %s %s%c%s%s%s%s%s", - old_hex, new_hex, ref->name, 0, - status_report ? " report-status" : "", - use_sideband ? " side-band-64k" : "", - quiet ? " quiet" : "", - agent_supported ? " agent=" : "", - agent_supported ? git_user_agent_sanitized() : "" - ); - } - else - packet_buf_write(&req_buf, "%s %s %s", - old_hex, new_hex, ref->name); - ref->status = status_report ? - REF_STATUS_EXPECTING_REPORT : - REF_STATUS_OK; - cmds_sent++; - } - } - - if (args->stateless_rpc) { - if (!args->dry_run && cmds_sent) { - packet_buf_flush(&req_buf); - send_sideband(out, -1, req_buf.buf, req_buf.len, LARGE_PACKET_MAX); - } - } else { - safe_write(out, req_buf.buf, req_buf.len); - packet_flush(out); - } - strbuf_release(&req_buf); - - if (use_sideband && cmds_sent) { - memset(&demux, 0, sizeof(demux)); - demux.proc = sideband_demux; - demux.data = fd; - demux.out = -1; - if (start_async(&demux)) - die("send-pack: unable to fork off sideband demultiplexer"); - in = demux.out; - } - - if (new_refs && cmds_sent) { - if (pack_objects(out, remote_refs, extra_have, args) < 0) { - for (ref = remote_refs; ref; ref = ref->next) - ref->status = REF_STATUS_NONE; - if (args->stateless_rpc) - close(out); - if (git_connection_is_socket(conn)) - shutdown(fd[0], SHUT_WR); - if (use_sideband) - finish_async(&demux); - return -1; - } - } - if (args->stateless_rpc && cmds_sent) - packet_flush(out); - - if (status_report && cmds_sent) - ret = receive_status(in, remote_refs); - else - ret = 0; - if (args->stateless_rpc) - packet_flush(out); - - if (use_sideband && cmds_sent) { - if (finish_async(&demux)) { - error("error in sideband demultiplexer"); - ret = -1; - } - close(demux.out); - } - - if (ret < 0) - return ret; - - if (args->porcelain) - return 0; - - for (ref = remote_refs; ref; ref = ref->next) { - switch (ref->status) { - case REF_STATUS_NONE: - case REF_STATUS_UPTODATE: - case REF_STATUS_OK: - break; - default: - return -1; - } - } - return 0; -} - int cmd_send_pack(int argc, const char **argv, const char *prefix) { int i, nr_refspecs = 0; diff --git a/builtin/show-ref.c b/builtin/show-ref.c index 4eb016d6e5..8d9b76a02f 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -28,7 +28,6 @@ static void show_one(const char *refname, const unsigned char *sha1) static int show_ref(const char *refname, const unsigned char *sha1, int flag, void *cbdata) { - struct object *obj; const char *hex; unsigned char peeled[20]; @@ -79,25 +78,9 @@ static int show_ref(const char *refname, const unsigned char *sha1, int flag, vo if (!deref_tags) return 0; - if ((flag & REF_ISPACKED) && !peel_ref(refname, peeled)) { - if (!is_null_sha1(peeled)) { - hex = find_unique_abbrev(peeled, abbrev); - printf("%s %s^{}\n", hex, refname); - } - } - else { - obj = parse_object(sha1); - if (!obj) - die("git show-ref: bad ref %s (%s)", refname, - sha1_to_hex(sha1)); - if (obj->type == OBJ_TAG) { - obj = deref_tag(obj, refname, 0); - if (!obj) - die("git show-ref: bad tag at ref %s (%s)", refname, - sha1_to_hex(sha1)); - hex = find_unique_abbrev(obj->sha1, abbrev); - printf("%s %s^{}\n", hex, refname); - } + if (!peel_ref(refname, peeled)) { + hex = find_unique_abbrev(peeled, abbrev); + printf("%s %s^{}\n", hex, refname); } return 0; } diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c index 9e92828b3a..f481959421 100644 --- a/builtin/symbolic-ref.c +++ b/builtin/symbolic-ref.c @@ -5,12 +5,11 @@ static const char * const git_symbolic_ref_usage[] = { N_("git symbolic-ref [options] name [ref]"), + N_("git symbolic-ref -d [-q] name"), NULL }; -static int shorten; - -static void check_symref(const char *HEAD, int quiet) +static int check_symref(const char *HEAD, int quiet, int shorten, int print) { unsigned char sha1[20]; int flag; @@ -22,20 +21,24 @@ static void check_symref(const char *HEAD, int quiet) if (!quiet) die("ref %s is not a symbolic ref", HEAD); else - exit(1); + return 1; + } + if (print) { + if (shorten) + refname = shorten_unambiguous_ref(refname, 0); + puts(refname); } - if (shorten) - refname = shorten_unambiguous_ref(refname, 0); - puts(refname); + return 0; } int cmd_symbolic_ref(int argc, const char **argv, const char *prefix) { - int quiet = 0; + int quiet = 0, delete = 0, shorten = 0, ret = 0; const char *msg = NULL; struct option options[] = { OPT__QUIET(&quiet, N_("suppress error message for non-symbolic (detached) refs")), + OPT_BOOL('d', "delete", &delete, N_("delete symbolic ref")), OPT_BOOL(0, "short", &shorten, N_("shorten ref output")), OPT_STRING('m', NULL, &msg, N_("reason"), N_("reason of the update")), OPT_END(), @@ -46,9 +49,19 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix) git_symbolic_ref_usage, 0); if (msg &&!*msg) die("Refusing to perform update with empty message"); + + if (delete) { + if (argc != 1) + usage_with_options(git_symbolic_ref_usage, options); + ret = check_symref(argv[0], 1, 0, 0); + if (ret) + die("Cannot delete %s, not a symbolic ref", argv[0]); + return delete_ref(argv[0], NULL, REF_NODEREF); + } + switch (argc) { case 1: - check_symref(argv[0], quiet); + ret = check_symref(argv[0], quiet, shorten, 1); break; case 2: if (!strcmp(argv[0], "HEAD") && @@ -59,5 +72,5 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix) default: usage_with_options(git_symbolic_ref_usage, options); } - return 0; + return ret; } diff --git a/cache.h b/cache.h index eb4a0316d2..dbd8018b58 100644 --- a/cache.h +++ b/cache.h @@ -442,7 +442,6 @@ extern int discard_index(struct index_state *); extern int unmerged_index(const struct index_state *); extern int verify_path(const char *path); extern struct cache_entry *index_name_exists(struct index_state *istate, const char *name, int namelen, int igncase); -extern int index_name_stage_pos(const struct index_state *, const char *name, int namelen, int stage); extern int index_name_pos(const struct index_state *, const char *name, int namelen); #define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */ #define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */ @@ -902,9 +901,7 @@ extern const char *git_author_info(int); extern const char *git_committer_info(int); extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int); extern const char *fmt_name(const char *name, const char *email); -extern const char *ident_default_name(void); extern const char *ident_default_email(void); -extern const char *ident_default_date(void); extern const char *git_editor(void); extern const char *git_pager(int stdout_is_tty); extern int git_ident_config(const char *, const char *, void *); @@ -947,9 +944,7 @@ struct cache_def { extern int has_symlink_leading_path(const char *name, int len); extern int threaded_has_symlink_leading_path(struct cache_def *, const char *, int); extern int check_leading_path(const char *name, int len); -extern int threaded_check_leading_path(struct cache_def *cache, const char *name, int len); extern int has_dirs_only_path(const char *name, int len, int prefix_len); -extern int threaded_has_dirs_only_path(struct cache_def *cache, const char *name, int len, int prefix_len); extern void schedule_dir_for_removal(const char *name, int len); extern void remove_scheduled_dirs(void); @@ -1188,6 +1183,7 @@ extern int pager_in_use(void); extern int pager_use_color; extern int term_columns(void); extern int decimal_width(int); +extern int check_pager_config(const char *cmd); extern const char *editor_program; extern const char *askpass_program; @@ -1208,7 +1204,6 @@ extern void alloc_report(void); /* trace.c */ __attribute__((format (printf, 1, 2))) extern void trace_printf(const char *format, ...); -extern void trace_vprintf(const char *key, const char *format, va_list ap); __attribute__((format (printf, 2, 3))) extern void trace_argv_printf(const char **argv, const char *format, ...); extern void trace_repo_setup(const char *prefix); @@ -1271,8 +1266,15 @@ struct startup_info { }; extern struct startup_info *startup_info; -/* builtin/merge.c */ -int checkout_fast_forward(const unsigned char *from, const unsigned char *to); +/* merge.c */ +struct commit_list; +int try_merge_command(const char *strategy, size_t xopts_nr, + const char **xopts, struct commit_list *common, + const char *head_arg, struct commit_list *remotes); +int checkout_fast_forward(const unsigned char *from, + const unsigned char *to, + int overwrite_ignore); + int sane_execvp(const char *file, char *const argv[]); diff --git a/commit.c b/commit.c index 0ea441d13b..e8eb0aec55 100644 --- a/commit.c +++ b/commit.c @@ -9,6 +9,8 @@ #include "gpg-interface.h" #include "mergesort.h" +static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **); + int save_commit_buffer = 1; const char *commit_type = "commit"; @@ -607,6 +609,7 @@ static struct commit *interesting(struct commit_list *list) return NULL; } +/* all input commits in one and twos[] must have been parsed! */ static struct commit_list *paint_down_to_common(struct commit *one, int n, struct commit **twos) { struct commit_list *list = NULL; @@ -615,6 +618,8 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc one->object.flags |= PARENT1; commit_list_insert_by_date(one, &list); + if (!n) + return list; for (i = 0; i < n; i++) { twos[i]->object.flags |= PARENT2; commit_list_insert_by_date(twos[i], &list); @@ -735,6 +740,8 @@ static int remove_redundant(struct commit **array, int cnt) redundant = xcalloc(cnt, 1); filled_index = xmalloc(sizeof(*filled_index) * (cnt - 1)); + for (i = 0; i < cnt; i++) + parse_commit(array[i]); for (i = 0; i < cnt; i++) { struct commit_list *common; @@ -1073,8 +1080,9 @@ static int excluded_header_field(const char *field, size_t len, const char **exc return 0; } -struct commit_extra_header *read_commit_extra_header_lines(const char *buffer, size_t size, - const char **exclude) +static struct commit_extra_header *read_commit_extra_header_lines( + const char *buffer, size_t size, + const char **exclude) { struct commit_extra_header *extra = NULL, **tail = &extra, *it = NULL; const char *line, *next, *eof, *eob; @@ -1339,3 +1347,13 @@ struct commit_list **commit_list_append(struct commit *commit, new->next = NULL; return &new->next; } + +void print_commit_list(struct commit_list *list, + const char *format_cur, + const char *format_last) +{ + for ( ; list; list = list->next) { + const char *format = list->next ? format_cur : format_last; + printf(format, sha1_to_hex(list->item->object.sha1)); + } +} diff --git a/commit.h b/commit.h index 6edce87673..c4cd046160 100644 --- a/commit.h +++ b/commit.h @@ -204,7 +204,6 @@ extern int commit_tree_extended(const struct strbuf *msg, unsigned char *tree, struct commit_extra_header *); extern struct commit_extra_header *read_commit_extra_headers(struct commit *, const char **); -extern struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **); extern void free_commit_extra_headers(struct commit_extra_header *extra); @@ -223,4 +222,8 @@ struct commit *get_merge_parent(const char *name); extern int parse_signed_commit(const unsigned char *sha1, struct strbuf *message, struct strbuf *signature); +extern void print_commit_list(struct commit_list *list, + const char *format_cur, + const char *format_last); + #endif /* COMMIT_H */ diff --git a/compat/mingw.c b/compat/mingw.c index afc892d6b1..4e6383898c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -335,6 +335,28 @@ FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream) return freopen(filename, otype, stream); } +#undef fflush +int mingw_fflush(FILE *stream) +{ + int ret = fflush(stream); + + /* + * write() is used behind the scenes of stdio output functions. + * Since git code does not check for errors after each stdio write + * operation, it can happen that write() is called by a later + * stdio function even if an earlier write() call failed. In the + * case of a pipe whose readable end was closed, only the first + * call to write() reports EPIPE on Windows. Subsequent write() + * calls report EINVAL. It is impossible to notice whether this + * fflush invocation triggered such a case, therefore, we have to + * catch all EINVAL errors whole-sale. + */ + if (ret && errno == EINVAL) + errno = EPIPE; + + return ret; +} + /* * The unit of FILETIME is 100-nanoseconds since January 1, 1601, UTC. * Returns the 100-nanoseconds ("hekto nanoseconds") since the epoch. diff --git a/compat/mingw.h b/compat/mingw.h index 61a652138a..eeb08d120b 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -185,6 +185,9 @@ FILE *mingw_fopen (const char *filename, const char *otype); FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream); #define freopen mingw_freopen +int mingw_fflush(FILE *stream); +#define fflush mingw_fflush + char *mingw_getcwd(char *pointer, int len); #define getcwd mingw_getcwd diff --git a/config.c b/config.c index 08e47e2e48..fff8a43bc0 100644 --- a/config.c +++ b/config.c @@ -10,8 +10,6 @@ #include "strbuf.h" #include "quote.h" -#define MAXNAME (256) - typedef struct config_file { struct config_file *prev; FILE *f; @@ -19,7 +17,7 @@ typedef struct config_file { int linenr; int eof; struct strbuf value; - char var[MAXNAME]; + struct strbuf var; } config_file; static config_file *cf; @@ -260,7 +258,7 @@ static inline int iskeychar(int c) return isalnum(c) || c == '-'; } -static int get_value(config_fn_t fn, void *data, char *name, unsigned int len) +static int get_value(config_fn_t fn, void *data, struct strbuf *name) { int c; char *value; @@ -272,11 +270,9 @@ static int get_value(config_fn_t fn, void *data, char *name, unsigned int len) break; if (!iskeychar(c)) break; - name[len++] = tolower(c); - if (len >= MAXNAME) - return -1; + strbuf_addch(name, tolower(c)); } - name[len] = 0; + while (c == ' ' || c == '\t') c = get_next_char(); @@ -288,10 +284,10 @@ static int get_value(config_fn_t fn, void *data, char *name, unsigned int len) if (!value) return -1; } - return fn(name, value, data); + return fn(name->buf, value, data); } -static int get_extended_base_var(char *name, int baselen, int c) +static int get_extended_base_var(struct strbuf *name, int c) { do { if (c == '\n') @@ -302,7 +298,7 @@ static int get_extended_base_var(char *name, int baselen, int c) /* We require the format to be '[base "extension"]' */ if (c != '"') return -1; - name[baselen++] = '.'; + strbuf_addch(name, '.'); for (;;) { int c = get_next_char(); @@ -315,37 +311,31 @@ static int get_extended_base_var(char *name, int baselen, int c) if (c == '\n') goto error_incomplete_line; } - name[baselen++] = c; - if (baselen > MAXNAME / 2) - return -1; + strbuf_addch(name, c); } /* Final ']' */ if (get_next_char() != ']') return -1; - return baselen; + return 0; error_incomplete_line: cf->linenr--; return -1; } -static int get_base_var(char *name) +static int get_base_var(struct strbuf *name) { - int baselen = 0; - for (;;) { int c = get_next_char(); if (cf->eof) return -1; if (c == ']') - return baselen; + return 0; if (isspace(c)) - return get_extended_base_var(name, baselen, c); + return get_extended_base_var(name, c); if (!iskeychar(c) && c != '.') return -1; - if (baselen > MAXNAME / 2) - return -1; - name[baselen++] = tolower(c); + strbuf_addch(name, tolower(c)); } } @@ -353,7 +343,7 @@ static int git_parse_file(config_fn_t fn, void *data) { int comment = 0; int baselen = 0; - char *var = cf->var; + struct strbuf *var = &cf->var; /* U+FEFF Byte Order Mark in UTF8 */ static const unsigned char *utf8_bom = (unsigned char *) "\xef\xbb\xbf"; @@ -389,17 +379,24 @@ static int git_parse_file(config_fn_t fn, void *data) continue; } if (c == '[') { - baselen = get_base_var(var); - if (baselen <= 0) + /* Reset prior to determining a new stem */ + strbuf_reset(var); + if (get_base_var(var) < 0 || var->len < 1) break; - var[baselen++] = '.'; - var[baselen] = 0; + strbuf_addch(var, '.'); + baselen = var->len; continue; } if (!isalpha(c)) break; - var[baselen] = tolower(c); - if (get_value(fn, data, var, baselen+1) < 0) + /* + * Truncate the var name back to the section header + * stem prior to grabbing the suffix part of the name + * and the value. + */ + strbuf_setlen(var, baselen); + strbuf_addch(var, tolower(c)); + if (get_value(fn, data, var) < 0) break; } die("bad config file line %d in %s", cf->linenr, cf->name); @@ -899,12 +896,14 @@ int git_config_from_file(config_fn_t fn, const char *filename, void *data) top.linenr = 1; top.eof = 0; strbuf_init(&top.value, 1024); + strbuf_init(&top.var, 1024); cf = ⊤ ret = git_parse_file(fn, data); /* pop config-file parsing state stack */ strbuf_release(&top.value); + strbuf_release(&top.var); cf = top.prev; fclose(f); diff --git a/configure.ac b/configure.ac index da1f41f588..ad215cc4a1 100644 --- a/configure.ac +++ b/configure.ac @@ -411,7 +411,7 @@ else LDFLAGS="${SAVE_LDFLAGS}" ]) if test "$git_cv_ld_wl_rpath" = "yes"; then - CC_LD_DYNPATH=-Wl,-rpath + CC_LD_DYNPATH=-Wl,-rpath, else AC_CACHE_CHECK([if linker supports -rpath], git_cv_ld_rpath, [ SAVE_LDFLAGS="${LDFLAGS}" @@ -1024,7 +1024,7 @@ elif test -z "$PTHREAD_CFLAGS"; then for opt in -mt -pthread -lpthread; do old_CFLAGS="$CFLAGS" CFLAGS="$opt $CFLAGS" - AC_MSG_CHECKING([Checking for POSIX Threads with '$opt']) + AC_MSG_CHECKING([for POSIX Threads with '$opt']) AC_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) NO_PTHREADS= @@ -1044,7 +1044,7 @@ elif test -z "$PTHREAD_CFLAGS"; then else old_CFLAGS="$CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS" - AC_MSG_CHECKING([Checking for POSIX Threads with '$PTHREAD_CFLAGS']) + AC_MSG_CHECKING([for POSIX Threads with '$PTHREAD_CFLAGS']) AC_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) NO_PTHREADS= diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 1b43329ed7..bc0657a224 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1018,7 +1018,8 @@ _git_commit () --*) __gitcomp " --all --author= --signoff --verify --no-verify - --edit --amend --include --only --interactive + --edit --no-edit + --amend --include --only --interactive --dry-run --reuse-message= --reedit-message= --reset-author --file= --message= --template= --cleanup= --untracked-files --untracked-files= @@ -1115,6 +1116,14 @@ _git_fetch () __git_complete_remote_or_refspec } +__git_format_patch_options=" + --stdout --attach --no-attach --thread --thread= --output-directory + --numbered --start-number --numbered-files --keep-subject --signoff + --signature --no-signature --in-reply-to= --cc= --full-index --binary + --not --all --cover-letter --no-prefix --src-prefix= --dst-prefix= + --inline --suffix= --ignore-if-in-upstream --subject-prefix= +" + _git_format_patch () { case "$cur" in @@ -1125,21 +1134,7 @@ _git_format_patch () return ;; --*) - __gitcomp " - --stdout --attach --no-attach --thread --thread= - --output-directory - --numbered --start-number - --numbered-files - --keep-subject - --signoff --signature --no-signature - --in-reply-to= --cc= - --full-index --binary - --not --all - --cover-letter - --no-prefix --src-prefix= --dst-prefix= - --inline --suffix= --ignore-if-in-upstream - --subject-prefix= - " + __gitcomp "$__git_format_patch_options" return ;; esac @@ -1553,6 +1548,12 @@ _git_send_email () __gitcomp "ssl tls" "" "${cur##--smtp-encryption=}" return ;; + --thread=*) + __gitcomp " + deep shallow + " "" "${cur##--thread=}" + return + ;; --*) __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to --compose --confirm= --dry-run --envelope-sender @@ -1562,11 +1563,12 @@ _git_send_email () --signed-off-by-cc --smtp-pass --smtp-server --smtp-server-port --smtp-encryption= --smtp-user --subject --suppress-cc= --suppress-from --thread --to - --validate --no-validate" + --validate --no-validate + $__git_format_patch_options" return ;; esac - COMPREPLY=() + __git_complete_revlist } _git_stage () diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index 29b1ec9eb1..bf20491ec3 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -34,9 +34,10 @@ # # If you would like to see the difference between HEAD and its upstream, # set GIT_PS1_SHOWUPSTREAM="auto". A "<" indicates you are behind, ">" -# indicates you are ahead, and "<>" indicates you have diverged. You -# can further control behaviour by setting GIT_PS1_SHOWUPSTREAM to a -# space-separated list of values: +# indicates you are ahead, "<>" indicates you have diverged and "=" +# indicates that there is no difference. You can further control +# behaviour by setting GIT_PS1_SHOWUPSTREAM to a space-separated list +# of values: # # verbose show number of commits ahead/behind (+/-) upstream # legacy don't use the '--count' option available in recent diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump index a33674e47a..dc90cd6379 100755 --- a/contrib/git-jump/git-jump +++ b/contrib/git-jump/git-jump @@ -21,9 +21,9 @@ open_editor() { } mode_diff() { - git diff --relative "$@" | + git diff --no-prefix --relative "$@" | perl -ne ' - if (m{^\+\+\+ b/(.*)}) { $file = $1; next } + if (m{^\+\+\+ (.*)}) { $file = $1; next } defined($file) or next; if (m/^@@ .*\+(\d+)/) { $line = $1; next } defined($line) or next; diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 01af9df15e..b2171a092e 100755 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -403,7 +403,7 @@ generate_update_branch_email() echo " \\" echo " O -- O -- O ($oldrev)" echo "" - echo "The removed revisions are not necessarilly gone - if another reference" + echo "The removed revisions are not necessarily gone - if another reference" echo "still refers to them they will stay in the repository." rewind_only=1 else diff --git a/contrib/svn-fe/svn-fe.c b/contrib/svn-fe/svn-fe.c index 35db24f5ea..f363505abb 100644 --- a/contrib/svn-fe/svn-fe.c +++ b/contrib/svn-fe/svn-fe.c @@ -10,7 +10,8 @@ int main(int argc, char **argv) { if (svndump_init(NULL)) return 1; - svndump_read((argc > 1) ? argv[1] : NULL); + svndump_read((argc > 1) ? argv[1] : NULL, "refs/heads/master", + "refs/notes/svn/revs"); svndump_deinit(); svndump_reset(); return 0; diff --git a/contrib/svn-fe/svnrdump_sim.py b/contrib/svn-fe/svnrdump_sim.py new file mode 100755 index 0000000000..1cfac4a6f8 --- /dev/null +++ b/contrib/svn-fe/svnrdump_sim.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +""" +Simulates svnrdump by replaying an existing dump from a file, taking care +of the specified revision range. +To simulate incremental imports the environment variable SVNRMAX can be set +to the highest revision that should be available. +""" +import sys, os + + +def getrevlimit(): + var = 'SVNRMAX' + if os.environ.has_key(var): + return os.environ[var] + return None + +def writedump(url, lower, upper): + if url.startswith('sim://'): + filename = url[6:] + if filename[-1] == '/': filename = filename[:-1] #remove terminating slash + else: + raise ValueError('sim:// url required') + f = open(filename, 'r'); + state = 'header' + wroterev = False + while(True): + l = f.readline() + if l == '': break + if state == 'header' and l.startswith('Revision-number: '): + state = 'prefix' + if state == 'prefix' and l == 'Revision-number: %s\n' % lower: + state = 'selection' + if not upper == 'HEAD' and state == 'selection' and l == 'Revision-number: %s\n' % upper: + break; + + if state == 'header' or state == 'selection': + if state == 'selection': wroterev = True + sys.stdout.write(l) + return wroterev + +if __name__ == "__main__": + if not (len(sys.argv) in (3, 4, 5)): + print "usage: %s dump URL -rLOWER:UPPER" + sys.exit(1) + if not sys.argv[1] == 'dump': raise NotImplementedError('only "dump" is suppported.') + url = sys.argv[2] + r = ('0', 'HEAD') + if len(sys.argv) == 4 and sys.argv[3][0:2] == '-r': + r = sys.argv[3][2:].lstrip().split(':') + if not getrevlimit() is None: r[1] = getrevlimit() + if writedump(url, r[0], r[1]): ret = 0 + else: ret = 1 + sys.exit(ret) diff --git a/diff.c b/diff.c index e6846ca750..e89a2015eb 100644 --- a/diff.c +++ b/diff.c @@ -15,6 +15,7 @@ #include "sigchain.h" #include "submodule.h" #include "ll-merge.h" +#include "string-list.h" #ifdef NO_FAST_WORKING_DIRECTORY #define FAST_WORKING_DIRECTORY 0 @@ -25,7 +26,8 @@ static int diff_detect_rename_default; static int diff_rename_limit_default = 400; static int diff_suppress_blank_empty; -int diff_use_color_default = -1; +static int diff_use_color_default = -1; +static int diff_context_default = 3; static const char *diff_word_regex_cfg; static const char *external_diff_cmd_cfg; int diff_auto_refresh_index = 1; @@ -68,26 +70,30 @@ static int parse_diff_color_slot(const char *var, int ofs) return -1; } -static int parse_dirstat_params(struct diff_options *options, const char *params, +static int parse_dirstat_params(struct diff_options *options, const char *params_string, struct strbuf *errmsg) { - const char *p = params; - int p_len, ret = 0; + char *params_copy = xstrdup(params_string); + struct string_list params = STRING_LIST_INIT_NODUP; + int ret = 0; + int i; - while (*p) { - p_len = strchrnul(p, ',') - p; - if (!memcmp(p, "changes", p_len)) { + if (*params_copy) + string_list_split_in_place(¶ms, params_copy, ',', -1); + for (i = 0; i < params.nr; i++) { + const char *p = params.items[i].string; + if (!strcmp(p, "changes")) { DIFF_OPT_CLR(options, DIRSTAT_BY_LINE); DIFF_OPT_CLR(options, DIRSTAT_BY_FILE); - } else if (!memcmp(p, "lines", p_len)) { + } else if (!strcmp(p, "lines")) { DIFF_OPT_SET(options, DIRSTAT_BY_LINE); DIFF_OPT_CLR(options, DIRSTAT_BY_FILE); - } else if (!memcmp(p, "files", p_len)) { + } else if (!strcmp(p, "files")) { DIFF_OPT_CLR(options, DIRSTAT_BY_LINE); DIFF_OPT_SET(options, DIRSTAT_BY_FILE); - } else if (!memcmp(p, "noncumulative", p_len)) { + } else if (!strcmp(p, "noncumulative")) { DIFF_OPT_CLR(options, DIRSTAT_CUMULATIVE); - } else if (!memcmp(p, "cumulative", p_len)) { + } else if (!strcmp(p, "cumulative")) { DIFF_OPT_SET(options, DIRSTAT_CUMULATIVE); } else if (isdigit(*p)) { char *end; @@ -99,24 +105,21 @@ static int parse_dirstat_params(struct diff_options *options, const char *params while (isdigit(*++end)) ; /* nothing */ } - if (end - p == p_len) + if (!*end) options->dirstat_permille = permille; else { - strbuf_addf(errmsg, _(" Failed to parse dirstat cut-off percentage '%.*s'\n"), - p_len, p); + strbuf_addf(errmsg, _(" Failed to parse dirstat cut-off percentage '%s'\n"), + p); ret++; } } else { - strbuf_addf(errmsg, _(" Unknown dirstat parameter '%.*s'\n"), - p_len, p); + strbuf_addf(errmsg, _(" Unknown dirstat parameter '%s'\n"), p); ret++; } - p += p_len; - - if (*p) - p++; /* more parameters, swallow separator */ } + string_list_clear(¶ms, 0); + free(params_copy); return ret; } @@ -141,6 +144,12 @@ int git_diff_ui_config(const char *var, const char *value, void *cb) diff_use_color_default = git_config_colorbool(var, value); return 0; } + if (!strcmp(var, "diff.context")) { + diff_context_default = git_config_int(var, value); + if (diff_context_default < 0) + return -1; + return 0; + } if (!strcmp(var, "diff.renames")) { diff_detect_rename_default = git_config_rename(var, value); return 0; @@ -1398,11 +1407,11 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions) if (!files) { assert(insertions == 0 && deletions == 0); - return fprintf(fp, "%s\n", _(" 0 files changed")); + return fprintf(fp, "%s\n", " 0 files changed"); } strbuf_addf(&sb, - Q_(" %d file changed", " %d files changed", files), + (files == 1) ? " %d file changed" : " %d files changed", files); /* @@ -1419,8 +1428,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions) * do not translate it. */ strbuf_addf(&sb, - Q_(", %d insertion(+)", ", %d insertions(+)", - insertions), + (insertions == 1) ? ", %d insertion(+)" : ", %d insertions(+)", insertions); } @@ -1430,8 +1438,7 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions) * do not translate it. */ strbuf_addf(&sb, - Q_(", %d deletion(-)", ", %d deletions(-)", - deletions), + (deletions == 1) ? ", %d deletion(-)" : ", %d deletions(-)", deletions); } strbuf_addch(&sb, '\n'); @@ -3172,7 +3179,7 @@ void diff_setup(struct diff_options *options) options->break_opt = -1; options->rename_limit = -1; options->dirstat_permille = diff_dirstat_permille_default; - options->context = 3; + options->context = diff_context_default; DIFF_OPT_SET(options, RENAME_EMPTY); options->change = diff_change; @@ -4873,3 +4880,19 @@ size_t fill_textconv(struct userdiff_driver *driver, return size; } + +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/diff.h b/diff.h index e25addb806..a47bae48d5 100644 --- a/diff.h +++ b/diff.h @@ -243,7 +243,6 @@ extern int parse_long_opt(const char *opt, const char **argv, extern int git_diff_basic_config(const char *var, const char *value, void *cb); extern int git_diff_ui_config(const char *var, const char *value, void *cb); -extern int diff_use_color_default; extern void diff_setup(struct diff_options *); extern int diff_opt_parse(struct diff_options *, const char **, int); extern void diff_setup_done(struct diff_options *); @@ -336,5 +335,6 @@ extern int parse_rename_score(const char **cp_p); extern int print_stat_summary(FILE *fp, int files, int insertions, int deletions); +extern void setup_diff_pager(struct diff_options *); #endif /* DIFF_H */ diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index ed23eb4bdd..a209376354 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -104,10 +104,10 @@ static int diff_grep(struct diff_filepair *p, struct diff_options *o, if (!mf2.ptr) return 0; /* ignore unmerged */ /* created "two" -- does it have what we are looking for? */ - hit = !regexec(regexp, p->two->data, 1, ®match, 0); + hit = !regexec(regexp, mf2.ptr, 1, ®match, 0); } else if (!mf2.ptr) { /* removed "one" -- did it have what we are looking for? */ - hit = !regexec(regexp, p->one->data, 1, ®match, 0); + hit = !regexec(regexp, mf1.ptr, 1, ®match, 0); } else { /* * We have both sides; need to run textual diff and see if diff --git a/dir.c b/dir.c index 486833986e..5a83aa7897 100644 --- a/dir.c +++ b/dir.c @@ -308,42 +308,69 @@ static int no_wildcard(const char *string) return string[simple_length(string)] == '\0'; } +void parse_exclude_pattern(const char **pattern, + int *patternlen, + int *flags, + int *nowildcardlen) +{ + const char *p = *pattern; + size_t i, len; + + *flags = 0; + if (*p == '!') { + *flags |= EXC_FLAG_NEGATIVE; + p++; + } + len = strlen(p); + if (len && p[len - 1] == '/') { + len--; + *flags |= EXC_FLAG_MUSTBEDIR; + } + for (i = 0; i < len; i++) { + if (p[i] == '/') + break; + } + if (i == len) + *flags |= EXC_FLAG_NODIR; + *nowildcardlen = simple_length(p); + /* + * we should have excluded the trailing slash from 'p' too, + * but that's one more allocation. Instead just make sure + * nowildcardlen does not exceed real patternlen + */ + if (*nowildcardlen > len) + *nowildcardlen = len; + if (*p == '*' && no_wildcard(p + 1)) + *flags |= EXC_FLAG_ENDSWITH; + *pattern = p; + *patternlen = len; +} + void add_exclude(const char *string, const char *base, int baselen, struct exclude_list *which) { struct exclude *x; - size_t len; - int to_exclude = 1; - int flags = 0; + int patternlen; + int flags; + int nowildcardlen; - if (*string == '!') { - to_exclude = 0; - string++; - } - len = strlen(string); - if (len && string[len - 1] == '/') { + parse_exclude_pattern(&string, &patternlen, &flags, &nowildcardlen); + if (flags & EXC_FLAG_MUSTBEDIR) { char *s; - x = xmalloc(sizeof(*x) + len); + x = xmalloc(sizeof(*x) + patternlen + 1); s = (char *)(x+1); - memcpy(s, string, len - 1); - s[len - 1] = '\0'; - string = s; + memcpy(s, string, patternlen); + s[patternlen] = '\0'; x->pattern = s; - flags = EXC_FLAG_MUSTBEDIR; } else { x = xmalloc(sizeof(*x)); x->pattern = string; } - x->to_exclude = to_exclude; - x->patternlen = strlen(string); + x->patternlen = patternlen; + x->nowildcardlen = nowildcardlen; x->base = base; x->baselen = baselen; x->flags = flags; - if (!strchr(string, '/')) - x->flags |= EXC_FLAG_NODIR; - 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); which->excludes[which->nr++] = x; } @@ -505,6 +532,72 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen) dir->basebuf[baselen] = '\0'; } +int match_basename(const char *basename, int basenamelen, + const char *pattern, int prefix, int patternlen, + int flags) +{ + if (prefix == patternlen) { + if (!strcmp_icase(pattern, basename)) + return 1; + } else if (flags & EXC_FLAG_ENDSWITH) { + if (patternlen - 1 <= basenamelen && + !strcmp_icase(pattern + 1, + basename + basenamelen - patternlen + 1)) + return 1; + } else { + if (fnmatch_icase(pattern, basename, 0) == 0) + return 1; + } + return 0; +} + +int match_pathname(const char *pathname, int pathlen, + const char *base, int baselen, + const char *pattern, int prefix, int patternlen, + int flags) +{ + const char *name; + int namelen; + + /* + * match with FNM_PATHNAME; the pattern has base implicitly + * in front of it. + */ + if (*pattern == '/') { + pattern++; + prefix--; + } + + /* + * baselen does not count the trailing slash. base[] may or + * may not end with a trailing slash though. + */ + if (pathlen < baselen + 1 || + (baselen && pathname[baselen] != '/') || + strncmp_icase(pathname, base, baselen)) + return 0; + + namelen = baselen ? pathlen - baselen - 1 : pathlen; + name = pathname + pathlen - namelen; + + if (prefix) { + /* + * if the non-wildcard part is longer than the + * remaining pathname, surely it cannot match. + */ + if (prefix > namelen) + return 0; + + if (strncmp_icase(pattern, name, prefix)) + return 0; + pattern += prefix; + name += prefix; + namelen -= prefix; + } + + return fnmatch_icase(pattern, name, FNM_PATHNAME) == 0; +} + /* Scan the list and let the last match determine the fate. * Return 1 for exclude, 0 for include and -1 for undecided. */ @@ -519,9 +612,9 @@ int excluded_from_list(const char *pathname, 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; + const char *exclude = x->pattern; + int to_exclude = x->flags & EXC_FLAG_NEGATIVE ? 0 : 1; + int prefix = x->nowildcardlen; if (x->flags & EXC_FLAG_MUSTBEDIR) { if (*dtype == DT_UNKNOWN) @@ -531,51 +624,18 @@ int excluded_from_list(const char *pathname, } 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)) + if (match_basename(basename, + pathlen - (basename - pathname), + exclude, prefix, x->patternlen, + x->flags)) + return to_exclude; 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)) + assert(x->baselen == 0 || x->base[x->baselen - 1] == '/'); + if (match_pathname(pathname, pathlen, + x->base, x->baselen ? x->baselen - 1 : 0, + exclude, prefix, x->patternlen, x->flags)) return to_exclude; } return -1; /* undecided */ diff --git a/dir.h b/dir.h index 893465a1e8..f5c89e3b80 100644 --- a/dir.h +++ b/dir.h @@ -11,6 +11,7 @@ struct dir_entry { #define EXC_FLAG_NODIR 1 #define EXC_FLAG_ENDSWITH 4 #define EXC_FLAG_MUSTBEDIR 8 +#define EXC_FLAG_NEGATIVE 16 struct exclude_list { int nr; @@ -21,7 +22,6 @@ struct exclude_list { int nowildcardlen; const char *base; int baselen; - int to_exclude; int flags; } **excludes; }; @@ -80,6 +80,16 @@ extern int excluded_from_list(const char *pathname, int pathlen, const char *bas int *dtype, struct exclude_list *el); struct dir_entry *dir_add_ignored(struct dir_struct *dir, const char *pathname, int len); +/* + * these implement the matching logic for dir.c:excluded_from_list and + * attr.c:path_matches() + */ +extern int match_basename(const char *, int, + const char *, int, int, int); +extern int match_pathname(const char *, int, + const char *, int, + const char *, int, int, int); + /* * The excluded() API is meant for callers that check each level of leading * directory hierarchies with excluded() to avoid recursing into excluded @@ -97,6 +107,7 @@ extern int path_excluded(struct path_exclude_check *, const char *, int namelen, 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); +extern void parse_exclude_pattern(const char **string, int *patternlen, int *flags, int *nowildcardlen); extern void add_exclude(const char *string, const char *base, int baselen, struct exclude_list *which); extern void free_excludes(struct exclude_list *el); diff --git a/fetch-pack.c b/fetch-pack.c new file mode 100644 index 0000000000..099ff4ddff --- /dev/null +++ b/fetch-pack.c @@ -0,0 +1,951 @@ +#include "cache.h" +#include "refs.h" +#include "pkt-line.h" +#include "commit.h" +#include "tag.h" +#include "exec_cmd.h" +#include "pack.h" +#include "sideband.h" +#include "fetch-pack.h" +#include "remote.h" +#include "run-command.h" +#include "transport.h" +#include "version.h" + +static int transfer_unpack_limit = -1; +static int fetch_unpack_limit = -1; +static int unpack_limit = 100; +static int prefer_ofs_delta = 1; +static int no_done; +static int fetch_fsck_objects = -1; +static int transfer_fsck_objects = -1; +static int agent_supported; + +#define COMPLETE (1U << 0) +#define COMMON (1U << 1) +#define COMMON_REF (1U << 2) +#define SEEN (1U << 3) +#define POPPED (1U << 4) + +static int marked; + +/* + * After sending this many "have"s if we do not get any new ACK , we + * give up traversing our history. + */ +#define MAX_IN_VAIN 256 + +static struct commit_list *rev_list; +static int non_common_revs, multi_ack, use_sideband; + +static void rev_list_push(struct commit *commit, int mark) +{ + if (!(commit->object.flags & mark)) { + commit->object.flags |= mark; + + if (!(commit->object.parsed)) + if (parse_commit(commit)) + return; + + commit_list_insert_by_date(commit, &rev_list); + + if (!(commit->object.flags & COMMON)) + non_common_revs++; + } +} + +static int rev_list_insert_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data) +{ + struct object *o = deref_tag(parse_object(sha1), refname, 0); + + if (o && o->type == OBJ_COMMIT) + rev_list_push((struct commit *)o, SEEN); + + return 0; +} + +static int clear_marks(const char *refname, const unsigned char *sha1, int flag, void *cb_data) +{ + struct object *o = deref_tag(parse_object(sha1), refname, 0); + + if (o && o->type == OBJ_COMMIT) + clear_commit_marks((struct commit *)o, + COMMON | COMMON_REF | SEEN | POPPED); + return 0; +} + +/* + This function marks a rev and its ancestors as common. + In some cases, it is desirable to mark only the ancestors (for example + when only the server does not yet know that they are common). +*/ + +static void mark_common(struct commit *commit, + int ancestors_only, int dont_parse) +{ + if (commit != NULL && !(commit->object.flags & COMMON)) { + struct object *o = (struct object *)commit; + + if (!ancestors_only) + o->flags |= COMMON; + + if (!(o->flags & SEEN)) + rev_list_push(commit, SEEN); + else { + struct commit_list *parents; + + if (!ancestors_only && !(o->flags & POPPED)) + non_common_revs--; + if (!o->parsed && !dont_parse) + if (parse_commit(commit)) + return; + + for (parents = commit->parents; + parents; + parents = parents->next) + mark_common(parents->item, 0, dont_parse); + } + } +} + +/* + Get the next rev to send, ignoring the common. +*/ + +static const unsigned char *get_rev(void) +{ + struct commit *commit = NULL; + + while (commit == NULL) { + unsigned int mark; + struct commit_list *parents; + + if (rev_list == NULL || non_common_revs == 0) + return NULL; + + commit = rev_list->item; + if (!commit->object.parsed) + parse_commit(commit); + parents = commit->parents; + + commit->object.flags |= POPPED; + if (!(commit->object.flags & COMMON)) + non_common_revs--; + + if (commit->object.flags & COMMON) { + /* do not send "have", and ignore ancestors */ + commit = NULL; + mark = COMMON | SEEN; + } else if (commit->object.flags & COMMON_REF) + /* send "have", and ignore ancestors */ + mark = COMMON | SEEN; + else + /* send "have", also for its ancestors */ + mark = SEEN; + + while (parents) { + if (!(parents->item->object.flags & SEEN)) + rev_list_push(parents->item, mark); + if (mark & COMMON) + mark_common(parents->item, 1, 0); + parents = parents->next; + } + + rev_list = rev_list->next; + } + + return commit->object.sha1; +} + +enum ack_type { + NAK = 0, + ACK, + ACK_continue, + ACK_common, + ACK_ready +}; + +static void consume_shallow_list(struct fetch_pack_args *args, int fd) +{ + if (args->stateless_rpc && args->depth > 0) { + /* If we sent a depth we will get back "duplicate" + * shallow and unshallow commands every time there + * is a block of have lines exchanged. + */ + char line[1000]; + while (packet_read_line(fd, line, sizeof(line))) { + if (!prefixcmp(line, "shallow ")) + continue; + if (!prefixcmp(line, "unshallow ")) + continue; + die("git fetch-pack: expected shallow list"); + } + } +} + +struct write_shallow_data { + struct strbuf *out; + int use_pack_protocol; + int count; +}; + +static int write_one_shallow(const struct commit_graft *graft, void *cb_data) +{ + struct write_shallow_data *data = cb_data; + const char *hex = sha1_to_hex(graft->sha1); + data->count++; + if (data->use_pack_protocol) + packet_buf_write(data->out, "shallow %s", hex); + else { + strbuf_addstr(data->out, hex); + strbuf_addch(data->out, '\n'); + } + return 0; +} + +static int write_shallow_commits(struct strbuf *out, int use_pack_protocol) +{ + struct write_shallow_data data; + data.out = out; + data.use_pack_protocol = use_pack_protocol; + data.count = 0; + for_each_commit_graft(write_one_shallow, &data); + return data.count; +} + +static enum ack_type get_ack(int fd, unsigned char *result_sha1) +{ + static char line[1000]; + int len = packet_read_line(fd, line, sizeof(line)); + + if (!len) + die("git fetch-pack: expected ACK/NAK, got EOF"); + if (line[len-1] == '\n') + line[--len] = 0; + if (!strcmp(line, "NAK")) + return NAK; + if (!prefixcmp(line, "ACK ")) { + if (!get_sha1_hex(line+4, result_sha1)) { + if (strstr(line+45, "continue")) + return ACK_continue; + if (strstr(line+45, "common")) + return ACK_common; + if (strstr(line+45, "ready")) + return ACK_ready; + return ACK; + } + } + die("git fetch_pack: expected ACK/NAK, got '%s'", line); +} + +static void send_request(struct fetch_pack_args *args, + int fd, struct strbuf *buf) +{ + if (args->stateless_rpc) { + send_sideband(fd, -1, buf->buf, buf->len, LARGE_PACKET_MAX); + packet_flush(fd); + } else + safe_write(fd, buf->buf, buf->len); +} + +static void insert_one_alternate_ref(const struct ref *ref, void *unused) +{ + rev_list_insert_ref(NULL, ref->old_sha1, 0, NULL); +} + +#define INITIAL_FLUSH 16 +#define PIPESAFE_FLUSH 32 +#define LARGE_FLUSH 1024 + +static int next_flush(struct fetch_pack_args *args, int count) +{ + int flush_limit = args->stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH; + + if (count < flush_limit) + count <<= 1; + else + count += flush_limit; + return count; +} + +static int find_common(struct fetch_pack_args *args, + int fd[2], unsigned char *result_sha1, + struct ref *refs) +{ + int fetching; + int count = 0, flushes = 0, flush_at = INITIAL_FLUSH, retval; + const unsigned char *sha1; + unsigned in_vain = 0; + int got_continue = 0; + int got_ready = 0; + struct strbuf req_buf = STRBUF_INIT; + size_t state_len = 0; + + if (args->stateless_rpc && multi_ack == 1) + die("--stateless-rpc requires multi_ack_detailed"); + if (marked) + for_each_ref(clear_marks, NULL); + marked = 1; + + for_each_ref(rev_list_insert_ref, NULL); + for_each_alternate_ref(insert_one_alternate_ref, NULL); + + fetching = 0; + for ( ; refs ; refs = refs->next) { + unsigned char *remote = refs->old_sha1; + const char *remote_hex; + struct object *o; + + /* + * If that object is complete (i.e. it is an ancestor of a + * local ref), we tell them we have it but do not have to + * tell them about its ancestors, which they already know + * about. + * + * We use lookup_object here because we are only + * interested in the case we *know* the object is + * reachable and we have already scanned it. + */ + if (((o = lookup_object(remote)) != NULL) && + (o->flags & COMPLETE)) { + continue; + } + + remote_hex = sha1_to_hex(remote); + if (!fetching) { + struct strbuf c = STRBUF_INIT; + if (multi_ack == 2) strbuf_addstr(&c, " multi_ack_detailed"); + if (multi_ack == 1) strbuf_addstr(&c, " multi_ack"); + if (no_done) strbuf_addstr(&c, " no-done"); + if (use_sideband == 2) strbuf_addstr(&c, " side-band-64k"); + if (use_sideband == 1) strbuf_addstr(&c, " side-band"); + if (args->use_thin_pack) strbuf_addstr(&c, " thin-pack"); + if (args->no_progress) strbuf_addstr(&c, " no-progress"); + if (args->include_tag) strbuf_addstr(&c, " include-tag"); + if (prefer_ofs_delta) strbuf_addstr(&c, " ofs-delta"); + if (agent_supported) strbuf_addf(&c, " agent=%s", + git_user_agent_sanitized()); + packet_buf_write(&req_buf, "want %s%s\n", remote_hex, c.buf); + strbuf_release(&c); + } else + packet_buf_write(&req_buf, "want %s\n", remote_hex); + fetching++; + } + + if (!fetching) { + strbuf_release(&req_buf); + packet_flush(fd[1]); + return 1; + } + + if (is_repository_shallow()) + write_shallow_commits(&req_buf, 1); + if (args->depth > 0) + packet_buf_write(&req_buf, "deepen %d", args->depth); + packet_buf_flush(&req_buf); + state_len = req_buf.len; + + if (args->depth > 0) { + char line[1024]; + unsigned char sha1[20]; + + send_request(args, fd[1], &req_buf); + while (packet_read_line(fd[0], line, sizeof(line))) { + if (!prefixcmp(line, "shallow ")) { + if (get_sha1_hex(line + 8, sha1)) + die("invalid shallow line: %s", line); + register_shallow(sha1); + continue; + } + if (!prefixcmp(line, "unshallow ")) { + if (get_sha1_hex(line + 10, sha1)) + die("invalid unshallow line: %s", line); + if (!lookup_object(sha1)) + die("object not found: %s", line); + /* make sure that it is parsed as shallow */ + if (!parse_object(sha1)) + die("error in object: %s", line); + if (unregister_shallow(sha1)) + die("no shallow found: %s", line); + continue; + } + die("expected shallow/unshallow, got %s", line); + } + } else if (!args->stateless_rpc) + send_request(args, fd[1], &req_buf); + + if (!args->stateless_rpc) { + /* If we aren't using the stateless-rpc interface + * we don't need to retain the headers. + */ + strbuf_setlen(&req_buf, 0); + state_len = 0; + } + + flushes = 0; + retval = -1; + while ((sha1 = get_rev())) { + packet_buf_write(&req_buf, "have %s\n", sha1_to_hex(sha1)); + if (args->verbose) + fprintf(stderr, "have %s\n", sha1_to_hex(sha1)); + in_vain++; + if (flush_at <= ++count) { + int ack; + + packet_buf_flush(&req_buf); + send_request(args, fd[1], &req_buf); + strbuf_setlen(&req_buf, state_len); + flushes++; + flush_at = next_flush(args, count); + + /* + * We keep one window "ahead" of the other side, and + * will wait for an ACK only on the next one + */ + if (!args->stateless_rpc && count == INITIAL_FLUSH) + continue; + + consume_shallow_list(args, fd[0]); + do { + ack = get_ack(fd[0], result_sha1); + if (args->verbose && ack) + fprintf(stderr, "got ack %d %s\n", ack, + sha1_to_hex(result_sha1)); + switch (ack) { + case ACK: + flushes = 0; + multi_ack = 0; + retval = 0; + goto done; + case ACK_common: + case ACK_ready: + case ACK_continue: { + struct commit *commit = + lookup_commit(result_sha1); + if (!commit) + die("invalid commit %s", sha1_to_hex(result_sha1)); + if (args->stateless_rpc + && ack == ACK_common + && !(commit->object.flags & COMMON)) { + /* We need to replay the have for this object + * on the next RPC request so the peer knows + * it is in common with us. + */ + const char *hex = sha1_to_hex(result_sha1); + packet_buf_write(&req_buf, "have %s\n", hex); + state_len = req_buf.len; + } + mark_common(commit, 0, 1); + retval = 0; + in_vain = 0; + got_continue = 1; + if (ack == ACK_ready) { + rev_list = NULL; + got_ready = 1; + } + break; + } + } + } while (ack); + flushes--; + if (got_continue && MAX_IN_VAIN < in_vain) { + if (args->verbose) + fprintf(stderr, "giving up\n"); + break; /* give up */ + } + } + } +done: + if (!got_ready || !no_done) { + packet_buf_write(&req_buf, "done\n"); + send_request(args, fd[1], &req_buf); + } + if (args->verbose) + fprintf(stderr, "done\n"); + if (retval != 0) { + multi_ack = 0; + flushes++; + } + strbuf_release(&req_buf); + + consume_shallow_list(args, fd[0]); + while (flushes || multi_ack) { + int ack = get_ack(fd[0], result_sha1); + if (ack) { + if (args->verbose) + fprintf(stderr, "got ack (%d) %s\n", ack, + sha1_to_hex(result_sha1)); + if (ack == ACK) + return 0; + multi_ack = 1; + continue; + } + flushes--; + } + /* it is no error to fetch into a completely empty repo */ + return count ? retval : 0; +} + +static struct commit_list *complete; + +static int mark_complete(const char *refname, const unsigned char *sha1, int flag, void *cb_data) +{ + struct object *o = parse_object(sha1); + + while (o && o->type == OBJ_TAG) { + struct tag *t = (struct tag *) o; + if (!t->tagged) + break; /* broken repository */ + o->flags |= COMPLETE; + o = parse_object(t->tagged->sha1); + } + if (o && o->type == OBJ_COMMIT) { + struct commit *commit = (struct commit *)o; + if (!(commit->object.flags & COMPLETE)) { + commit->object.flags |= COMPLETE; + commit_list_insert_by_date(commit, &complete); + } + } + return 0; +} + +static void mark_recent_complete_commits(struct fetch_pack_args *args, + unsigned long cutoff) +{ + while (complete && cutoff <= complete->item->date) { + if (args->verbose) + fprintf(stderr, "Marking %s as complete\n", + sha1_to_hex(complete->item->object.sha1)); + pop_most_recent_commit(&complete, COMPLETE); + } +} + +static int non_matching_ref(struct string_list_item *item, void *unused) +{ + if (item->util) { + item->util = NULL; + return 0; + } + else + return 1; +} + +static void filter_refs(struct fetch_pack_args *args, + struct ref **refs, struct string_list *sought) +{ + struct ref *newlist = NULL; + struct ref **newtail = &newlist; + struct ref *ref, *next; + int sought_pos; + + sought_pos = 0; + for (ref = *refs; ref; ref = next) { + int keep = 0; + next = ref->next; + if (!memcmp(ref->name, "refs/", 5) && + check_refname_format(ref->name + 5, 0)) + ; /* trash */ + else { + while (sought_pos < sought->nr) { + int cmp = strcmp(ref->name, sought->items[sought_pos].string); + if (cmp < 0) + break; /* definitely do not have it */ + else if (cmp == 0) { + keep = 1; /* definitely have it */ + sought->items[sought_pos++].util = "matched"; + break; + } + else + sought_pos++; /* might have it; keep looking */ + } + } + + if (! keep && args->fetch_all && + (!args->depth || prefixcmp(ref->name, "refs/tags/"))) + keep = 1; + + if (keep) { + *newtail = ref; + ref->next = NULL; + newtail = &ref->next; + } else { + free(ref); + } + } + + filter_string_list(sought, 0, non_matching_ref, NULL); + *refs = newlist; +} + +static void mark_alternate_complete(const struct ref *ref, void *unused) +{ + mark_complete(NULL, ref->old_sha1, 0, NULL); +} + +static int everything_local(struct fetch_pack_args *args, + struct ref **refs, struct string_list *sought) +{ + struct ref *ref; + int retval; + unsigned long cutoff = 0; + + save_commit_buffer = 0; + + for (ref = *refs; ref; ref = ref->next) { + struct object *o; + + o = parse_object(ref->old_sha1); + if (!o) + continue; + + /* We already have it -- which may mean that we were + * in sync with the other side at some time after + * that (it is OK if we guess wrong here). + */ + if (o->type == OBJ_COMMIT) { + struct commit *commit = (struct commit *)o; + if (!cutoff || cutoff < commit->date) + cutoff = commit->date; + } + } + + if (!args->depth) { + for_each_ref(mark_complete, NULL); + for_each_alternate_ref(mark_alternate_complete, NULL); + if (cutoff) + mark_recent_complete_commits(args, cutoff); + } + + /* + * Mark all complete remote refs as common refs. + * Don't mark them common yet; the server has to be told so first. + */ + for (ref = *refs; ref; ref = ref->next) { + struct object *o = deref_tag(lookup_object(ref->old_sha1), + NULL, 0); + + if (!o || o->type != OBJ_COMMIT || !(o->flags & COMPLETE)) + continue; + + if (!(o->flags & SEEN)) { + rev_list_push((struct commit *)o, COMMON_REF | SEEN); + + mark_common((struct commit *)o, 1, 1); + } + } + + filter_refs(args, refs, sought); + + for (retval = 1, ref = *refs; ref ; ref = ref->next) { + const unsigned char *remote = ref->old_sha1; + unsigned char local[20]; + struct object *o; + + o = lookup_object(remote); + if (!o || !(o->flags & COMPLETE)) { + retval = 0; + if (!args->verbose) + continue; + fprintf(stderr, + "want %s (%s)\n", sha1_to_hex(remote), + ref->name); + continue; + } + + hashcpy(ref->new_sha1, local); + if (!args->verbose) + continue; + fprintf(stderr, + "already have %s (%s)\n", sha1_to_hex(remote), + ref->name); + } + return retval; +} + +static int sideband_demux(int in, int out, void *data) +{ + int *xd = data; + + int ret = recv_sideband("fetch-pack", xd[0], out); + close(out); + return ret; +} + +static int get_pack(struct fetch_pack_args *args, + int xd[2], char **pack_lockfile) +{ + struct async demux; + const char *argv[20]; + char keep_arg[256]; + char hdr_arg[256]; + const char **av; + int do_keep = args->keep_pack; + struct child_process cmd; + + memset(&demux, 0, sizeof(demux)); + if (use_sideband) { + /* xd[] is talking with upload-pack; subprocess reads from + * xd[0], spits out band#2 to stderr, and feeds us band#1 + * through demux->out. + */ + demux.proc = sideband_demux; + demux.data = xd; + demux.out = -1; + if (start_async(&demux)) + die("fetch-pack: unable to fork off sideband" + " demultiplexer"); + } + else + demux.out = xd[0]; + + memset(&cmd, 0, sizeof(cmd)); + cmd.argv = argv; + av = argv; + *hdr_arg = 0; + if (!args->keep_pack && unpack_limit) { + struct pack_header header; + + if (read_pack_header(demux.out, &header)) + die("protocol error: bad pack header"); + snprintf(hdr_arg, sizeof(hdr_arg), + "--pack_header=%"PRIu32",%"PRIu32, + ntohl(header.hdr_version), ntohl(header.hdr_entries)); + if (ntohl(header.hdr_entries) < unpack_limit) + do_keep = 0; + else + do_keep = 1; + } + + if (do_keep) { + if (pack_lockfile) + cmd.out = -1; + *av++ = "index-pack"; + *av++ = "--stdin"; + if (!args->quiet && !args->no_progress) + *av++ = "-v"; + if (args->use_thin_pack) + *av++ = "--fix-thin"; + if (args->lock_pack || unpack_limit) { + int s = sprintf(keep_arg, + "--keep=fetch-pack %"PRIuMAX " on ", (uintmax_t) getpid()); + if (gethostname(keep_arg + s, sizeof(keep_arg) - s)) + strcpy(keep_arg + s, "localhost"); + *av++ = keep_arg; + } + } + else { + *av++ = "unpack-objects"; + if (args->quiet || args->no_progress) + *av++ = "-q"; + } + if (*hdr_arg) + *av++ = hdr_arg; + if (fetch_fsck_objects >= 0 + ? fetch_fsck_objects + : transfer_fsck_objects >= 0 + ? transfer_fsck_objects + : 0) + *av++ = "--strict"; + *av++ = NULL; + + cmd.in = demux.out; + cmd.git_cmd = 1; + if (start_command(&cmd)) + die("fetch-pack: unable to fork off %s", argv[0]); + if (do_keep && pack_lockfile) { + *pack_lockfile = index_pack_lockfile(cmd.out); + close(cmd.out); + } + + if (finish_command(&cmd)) + die("%s failed", argv[0]); + if (use_sideband && finish_async(&demux)) + die("error in sideband demultiplexer"); + return 0; +} + +static struct ref *do_fetch_pack(struct fetch_pack_args *args, + int fd[2], + const struct ref *orig_ref, + struct string_list *sought, + char **pack_lockfile) +{ + struct ref *ref = copy_ref_list(orig_ref); + unsigned char sha1[20]; + const char *agent_feature; + int agent_len; + + sort_ref_list(&ref, ref_compare_name); + + if (is_repository_shallow() && !server_supports("shallow")) + die("Server does not support shallow clients"); + if (server_supports("multi_ack_detailed")) { + if (args->verbose) + fprintf(stderr, "Server supports multi_ack_detailed\n"); + multi_ack = 2; + if (server_supports("no-done")) { + if (args->verbose) + fprintf(stderr, "Server supports no-done\n"); + if (args->stateless_rpc) + no_done = 1; + } + } + else if (server_supports("multi_ack")) { + if (args->verbose) + fprintf(stderr, "Server supports multi_ack\n"); + multi_ack = 1; + } + if (server_supports("side-band-64k")) { + if (args->verbose) + fprintf(stderr, "Server supports side-band-64k\n"); + use_sideband = 2; + } + else if (server_supports("side-band")) { + if (args->verbose) + fprintf(stderr, "Server supports side-band\n"); + use_sideband = 1; + } + if (!server_supports("thin-pack")) + args->use_thin_pack = 0; + if (!server_supports("no-progress")) + args->no_progress = 0; + if (!server_supports("include-tag")) + args->include_tag = 0; + if (server_supports("ofs-delta")) { + if (args->verbose) + fprintf(stderr, "Server supports ofs-delta\n"); + } else + prefer_ofs_delta = 0; + + if ((agent_feature = server_feature_value("agent", &agent_len))) { + agent_supported = 1; + if (args->verbose && agent_len) + fprintf(stderr, "Server version is %.*s\n", + agent_len, agent_feature); + } + + if (everything_local(args, &ref, sought)) { + packet_flush(fd[1]); + goto all_done; + } + if (find_common(args, fd, sha1, ref) < 0) + if (!args->keep_pack) + /* When cloning, it is not unusual to have + * no common commit. + */ + warning("no common commits"); + + if (args->stateless_rpc) + packet_flush(fd[1]); + if (get_pack(args, fd, pack_lockfile)) + die("git fetch-pack: fetch failed."); + + all_done: + return ref; +} + +static int fetch_pack_config(const char *var, const char *value, void *cb) +{ + if (strcmp(var, "fetch.unpacklimit") == 0) { + fetch_unpack_limit = git_config_int(var, value); + return 0; + } + + if (strcmp(var, "transfer.unpacklimit") == 0) { + transfer_unpack_limit = git_config_int(var, value); + return 0; + } + + if (strcmp(var, "repack.usedeltabaseoffset") == 0) { + prefer_ofs_delta = git_config_bool(var, value); + return 0; + } + + if (!strcmp(var, "fetch.fsckobjects")) { + fetch_fsck_objects = git_config_bool(var, value); + return 0; + } + + if (!strcmp(var, "transfer.fsckobjects")) { + transfer_fsck_objects = git_config_bool(var, value); + return 0; + } + + return git_default_config(var, value, cb); +} + +static struct lock_file lock; + +static void fetch_pack_setup(void) +{ + static int did_setup; + if (did_setup) + return; + git_config(fetch_pack_config, NULL); + if (0 <= transfer_unpack_limit) + unpack_limit = transfer_unpack_limit; + else if (0 <= fetch_unpack_limit) + unpack_limit = fetch_unpack_limit; + did_setup = 1; +} + +struct ref *fetch_pack(struct fetch_pack_args *args, + int fd[], struct child_process *conn, + const struct ref *ref, + const char *dest, + struct string_list *sought, + char **pack_lockfile) +{ + struct stat st; + struct ref *ref_cpy; + + fetch_pack_setup(); + if (args->depth > 0) { + if (stat(git_path("shallow"), &st)) + st.st_mtime = 0; + } + + if (sought->nr) { + sort_string_list(sought); + string_list_remove_duplicates(sought, 0); + } + + if (!ref) { + packet_flush(fd[1]); + die("no matching remote head"); + } + ref_cpy = do_fetch_pack(args, fd, ref, sought, pack_lockfile); + + if (args->depth > 0) { + struct cache_time mtime; + struct strbuf sb = STRBUF_INIT; + char *shallow = git_path("shallow"); + int fd; + + mtime.sec = st.st_mtime; + mtime.nsec = ST_MTIME_NSEC(st); + if (stat(shallow, &st)) { + if (mtime.sec) + die("shallow file was removed during fetch"); + } else if (st.st_mtime != mtime.sec +#ifdef USE_NSEC + || ST_MTIME_NSEC(st) != mtime.nsec +#endif + ) + die("shallow file was changed during fetch"); + + fd = hold_lock_file_for_update(&lock, shallow, + LOCK_DIE_ON_ERROR); + if (!write_shallow_commits(&sb, 0) + || write_in_full(fd, sb.buf, sb.len) != sb.len) { + unlink_or_warn(shallow); + rollback_lock_file(&lock); + } else { + commit_lock_file(&lock); + } + strbuf_release(&sb); + } + + reprepare_packed_git(); + return ref_cpy; +} diff --git a/fetch-pack.h b/fetch-pack.h index 7c2069c972..cb148719bf 100644 --- a/fetch-pack.h +++ b/fetch-pack.h @@ -1,6 +1,8 @@ #ifndef FETCH_PACK_H #define FETCH_PACK_H +#include "string-list.h" + struct fetch_pack_args { const char *uploadpack; int unpacklimit; @@ -17,12 +19,18 @@ struct fetch_pack_args { stateless_rpc:1; }; +/* + * sought contains the full names of remote references that should be + * updated from. On return, the names that were found on the remote + * will have been removed from the list. The util members of the + * string_list_items are used internally; they must be NULL on entry + * (and will be NULL on exit). + */ struct ref *fetch_pack(struct fetch_pack_args *args, - int fd[], struct child_process *conn, - const struct ref *ref, - const char *dest, - int nr_heads, - char **heads, - char **pack_lockfile); + int fd[], struct child_process *conn, + const struct ref *ref, + const char *dest, + struct string_list *sought, + char **pack_lockfile); #endif diff --git a/gettext.c b/gettext.c index f75bca7f56..71e954563d 100644 --- a/gettext.c +++ b/gettext.c @@ -4,6 +4,8 @@ #include "git-compat-util.h" #include "gettext.h" +#include "strbuf.h" +#include "utf8.h" #ifndef NO_GETTEXT # include @@ -27,10 +29,9 @@ int use_gettext_poison(void) #endif #ifndef NO_GETTEXT +static const char *charset; static void init_gettext_charset(const char *domain) { - const char *charset; - /* This trick arranges for messages to be emitted in the user's requested encoding, but avoids setting LC_CTYPE from the @@ -128,4 +129,14 @@ void git_setup_gettext(void) init_gettext_charset("git"); textdomain("git"); } + +/* return the number of columns of string 's' in current locale */ +int gettext_width(const char *s) +{ + static int is_utf8 = -1; + if (is_utf8 == -1) + is_utf8 = !strcmp(charset, "UTF-8"); + + return is_utf8 ? utf8_strwidth(s) : strlen(s); +} #endif diff --git a/gettext.h b/gettext.h index 376297bf73..7671d09d04 100644 --- a/gettext.h +++ b/gettext.h @@ -30,10 +30,15 @@ #ifndef NO_GETTEXT extern void git_setup_gettext(void); +extern int gettext_width(const char *s); #else static inline void git_setup_gettext(void) { } +static inline int gettext_width(const char *s) +{ + return strlen(s); +} #endif #ifdef GETTEXT_POISON diff --git a/git-compat-util.h b/git-compat-util.h index 2fbf1fd8b1..2e79b8a2f3 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -506,6 +506,7 @@ extern const char tolower_trans_tbl[256]; #undef isdigit #undef isalpha #undef isalnum +#undef isprint #undef islower #undef isupper #undef tolower @@ -523,6 +524,7 @@ extern unsigned char sane_ctype[256]; #define isdigit(x) sane_istest(x,GIT_DIGIT) #define isalpha(x) sane_istest(x,GIT_ALPHA) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) +#define isprint(x) ((x) >= 0x20 && (x) <= 0x7e) #define islower(x) sane_iscase(x, 1) #define isupper(x) sane_iscase(x, 0) #define is_glob_special(x) sane_istest(x,GIT_GLOB_SPECIAL) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 8032f23202..0a31ebd820 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -24,14 +24,14 @@ use Time::Local; use IO::Socket; use IO::Pipe; -use POSIX qw(strftime dup2 ENOENT); +use POSIX qw(strftime tzset dup2 ENOENT); use IPC::Open2; $SIG{'PIPE'}="IGNORE"; -$ENV{'TZ'}="UTC"; +set_timezone('UTC'); our ($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,@opt_M,$opt_A,$opt_S,$opt_L, $opt_a, $opt_r, $opt_R); -my (%conv_author_name, %conv_author_email); +my (%conv_author_name, %conv_author_email, %conv_author_tz); sub usage(;$) { my $msg = shift; @@ -59,6 +59,14 @@ ($) $conv_author_name{$user} = $2; $conv_author_email{$user} = $3; } + # or with an optional timezone: + # spawn=Simon Pawn America/Chicago + elsif (m/^(\S+?)\s*=\s*(.+?)\s*<(.+)>\s*(\S+?)\s*$/) { + $user = $1; + $conv_author_name{$user} = $2; + $conv_author_email{$user} = $3; + $conv_author_tz{$user} = $4; + } # However, we also read from CVSROOT/users format # to ease migration. elsif (/^(\w+):(['"]?)(.+?)\2\s*$/) { @@ -84,11 +92,22 @@ ($) die("Failed to open $file for writing: $!"); foreach (keys %conv_author_name) { - print $f "$_=$conv_author_name{$_} <$conv_author_email{$_}>\n"; + print $f "$_=$conv_author_name{$_} <$conv_author_email{$_}>"; + print $f " $conv_author_tz{$_}" if ($conv_author_tz{$_}); + print $f "\n"; } close ($f); } +# Versions of perl before 5.10.0 may not automatically check $TZ each +# time localtime is run (most platforms will do so only the first time). +# We can work around this by using tzset() to update the internal +# variable whenever we change the environment. +sub set_timezone { + $ENV{TZ} = shift; + tzset(); +} + # convert getopts specs for use by git config my %longmap = ( 'A:' => 'authors-file', @@ -795,7 +814,7 @@ () return $tree; } -my ($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg); +my ($patchset,$date,$author_name,$author_email,$author_tz,$branch,$ancestor,$tag,$logmsg); my (@old,@new,@skipped,%ignorebranch,@commit_revisions); # commits that cvsps cannot place anywhere... @@ -844,7 +863,9 @@ sub commit { } } - my $commit_date = strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)); + set_timezone($author_tz); + my $commit_date = strftime("%s %z", localtime($date)); + set_timezone('UTC'); $ENV{GIT_AUTHOR_NAME} = $author_name; $ENV{GIT_AUTHOR_EMAIL} = $author_email; $ENV{GIT_AUTHOR_DATE} = $commit_date; @@ -945,12 +966,14 @@ sub commit { } $state=3; } elsif ($state == 3 and s/^Author:\s+//) { + $author_tz = "UTC"; s/\s+$//; if (/^(.*?)\s+<(.*)>/) { ($author_name, $author_email) = ($1, $2); } elsif ($conv_author_name{$_}) { $author_name = $conv_author_name{$_}; $author_email = $conv_author_email{$_}; + $author_tz = $conv_author_tz{$_} if ($conv_author_tz{$_}); } else { $author_name = $author_email = $_; } diff --git a/git-cvsserver.perl b/git-cvsserver.perl index b8eddabc94..c5ebfa0636 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -51,6 +51,10 @@ #### Definition and mappings of functions #### +# NOTE: Despite the existence of req_CATCHALL and req_EMPTY unimplemented +# requests, this list is incomplete. It is missing many rarer/optional +# requests. Perhaps some clients require a claim of support for +# these specific requests for main functionality to work? my $methods = { 'Root' => \&req_Root, 'Valid-responses' => \&req_Validresponses, @@ -80,7 +84,6 @@ 'noop' => \&req_EMPTY, 'annotate' => \&req_annotate, 'Global_option' => \&req_Globaloption, - #'annotate' => \&req_CATCHALL, }; ############################################## @@ -499,7 +502,7 @@ sub req_Entry #$log->debug("req_Entry : $data"); - my @data = split(/\//, $data); + my @data = split(/\//, $data, -1); $state->{entries}{$state->{directory}.$data[1]} = { revision => $data[2], @@ -540,8 +543,6 @@ sub req_add my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); $updater->update(); - argsfromdir($updater); - my $addcount = 0; foreach my $filename ( @{$state->{args}} ) @@ -551,10 +552,10 @@ sub req_add my $meta = $updater->getmeta($filename); my $wrev = revparse($filename); - if ($wrev && $meta && ($wrev < 0)) + if ($wrev && $meta && ($wrev=~/^-/)) { # previously removed file, add back - $log->info("added file $filename was previously removed, send 1.$meta->{revision}"); + $log->info("added file $filename was previously removed, send $meta->{revision}"); print "MT +updated\n"; print "MT text U \n"; @@ -571,8 +572,8 @@ sub req_add # this is an "entries" line my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - $log->debug("/$filepart/1.$meta->{revision}//$kopts/"); - print "/$filepart/1.$meta->{revision}//$kopts/\n"; + $log->debug("/$filepart/$meta->{revision}//$kopts/"); + print "/$filepart/$meta->{revision}//$kopts/\n"; # permissions $log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}"); print "u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}\n"; @@ -680,13 +681,13 @@ sub req_remove next; } - if ( defined($wrev) and $wrev < 0 ) + if ( defined($wrev) and ($wrev=~/^-/) ) { print "E cvs remove: file `$filename' already scheduled for removal\n"; next; } - unless ( $wrev == $meta->{revision} ) + unless ( $wrev eq $meta->{revision} ) { # TODO : not sure if the format of this message is quite correct. print "E cvs remove: Up to date check failed for `$filename'\n"; @@ -701,7 +702,7 @@ sub req_remove print "Checked-in $dirpart\n"; print "$filename\n"; my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - print "/$filepart/-1.$wrev//$kopts/\n"; + print "/$filepart/-$wrev//$kopts/\n"; $rmcount++; } @@ -992,7 +993,7 @@ sub req_co # this is an "entries" line my $kopts = kopts_from_path($fullName,"sha1",$git->{filehash}); - print "/$git->{name}/1.$git->{revision}//$kopts/\n"; + print "/$git->{name}/$git->{revision}//$kopts/\n"; # permissions print "u=$git->{mode},g=$git->{mode},o=$git->{mode}\n"; @@ -1080,7 +1081,7 @@ sub req_update } my $meta; - if ( defined($state->{opt}{r}) and $state->{opt}{r} =~ /^1\.(\d+)/ ) + if ( defined($state->{opt}{r}) and $state->{opt}{r} =~ /^(1\.\d+)$/ ) { $meta = $updater->getmeta($filename, $1); } else { @@ -1102,7 +1103,7 @@ sub req_update { $meta = { name => $filename, - revision => 0, + revision => '0', filehash => 'added' }; } @@ -1112,7 +1113,7 @@ sub req_update my $wrev = revparse($filename); # If the working copy is an old revision, lets get that version too for comparison. - if ( defined($wrev) and $wrev != $meta->{revision} ) + if ( defined($wrev) and $wrev ne $meta->{revision} ) { $oldmeta = $updater->getmeta($filename, $wrev); } @@ -1123,7 +1124,7 @@ sub req_update # and the working copy is unmodified _and_ the user hasn't specified -C next if ( defined ( $wrev ) and defined($meta->{revision}) - and $wrev == $meta->{revision} + and $wrev eq $meta->{revision} and $state->{entries}{$filename}{unchanged} and not exists ( $state->{opt}{C} ) ); @@ -1131,7 +1132,7 @@ sub req_update # but the working copy is modified, tell the client it's modified if ( defined ( $wrev ) and defined($meta->{revision}) - and $wrev == $meta->{revision} + and $wrev eq $meta->{revision} and defined($state->{entries}{$filename}{modified_hash}) and not exists ( $state->{opt}{C} ) ) { @@ -1144,6 +1145,10 @@ sub req_update if ( $meta->{filehash} eq "deleted" ) { + # TODO: If it has been modified in the sandbox, error out + # with the appropriate message, rather than deleting a modified + # file. + my ( $filepart, $dirpart ) = filenamesplit($filename,1); $log->info("Removing '$filename' from working copy (no longer in the repo)"); @@ -1161,7 +1166,7 @@ sub req_update { # normal update, just send the new revision (either U=Update, # or A=Add, or R=Remove) - if ( defined($wrev) && $wrev < 0 ) + if ( defined($wrev) && ($wrev=~/^-/) ) { $log->info("Tell the client the file is scheduled for removal"); print "MT text R \n"; @@ -1169,7 +1174,8 @@ sub req_update print "MT newline\n"; next; } - elsif ( (!defined($wrev) || $wrev == 0) && (!defined($meta->{revision}) || $meta->{revision} == 0) ) + elsif ( (!defined($wrev) || $wrev eq '0') && + (!defined($meta->{revision}) || $meta->{revision} eq '0') ) { $log->info("Tell the client the file is scheduled for addition"); print "MT text A \n"; @@ -1179,7 +1185,7 @@ sub req_update } else { - $log->info("Updating '$filename' to ".$meta->{revision}); + $log->info("UpdatingX3 '$filename' to ".$meta->{revision}); print "MT +updated\n"; print "MT text U \n"; print "MT fname $filename\n"; @@ -1211,8 +1217,8 @@ sub req_update # this is an "entries" line my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - $log->debug("/$filepart/1.$meta->{revision}//$kopts/"); - print "/$filepart/1.$meta->{revision}//$kopts/\n"; + $log->debug("/$filepart/$meta->{revision}//$kopts/"); + print "/$filepart/$meta->{revision}//$kopts/\n"; # permissions $log->debug("SEND : u=$meta->{mode},g=$meta->{mode},o=$meta->{mode}"); @@ -1222,7 +1228,6 @@ sub req_update transmitfile($meta->{filehash}); } } else { - $log->info("Updating '$filename'"); my ( $filepart, $dirpart ) = filenamesplit($meta->{name},1); my $mergeDir = setupTmpDir(); @@ -1237,7 +1242,7 @@ sub req_update # we need to merge with the local changes ( M=successful merge, C=conflict merge ) $log->info("Merging $file_local, $file_old, $file_new"); - print "M Merging differences between 1.$oldmeta->{revision} and 1.$meta->{revision} into $filename\n"; + print "M Merging differences between $oldmeta->{revision} and $meta->{revision} into $filename\n"; $log->debug("Temporary directory for merge is $mergeDir"); @@ -1260,8 +1265,8 @@ sub req_update print $state->{CVSROOT} . "/$state->{module}/$filename\n"; my $kopts = kopts_from_path("$dirpart/$filepart", "file",$mergedFile); - $log->debug("/$filepart/1.$meta->{revision}//$kopts/"); - print "/$filepart/1.$meta->{revision}//$kopts/\n"; + $log->debug("/$filepart/$meta->{revision}//$kopts/"); + print "/$filepart/$meta->{revision}//$kopts/\n"; } } elsif ( $return == 1 ) @@ -1277,7 +1282,7 @@ sub req_update print $state->{CVSROOT} . "/$state->{module}/$filename\n"; my $kopts = kopts_from_path("$dirpart/$filepart", "file",$mergedFile); - print "/$filepart/1.$meta->{revision}/+/$kopts/\n"; + print "/$filepart/$meta->{revision}/+/$kopts/\n"; } } else @@ -1380,11 +1385,12 @@ sub req_ci my $addflag = 0; my $rmflag = 0; - $rmflag = 1 if ( defined($wrev) and $wrev < 0 ); + $rmflag = 1 if ( defined($wrev) and ($wrev=~/^-/) ); $addflag = 1 unless ( -e $filename ); # Do up to date checking - unless ( $addflag or $wrev == $meta->{revision} or ( $rmflag and -$wrev == $meta->{revision} ) ) + unless ( $addflag or $wrev eq $meta->{revision} or + ( $rmflag and $wrev eq "-$meta->{revision}" ) ) { # fail everything if an up to date check fails print "error 1 Up to date check failed for $filename\n"; @@ -1421,7 +1427,7 @@ sub req_ci $log->info("Adding file '$filename'"); system("git", "update-index", "--add", $filename); } else { - $log->info("Updating file '$filename'"); + $log->info("UpdatingX2 file '$filename'"); system("git", "update-index", $filename); } } @@ -1512,7 +1518,7 @@ sub req_ci my $meta = $updater->getmeta($filename); unless (defined $meta->{revision}) { - $meta->{revision} = 1; + $meta->{revision} = "1.1"; } my ( $filepart, $dirpart ) = filenamesplit($filename, 1); @@ -1522,19 +1528,19 @@ sub req_ci print "M $state->{CVSROOT}/$state->{module}/$filename,v <-- $dirpart$filepart\n"; if ( defined $meta->{filehash} && $meta->{filehash} eq "deleted" ) { - print "M new revision: delete; previous revision: 1.$oldmeta{$filename}{revision}\n"; + print "M new revision: delete; previous revision: $oldmeta{$filename}{revision}\n"; print "Remove-entry $dirpart\n"; print "$filename\n"; } else { - if ($meta->{revision} == 1) { + if ($meta->{revision} eq "1.1") { print "M initial revision: 1.1\n"; } else { - print "M new revision: 1.$meta->{revision}; previous revision: 1.$oldmeta{$filename}{revision}\n"; + print "M new revision: $meta->{revision}; previous revision: $oldmeta{$filename}{revision}\n"; } print "Checked-in $dirpart\n"; print "$filename\n"; my $kopts = kopts_from_path($filename,"sha1",$meta->{filehash}); - print "/$filepart/1.$meta->{revision}//$kopts/\n"; + print "/$filepart/$meta->{revision}//$kopts/\n"; } } @@ -1552,10 +1558,12 @@ sub req_status #$log->debug("status state : " . Dumper($state)); # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); + my $updater; + $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); $updater->update(); - # if no files were specified, we need to work out what files we should be providing status on ... + # if no files were specified, we need to work out what files we should + # be providing status on ... argsfromdir($updater); # foreach file specified on the command line ... @@ -1563,67 +1571,135 @@ sub req_status { $filename = filecleanup($filename); - next if exists($state->{opt}{l}) && index($filename, '/', length($state->{prependdir})) >= 0; + if ( exists($state->{opt}{l}) && + index($filename, '/', length($state->{prependdir})) >= 0 ) + { + next; + } my $meta = $updater->getmeta($filename); my $oldmeta = $meta; my $wrev = revparse($filename); - # If the working copy is an old revision, lets get that version too for comparison. - if ( defined($wrev) and $wrev != $meta->{revision} ) + # If the working copy is an old revision, lets get that + # version too for comparison. + if ( defined($wrev) and $wrev ne $meta->{revision} ) { $oldmeta = $updater->getmeta($filename, $wrev); } # TODO : All possible statuses aren't yet implemented my $status; - # Files are up to date if the working copy and repo copy have the same revision, and the working copy is unmodified - $status = "Up-to-date" if ( defined ( $wrev ) and defined($meta->{revision}) and $wrev == $meta->{revision} - and - ( ( $state->{entries}{$filename}{unchanged} and ( not defined ( $state->{entries}{$filename}{conflict} ) or $state->{entries}{$filename}{conflict} !~ /^\+=/ ) ) - or ( defined($state->{entries}{$filename}{modified_hash}) and $state->{entries}{$filename}{modified_hash} eq $meta->{filehash} ) ) - ); - - # Need checkout if the working copy has an older revision than the repo copy, and the working copy is unmodified - $status ||= "Needs Checkout" if ( defined ( $wrev ) and defined ( $meta->{revision} ) and $meta->{revision} > $wrev - and - ( $state->{entries}{$filename}{unchanged} - or ( defined($state->{entries}{$filename}{modified_hash}) and $state->{entries}{$filename}{modified_hash} eq $oldmeta->{filehash} ) ) - ); - - # Need checkout if it exists in the repo but doesn't have a working copy - $status ||= "Needs Checkout" if ( not defined ( $wrev ) and defined ( $meta->{revision} ) ); - - # Locally modified if working copy and repo copy have the same revision but there are local changes - $status ||= "Locally Modified" if ( defined ( $wrev ) and defined($meta->{revision}) and $wrev == $meta->{revision} and $state->{entries}{$filename}{modified_filename} ); - - # Needs Merge if working copy revision is less than repo copy and there are local changes - $status ||= "Needs Merge" if ( defined ( $wrev ) and defined ( $meta->{revision} ) and $meta->{revision} > $wrev and $state->{entries}{$filename}{modified_filename} ); - - $status ||= "Locally Added" if ( defined ( $state->{entries}{$filename}{revision} ) and not defined ( $meta->{revision} ) ); - $status ||= "Locally Removed" if ( defined ( $wrev ) and defined ( $meta->{revision} ) and -$wrev == $meta->{revision} ); - $status ||= "Unresolved Conflict" if ( defined ( $state->{entries}{$filename}{conflict} ) and $state->{entries}{$filename}{conflict} =~ /^\+=/ ); - $status ||= "File had conflicts on merge" if ( 0 ); + # Files are up to date if the working copy and repo copy have + # the same revision, and the working copy is unmodified + if ( defined ( $wrev ) and defined($meta->{revision}) and + $wrev eq $meta->{revision} and + ( ( $state->{entries}{$filename}{unchanged} and + ( not defined ( $state->{entries}{$filename}{conflict} ) or + $state->{entries}{$filename}{conflict} !~ /^\+=/ ) ) or + ( defined($state->{entries}{$filename}{modified_hash}) and + $state->{entries}{$filename}{modified_hash} eq + $meta->{filehash} ) ) ) + { + $status = "Up-to-date" + } + + # Need checkout if the working copy has a different (usually + # older) revision than the repo copy, and the working copy is + # unmodified + if ( defined ( $wrev ) and defined ( $meta->{revision} ) and + $meta->{revision} ne $wrev and + ( $state->{entries}{$filename}{unchanged} or + ( defined($state->{entries}{$filename}{modified_hash}) and + $state->{entries}{$filename}{modified_hash} eq + $oldmeta->{filehash} ) ) ) + { + $status ||= "Needs Checkout"; + } + + # Need checkout if it exists in the repo but doesn't have a working + # copy + if ( not defined ( $wrev ) and defined ( $meta->{revision} ) ) + { + $status ||= "Needs Checkout"; + } + + # Locally modified if working copy and repo copy have the + # same revision but there are local changes + if ( defined ( $wrev ) and defined($meta->{revision}) and + $wrev eq $meta->{revision} and + $state->{entries}{$filename}{modified_filename} ) + { + $status ||= "Locally Modified"; + } + + # Needs Merge if working copy revision is different + # (usually older) than repo copy and there are local changes + if ( defined ( $wrev ) and defined ( $meta->{revision} ) and + $meta->{revision} ne $wrev and + $state->{entries}{$filename}{modified_filename} ) + { + $status ||= "Needs Merge"; + } + + if ( defined ( $state->{entries}{$filename}{revision} ) and + not defined ( $meta->{revision} ) ) + { + $status ||= "Locally Added"; + } + if ( defined ( $wrev ) and defined ( $meta->{revision} ) and + $wrev eq "-$meta->{revision}" ) + { + $status ||= "Locally Removed"; + } + if ( defined ( $state->{entries}{$filename}{conflict} ) and + $state->{entries}{$filename}{conflict} =~ /^\+=/ ) + { + $status ||= "Unresolved Conflict"; + } + if ( 0 ) + { + $status ||= "File had conflicts on merge"; + } $status ||= "Unknown"; my ($filepart) = filenamesplit($filename); - print "M ===================================================================\n"; + print "M =======" . ( "=" x 60 ) . "\n"; print "M File: $filepart\tStatus: $status\n"; if ( defined($state->{entries}{$filename}{revision}) ) { - print "M Working revision:\t" . $state->{entries}{$filename}{revision} . "\n"; + print "M Working revision:\t" . + $state->{entries}{$filename}{revision} . "\n"; } else { print "M Working revision:\tNo entry for $filename\n"; } if ( defined($meta->{revision}) ) { - print "M Repository revision:\t1." . $meta->{revision} . "\t$state->{CVSROOT}/$state->{module}/$filename,v\n"; - print "M Sticky Tag:\t\t(none)\n"; - print "M Sticky Date:\t\t(none)\n"; - print "M Sticky Options:\t\t(none)\n"; + print "M Repository revision:\t" . + $meta->{revision} . + "\t$state->{CVSROOT}/$state->{module}/$filename,v\n"; + my($tagOrDate)=$state->{entries}{$filename}{tag_or_date}; + my($tag)=($tagOrDate=~m/^T(.+)$/); + if( !defined($tag) ) + { + $tag="(none)"; + } + print "M Sticky Tag:\t\t$tag\n"; + my($date)=($tagOrDate=~m/^D(.+)$/); + if( !defined($date) ) + { + $date="(none)"; + } + print "M Sticky Date:\t\t$date\n"; + my($options)=$state->{entries}{$filename}{options}; + if( $options eq "" ) + { + $options="(none)"; + } + print "M Sticky Options:\t\t$options\n"; } else { print "M Repository revision:\tNo revision control file\n"; } @@ -1651,16 +1727,17 @@ sub req_diff $revision1 = $state->{opt}{r}; } - $revision1 =~ s/^1\.// if ( defined ( $revision1 ) ); - $revision2 =~ s/^1\.// if ( defined ( $revision2 ) ); - - $log->debug("Diffing revisions " . ( defined($revision1) ? $revision1 : "[NULL]" ) . " and " . ( defined($revision2) ? $revision2 : "[NULL]" ) ); + $log->debug("Diffing revisions " . + ( defined($revision1) ? $revision1 : "[NULL]" ) . + " and " . ( defined($revision2) ? $revision2 : "[NULL]" ) ); # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); + my $updater; + $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); $updater->update(); - # if no files were specified, we need to work out what files we should be providing status on ... + # if no files were specified, we need to work out what files we should + # be providing status on ... argsfromdir($updater); # foreach file specified on the command line ... @@ -1682,7 +1759,7 @@ sub req_diff $meta1 = $updater->getmeta($filename, $revision1); unless ( defined ( $meta1 ) and $meta1->{filehash} ne "deleted" ) { - print "E File $filename at revision 1.$revision1 doesn't exist\n"; + print "E File $filename at revision $revision1 doesn't exist\n"; next; } transmitfile($meta1->{filehash}, { targetfile => $file1 }); @@ -1703,7 +1780,7 @@ sub req_diff unless ( defined ( $meta2 ) and $meta2->{filehash} ne "deleted" ) { - print "E File $filename at revision 1.$revision2 doesn't exist\n"; + print "E File $filename at revision $revision2 doesn't exist\n"; next; } @@ -1715,7 +1792,8 @@ sub req_diff $file2 = $state->{entries}{$filename}{modified_filename}; } - # if we have been given -r, and we don't have a $file2 yet, lets get one + # if we have been given -r, and we don't have a $file2 yet, lets + # get one if ( defined ( $revision1 ) and not defined ( $file2 ) ) { ( undef, $file2 ) = tempfile( DIR => $TEMP_DIR, OPEN => 0 ); @@ -1726,21 +1804,37 @@ sub req_diff # We need to have retrieved something useful next unless ( defined ( $meta1 ) ); - # Files to date if the working copy and repo copy have the same revision, and the working copy is unmodified - next if ( not defined ( $meta2 ) and $wrev == $meta1->{revision} - and - ( ( $state->{entries}{$filename}{unchanged} and ( not defined ( $state->{entries}{$filename}{conflict} ) or $state->{entries}{$filename}{conflict} !~ /^\+=/ ) ) - or ( defined($state->{entries}{$filename}{modified_hash}) and $state->{entries}{$filename}{modified_hash} eq $meta1->{filehash} ) ) - ); + # Files to date if the working copy and repo copy have the same + # revision, and the working copy is unmodified + if ( not defined ( $meta2 ) and $wrev eq $meta1->{revision} and + ( ( $state->{entries}{$filename}{unchanged} and + ( not defined ( $state->{entries}{$filename}{conflict} ) or + $state->{entries}{$filename}{conflict} !~ /^\+=/ ) ) or + ( defined($state->{entries}{$filename}{modified_hash}) and + $state->{entries}{$filename}{modified_hash} eq + $meta1->{filehash} ) ) ) + { + next; + } # Apparently we only show diffs for locally modified files - next unless ( defined($meta2) or defined ( $state->{entries}{$filename}{modified_filename} ) ); + unless ( defined($meta2) or + defined ( $state->{entries}{$filename}{modified_filename} ) ) + { + next; + } print "M Index: $filename\n"; - print "M ===================================================================\n"; + print "M =======" . ( "=" x 60 ) . "\n"; print "M RCS file: $state->{CVSROOT}/$state->{module}/$filename,v\n"; - print "M retrieving revision 1.$meta1->{revision}\n" if ( defined ( $meta1 ) ); - print "M retrieving revision 1.$meta2->{revision}\n" if ( defined ( $meta2 ) ); + if ( defined ( $meta1 ) ) + { + print "M retrieving revision $meta1->{revision}\n" + } + if ( defined ( $meta2 ) ) + { + print "M retrieving revision $meta2->{revision}\n" + } print "M diff "; foreach my $opt ( keys %{$state->{opt}} ) { @@ -1752,18 +1846,27 @@ sub req_diff } } else { print "-$opt "; - print "$state->{opt}{$opt} " if ( defined ( $state->{opt}{$opt} ) ); + if ( defined ( $state->{opt}{$opt} ) ) + { + print "$state->{opt}{$opt} " + } } } print "$filename\n"; - $log->info("Diffing $filename -r $meta1->{revision} -r " . ( $meta2->{revision} or "workingcopy" )); + $log->info("Diffing $filename -r $meta1->{revision} -r " . + ( $meta2->{revision} or "workingcopy" )); ( $fh, $filediff ) = tempfile ( DIR => $TEMP_DIR ); if ( exists $state->{opt}{u} ) { - system("diff -u -L '$filename revision 1.$meta1->{revision}' -L '$filename " . ( defined($meta2->{revision}) ? "revision 1.$meta2->{revision}" : "working copy" ) . "' $file1 $file2 > $filediff"); + system("diff -u -L '$filename revision $meta1->{revision}'" . + " -L '$filename " . + ( defined($meta2->{revision}) ? + "revision $meta2->{revision}" : + "working copy" ) . + "' $file1 $file2 > $filediff" ); } else { system("diff $file1 $file2 > $filediff"); } @@ -1787,22 +1890,19 @@ sub req_log $log->debug("req_log : " . ( defined($data) ? $data : "[NULL]" )); #$log->debug("log state : " . Dumper($state)); - my ( $minrev, $maxrev ); - if ( defined ( $state->{opt}{r} ) and $state->{opt}{r} =~ /([\d.]+)?(::?)([\d.]+)?/ ) + my ( $revFilter ); + if ( defined ( $state->{opt}{r} ) ) { - my $control = $2; - $minrev = $1; - $maxrev = $3; - $minrev =~ s/^1\.// if ( defined ( $minrev ) ); - $maxrev =~ s/^1\.// if ( defined ( $maxrev ) ); - $minrev++ if ( defined($minrev) and $control eq "::" ); + $revFilter = $state->{opt}{r}; } # Grab a handle to the SQLite db and do any necessary updates - my $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); + my $updater; + $updater = GITCVS::updater->new($state->{CVSROOT}, $state->{module}, $log); $updater->update(); - # if no files were specified, we need to work out what files we should be providing status on ... + # if no files were specified, we need to work out what files we + # should be providing status on ... argsfromdir($updater); # foreach file specified on the command line ... @@ -1812,53 +1912,46 @@ sub req_log my $headmeta = $updater->getmeta($filename); - my $revisions = $updater->getlog($filename); - my $totalrevisions = scalar(@$revisions); - - if ( defined ( $minrev ) ) - { - $log->debug("Removing revisions less than $minrev"); - while ( scalar(@$revisions) > 0 and $revisions->[-1]{revision} < $minrev ) - { - pop @$revisions; - } - } - if ( defined ( $maxrev ) ) - { - $log->debug("Removing revisions greater than $maxrev"); - while ( scalar(@$revisions) > 0 and $revisions->[0]{revision} > $maxrev ) - { - shift @$revisions; - } - } + my ($revisions,$totalrevisions) = $updater->getlog($filename, + $revFilter); next unless ( scalar(@$revisions) ); print "M \n"; print "M RCS file: $state->{CVSROOT}/$state->{module}/$filename,v\n"; print "M Working file: $filename\n"; - print "M head: 1.$headmeta->{revision}\n"; + print "M head: $headmeta->{revision}\n"; print "M branch:\n"; print "M locks: strict\n"; print "M access list:\n"; print "M symbolic names:\n"; print "M keyword substitution: kv\n"; - print "M total revisions: $totalrevisions;\tselected revisions: " . scalar(@$revisions) . "\n"; + print "M total revisions: $totalrevisions;\tselected revisions: " . + scalar(@$revisions) . "\n"; print "M description:\n"; foreach my $revision ( @$revisions ) { print "M ----------------------------\n"; - print "M revision 1.$revision->{revision}\n"; + print "M revision $revision->{revision}\n"; # reformat the date for log output - $revision->{modified} = sprintf('%04d/%02d/%02d %s', $3, $DATE_LIST->{$2}, $1, $4 ) if ( $revision->{modified} =~ /(\d+)\s+(\w+)\s+(\d+)\s+(\S+)/ and defined($DATE_LIST->{$2}) ); + if ( $revision->{modified} =~ /(\d+)\s+(\w+)\s+(\d+)\s+(\S+)/ and + defined($DATE_LIST->{$2}) ) + { + $revision->{modified} = sprintf('%04d/%02d/%02d %s', + $3, $DATE_LIST->{$2}, $1, $4 ); + } $revision->{author} = cvs_author($revision->{author}); - print "M date: $revision->{modified}; author: $revision->{author}; state: " . ( $revision->{filehash} eq "deleted" ? "dead" : "Exp" ) . "; lines: +2 -3\n"; - my $commitmessage = $updater->commitmessage($revision->{commithash}); + print "M date: $revision->{modified};" . + " author: $revision->{author}; state: " . + ( $revision->{filehash} eq "deleted" ? "dead" : "Exp" ) . + "; lines: +2 -3\n"; + my $commitmessage; + $commitmessage = $updater->commitmessage($revision->{commithash}); $commitmessage =~ s/^/M /mg; print $commitmessage . "\n"; } - print "M =============================================================================\n"; + print "M =======" . ( "=" x 70 ) . "\n"; } print "ok\n"; @@ -1964,7 +2057,7 @@ sub req_annotate $metadata->{$commithash}{author} = cvs_author($metadata->{$commithash}{author}); $metadata->{$commithash}{modified} = sprintf("%02d-%s-%02d", $1, $2, $3) if ( $metadata->{$commithash}{modified} =~ /^(\d+)\s(\w+)\s\d\d(\d\d)/ ); } - printf("M 1.%-5d (%-8s %10s): %s\n", + printf("M %-7s (%-8s %10s): %s\n", $metadata->{$commithash}{revision}, $metadata->{$commithash}{author}, $metadata->{$commithash}{modified}, @@ -2085,7 +2178,7 @@ sub argsfromdir # push added files foreach my $file (keys %{$state->{entries}}) { if ( exists $state->{entries}{$file}{revision} && - $state->{entries}{$file}{revision} == 0 ) + $state->{entries}{$file}{revision} eq '0' ) { push @gethead, { name => $file, filehash => 'added' }; } @@ -2129,16 +2222,15 @@ sub statecleanup $state->{entries} = {}; } +# Return working directory CVS revision "1.X" out +# of the the working directory "entries" state, for the given filename. +# This is prefixed with a dash if the file is scheduled for removal +# when it is committed. sub revparse { my $filename = shift; - return undef unless ( defined ( $state->{entries}{$filename}{revision} ) ); - - return $1 if ( $state->{entries}{$filename}{revision} =~ /^1\.(\d+)/ ); - return -$1 if ( $state->{entries}{$filename}{revision} =~ /^-1\.(\d+)/ ); - - return undef; + return $state->{entries}{$filename}{revision}; } # This method takes a file hash and does a CVS "file transfer". Its @@ -2444,42 +2536,14 @@ sub kopts_from_path } elsif( ($cfg->{gitcvs}{allbinary} =~ /^\s*guess\s*$/i) ) { - if( $srcType eq "sha1Or-k" && - !defined($name) ) + if( is_binary($srcType,$name) ) { - my ($ret)=$state->{entries}{$path}{options}; - if( !defined($ret) ) - { - $ret=$state->{opt}{k}; - if(defined($ret)) - { - $ret="-k$ret"; - } - else - { - $ret=""; - } - } - if( ! ($ret=~/^(|-kb|-kkv|-kkvl|-kk|-ko|-kv)$/) ) - { - print "E Bad -k option\n"; - $log->warn("Bad -k option: $ret"); - die "Error: Bad -k option: $ret\n"; - } - - return $ret; + $log->debug("... as binary"); + return "-kb"; } else { - if( is_binary($srcType,$name) ) - { - $log->debug("... as binary"); - return "-kb"; - } - else - { - $log->debug("... as text"); - } + $log->debug("... as text"); } } } @@ -2586,7 +2650,7 @@ sub open_blob_or_die die "Unable to open file $name: $!\n"; } } - elsif( $srcType eq "sha1" || $srcType eq "sha1Or-k" ) + elsif( $srcType eq "sha1" ) { unless ( defined ( $name ) and $name =~ /^[a-zA-Z0-9]{40}$/ ) { @@ -2929,6 +2993,16 @@ sub new } # Construct the revision table if required + # The revision table stores an entry for each file, each time that file + # changes. + # numberOfRecords = O( numCommits * averageNumChangedFilesPerCommit ) + # This is not sufficient to support "-r {commithash}" for any + # files except files that were modified by that commit (also, + # some places in the code ignore/effectively strip out -r in + # some cases, before it gets passed to getmeta()). + # The "filehash" field typically has a git blob hash, but can also + # be set to "dead" to indicate that the given version of the file + # should not exist in the sandbox. unless ( $self->{tables}{$self->tablename("revision")} ) { my $tablename = $self->tablename("revision"); @@ -2956,6 +3030,15 @@ sub new } # Construct the head table if required + # The head table (along with the "last_commit" entry in the property + # table) is the persisted working state of the "sub update" subroutine. + # All of it's data is read entirely first, and completely recreated + # last, every time "sub update" runs. + # This is also used by "sub getmeta" when it is asked for the latest + # version of a file (as opposed to some specific version). + # Another way of thinking about it is as a single slice out of + # "revisions", giving just the most recent revision information for + # each file. unless ( $self->{tables}{$self->tablename("head")} ) { my $tablename = $self->tablename("head"); @@ -2978,6 +3061,7 @@ sub new } # Construct the properties table if required + # - "last_commit" - Used by "sub update". unless ( $self->{tables}{$self->tablename("properties")} ) { my $tablename = $self->tablename("properties"); @@ -2990,6 +3074,11 @@ sub new } # Construct the commitmsgs table if required + # The commitmsgs table is only used for merge commits, since + # "sub update" will only keep one branch of parents. Shortlogs + # for ignored commits (i.e. not on the chosen branch) will be used + # to construct a replacement "collapsed" merge commit message, + # which will be stored in this table. See also "sub commitmessage". unless ( $self->{tables}{$self->tablename("commitmsgs")} ) { my $tablename = $self->tablename("commitmsgs"); @@ -3021,6 +3110,14 @@ sub tablename =head2 update +Bring the database up to date with the latest changes from +the git repository. + +Internal working state is read out of the "head" table and the +"last_commit" property, then it updates "revisions" based on that, and +finally it writes the new internal state back to the "head" table +so it can be used as a starting point the next time update is called. + =cut sub update { @@ -3116,7 +3213,7 @@ sub update my $commitcount = 0; # Load the head table into $head (for cached lookups during the update process) - foreach my $file ( @{$self->gethead()} ) + foreach my $file ( @{$self->gethead(1)} ) { $head->{$file->{name}} = $file; } @@ -3134,17 +3231,18 @@ sub update next; } elsif (@{$commit->{parents}} > 1) { # it is a merge commit, for each parent that is - # not $lastpicked, see if we can get a log + # not $lastpicked (not given a CVS revision number), + # see if we can get a log # from the merge-base to that parent to put it # in the message as a merge summary. my @parents = @{$commit->{parents}}; foreach my $parent (@parents) { - # git-merge-base can potentially (but rarely) throw - # several candidate merge bases. let's assume - # that the first one is the best one. if ($parent eq $lastpicked) { next; } + # git-merge-base can potentially (but rarely) throw + # several candidate merge bases. let's assume + # that the first one is the best one. my $base = eval { safe_pipe_capture('git', 'merge-base', $lastpicked, $parent); @@ -3426,19 +3524,6 @@ sub insert_head $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode); } -sub _headrev -{ - my $self = shift; - my $filename = shift; - my $tablename = $self->tablename("head"); - - my $db_query = $self->{dbh}->prepare_cached("SELECT filehash, revision, mode FROM $tablename WHERE name=?",{},1); - $db_query->execute($filename); - my ( $hash, $revision, $mode ) = $db_query->fetchrow_array; - - return ( $hash, $revision, $mode ); -} - sub _get_prop { my $self = shift; @@ -3478,6 +3563,7 @@ =head2 gethead sub gethead { my $self = shift; + my $intRev = shift; my $tablename = $self->tablename("head"); return $self->{gethead_cache} if ( defined ( $self->{gethead_cache} ) ); @@ -3488,6 +3574,10 @@ sub gethead my $tree = []; while ( my $file = $db_query->fetchrow_hashref ) { + if(!$intRev) + { + $file->{revision} = "1.$file->{revision}" + } push @$tree, $file; } @@ -3498,24 +3588,57 @@ sub gethead =head2 getlog +See also gethistorydense(). + =cut sub getlog { my $self = shift; my $filename = shift; + my $revFilter = shift; + my $tablename = $self->tablename("revision"); + # Filters: + # TODO: date, state, or by specific logins filters? + # TODO: Handle comma-separated list of revFilter items, each item + # can be a range [only case currently handled] or individual + # rev or branch or "branch.". + # TODO: Adjust $db_query WHERE clause based on revFilter, instead of + # manually filtering the results of the query? + my ( $minrev, $maxrev ); + if( defined($revFilter) and + $state->{opt}{r} =~ /^(1.(\d+))?(::?)(1.(\d.+))?$/ ) + { + my $control = $3; + $minrev = $2; + $maxrev = $5; + $minrev++ if ( defined($minrev) and $control eq "::" ); + } + my $db_query = $self->{dbh}->prepare_cached("SELECT name, filehash, author, mode, revision, modified, commithash FROM $tablename WHERE name=? ORDER BY revision DESC",{},1); $db_query->execute($filename); + my $totalRevs=0; my $tree = []; while ( my $file = $db_query->fetchrow_hashref ) { + $totalRevs++; + if( defined($minrev) and $file->{revision} < $minrev ) + { + next; + } + if( defined($maxrev) and $file->{revision} > $maxrev ) + { + next; + } + + $file->{revision} = "1." . $file->{revision}; push @$tree, $file; } - return $tree; + return ($tree,$totalRevs); } =head2 getmeta @@ -3534,10 +3657,11 @@ sub getmeta my $tablename_head = $self->tablename("head"); my $db_query; - if ( defined($revision) and $revision =~ /^\d+$/ ) + if ( defined($revision) and $revision =~ /^1\.(\d+)$/ ) { + my ($intRev) = $1; $db_query = $self->{dbh}->prepare_cached("SELECT * FROM $tablename_rev WHERE name=? AND revision=?",{},1); - $db_query->execute($filename, $revision); + $db_query->execute($filename, $intRev); } elsif ( defined($revision) and $revision =~ /^[a-zA-Z0-9]{40}$/ ) { @@ -3548,7 +3672,12 @@ sub getmeta $db_query->execute($filename); } - return $db_query->fetchrow_hashref; + my $meta = $db_query->fetchrow_hashref; + if($meta) + { + $meta->{revision} = "1.$meta->{revision}"; + } + return $meta; } =head2 commitmessage @@ -3583,25 +3712,6 @@ sub commitmessage return $message; } -=head2 gethistory - -This function takes a filename (with path) argument and returns an arrayofarrays -containing revision,filehash,commithash ordered by revision descending - -=cut -sub gethistory -{ - my $self = shift; - my $filename = shift; - my $tablename = $self->tablename("revision"); - - my $db_query; - $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM $tablename WHERE name=? ORDER BY revision DESC",{},1); - $db_query->execute($filename); - - return $db_query->fetchall_arrayref; -} - =head2 gethistorydense This function takes a filename (with path) argument and returns an arrayofarrays @@ -3611,6 +3721,8 @@ =head2 gethistorydense The 'dense' part is a reference to a '--dense' option available for git-rev-list and other git tools that depend on it. +See also getlog(). + =cut sub gethistorydense { @@ -3622,7 +3734,15 @@ sub gethistorydense $db_query = $self->{dbh}->prepare_cached("SELECT revision, filehash, commithash FROM $tablename WHERE name=? AND filehash!='deleted' ORDER BY revision DESC",{},1); $db_query->execute($filename); - return $db_query->fetchall_arrayref; + my $result = $db_query->fetchall_arrayref; + + my $i; + for($i=0 ; $i[$i][0]="1." . $result->[$i][0]; + } + + return $result; } =head2 in_array() diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 178e45305d..53142492af 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -64,37 +64,19 @@ EOF eval "$functions" -# When piped a commit, output a script to set the ident of either -# "author" or "committer +finish_ident() { + # Ensure non-empty id name. + echo "case \"\$GIT_$1_NAME\" in \"\") GIT_$1_NAME=\"\${GIT_$1_EMAIL%%@*}\" && export GIT_$1_NAME;; esac" + # And make sure everything is exported. + echo "export GIT_$1_NAME" + echo "export GIT_$1_EMAIL" + echo "export GIT_$1_DATE" +} set_ident () { - lid="$(echo "$1" | tr "[A-Z]" "[a-z]")" - uid="$(echo "$1" | tr "[a-z]" "[A-Z]")" - pick_id_script=' - /^'$lid' /{ - s/'\''/'\''\\'\'\''/g - h - s/^'$lid' \([^<]*\) <[^>]*> .*$/\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_NAME='\''&'\''; export GIT_'$uid'_NAME/p - - g - s/^'$lid' [^<]* <\([^>]*\)> .*$/\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_EMAIL='\''&'\''; export GIT_'$uid'_EMAIL/p - - g - s/^'$lid' [^<]* <[^>]*> \(.*\)$/@\1/ - s/'\''/'\''\'\'\''/g - s/.*/GIT_'$uid'_DATE='\''&'\''; export GIT_'$uid'_DATE/p - - q - } - ' - - LANG=C LC_ALL=C sed -ne "$pick_id_script" - # Ensure non-empty id name. - echo "case \"\$GIT_${uid}_NAME\" in \"\") GIT_${uid}_NAME=\"\${GIT_${uid}_EMAIL%%@*}\" && export GIT_${uid}_NAME;; esac" + parse_ident_from_commit author AUTHOR committer COMMITTER + finish_ident AUTHOR + finish_ident COMMITTER } USAGE="[--env-filter ] [--tree-filter ] @@ -320,10 +302,8 @@ while read commit parents; do git cat-file commit "$commit" >../commit || die "Cannot read commit $commit" - eval "$(set_ident AUTHOR <../commit)" || - die "setting author failed for commit $commit" - eval "$(set_ident COMMITTER <../commit)" || - die "setting committer failed for commit $commit" + eval "$(set_ident <../commit)" || + die "setting author/committer failed for commit $commit" eval "$filter_env" < /dev/null || die "env filter failed: $filter_env" diff --git a/git-gui/GIT-VERSION-GEN b/git-gui/GIT-VERSION-GEN index 65709437ff..49b62ea6eb 100755 --- a/git-gui/GIT-VERSION-GEN +++ b/git-gui/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=0.16.GITGUI +DEF_VER=0.17.GITGUI LF=' ' diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index ba4e5c1330..89f636f496 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -154,6 +154,7 @@ set _trace [lsearch -exact $argv --trace] if {$_trace >= 0} { set argv [lreplace $argv $_trace $_trace] set _trace 1 + if {[tk windowingsystem] eq "win32"} { console show } } else { set _trace 0 } @@ -1463,7 +1464,7 @@ proc rescan {after {honor_trustmtime 1}} { (![$ui_comm edit modified] || [string trim [$ui_comm get 0.0 end]] eq {})} { if {[string match amend* $commit_type]} { - } elseif {[load_message GITGUI_MSG]} { + } elseif {[load_message GITGUI_MSG utf-8]} { } elseif {[run_prepare_commit_msg_hook]} { } elseif {[load_message MERGE_MSG]} { } elseif {[load_message SQUASH_MSG]} { @@ -1549,7 +1550,7 @@ proc rescan_stage2 {fd after} { fileevent $fd_lo readable [list read_ls_others $fd_lo $after] } -proc load_message {file} { +proc load_message {file {encoding {}}} { global ui_comm set f [gitdir $file] @@ -1558,6 +1559,9 @@ proc load_message {file} { return 0 } fconfigure $fd -eofchar {} + if {$encoding ne {}} { + fconfigure $fd -encoding $encoding + } set content [string trim [read $fd]] close $fd regsub -all -line {[ \r\t]+$} $content {} content @@ -2266,6 +2270,7 @@ proc do_quit {{rc {1}}} { && $msg ne {}} { catch { set fd [open $save w] + fconfigure $fd -encoding utf-8 puts -nonewline $fd $msg close $fd } @@ -2998,10 +3003,19 @@ blame { set jump_spec {} set is_path 0 foreach a $argv { - if {$is_path || [file exists $_prefix$a]} { + if {[file exists $a]} { + if {$path ne {}} usage + set path [normalize_relpath $a] + break + } elseif {[file exists $_prefix$a]} { if {$path ne {}} usage set path [normalize_relpath $_prefix$a] break + } + + if {$is_path} { + if {$path ne {}} usage + break } elseif {$a eq {--}} { if {$path ne {}} { if {$head ne {}} usage @@ -3023,8 +3037,13 @@ blame { unset is_path if {$head ne {} && $path eq {}} { - set path [normalize_relpath $_prefix$head] - set head {} + if {[string index $head 0] eq {/}} { + set path [normalize_relpath $head] + set head {} + } else { + set path [normalize_relpath $_prefix$head] + set head {} + } } if {$head eq {}} { @@ -3710,6 +3729,8 @@ bind $ui_diff <$M1B-Key-v> {break} bind $ui_diff <$M1B-Key-V> {break} bind $ui_diff <$M1B-Key-a> {%W tag add sel 0.0 end;break} bind $ui_diff <$M1B-Key-A> {%W tag add sel 0.0 end;break} +bind $ui_diff <$M1B-Key-j> {do_revert_selection;break} +bind $ui_diff <$M1B-Key-J> {do_revert_selection;break} bind $ui_diff {catch {%W yview scroll -1 units};break} bind $ui_diff {catch {%W yview scroll 1 units};break} bind $ui_diff {catch {%W xview scroll -1 units};break} @@ -3742,6 +3763,8 @@ bind . <$M1B-Key-s> do_signoff bind . <$M1B-Key-S> do_signoff bind . <$M1B-Key-t> do_add_selection bind . <$M1B-Key-T> do_add_selection +bind . <$M1B-Key-u> do_unstage_selection +bind . <$M1B-Key-U> do_unstage_selection bind . <$M1B-Key-j> do_revert_selection bind . <$M1B-Key-J> do_revert_selection bind . <$M1B-Key-i> do_add_all @@ -3835,7 +3858,7 @@ if {[is_enabled transport]} { } if {[winfo exists $ui_comm]} { - set GITGUI_BCK_exists [load_message GITGUI_BCK] + set GITGUI_BCK_exists [load_message GITGUI_BCK utf-8] # -- If both our backup and message files exist use the # newer of the two files to initialize the buffer. @@ -3872,6 +3895,7 @@ if {[winfo exists $ui_comm]} { } elseif {$m} { catch { set fd [open [gitdir GITGUI_BCK] w] + fconfigure $fd -encoding utf-8 puts -nonewline $fd $msg close $fd set GITGUI_BCK_exists 1 diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl index 0d81432af5..864b687057 100644 --- a/git-gui/lib/commit.tcl +++ b/git-gui/lib/commit.tcl @@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} { && [is_config_true gui.warndetachedcommit]} { set msg [mc "You are about to commit on a detached head.\ This is a potentially dangerous thing to do because if you switch\ -to another branch you will loose your changes and it can be difficult\ +to another branch you will lose your changes and it can be difficult\ to retrieve them later from the reflog. You should probably cancel this\ commit and create a new branch to continue.\n\ \n\ @@ -409,6 +409,7 @@ A rescan will be automatically started now. catch {file delete [gitdir MERGE_MSG]} catch {file delete [gitdir SQUASH_MSG]} catch {file delete [gitdir GITGUI_MSG]} + catch {file delete [gitdir CHERRY_PICK_HEAD]} # -- Let rerere do its thing. # diff --git a/git-gui/lib/status_bar.tcl b/git-gui/lib/status_bar.tcl index 95cb44991f..02111a1742 100644 --- a/git-gui/lib/status_bar.tcl +++ b/git-gui/lib/status_bar.tcl @@ -77,6 +77,7 @@ method start {msg uds} { method update {have total} { set pdone 0 + set cdone 0 if {$total > 0} { set pdone [expr {100 * $have / $total}] set cdone [expr {[winfo width $w_c] * $have / $total}] diff --git a/git-gui/macosx/AppMain.tcl b/git-gui/macosx/AppMain.tcl index ddbe6334a2..738bdd03ed 100644 --- a/git-gui/macosx/AppMain.tcl +++ b/git-gui/macosx/AppMain.tcl @@ -12,7 +12,9 @@ if {[file tail [lindex $argv 0]] eq {gitk}} { } else { set argv0 [file join $gitexecdir [file tail [lindex $argv 0]]] set AppMain_source [file join $gitguilib git-gui.tcl] - if {[pwd] eq {/}} { + if {[info exists env(PWD)]} { + cd $env(PWD) + } elseif {[pwd] eq {/}} { cd $env(HOME) } } diff --git a/git-gui/po/de.po b/git-gui/po/de.po index 44c5ddc8b6..baebff2fff 100644 --- a/git-gui/po/de.po +++ b/git-gui/po/de.po @@ -72,7 +72,7 @@ msgstr "" #: git-gui.sh:1154 msgid "Cannot use bare repository:" -msgstr "Leeres Projektarchiv kann nicht benutzt werden:" +msgstr "Bloßes Projektarchiv kann nicht benutzt werden:" #: git-gui.sh:1162 msgid "No working directory" @@ -88,7 +88,7 @@ msgstr "Nach geänderten Dateien suchen..." #: git-gui.sh:1454 msgid "Calling prepare-commit-msg hook..." -msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle..." +msgstr "Aufrufen der Eintragen-Vorbereiten-Kontrolle (»prepare-commit hook«)..." #: git-gui.sh:1471 msgid "Commit declined by prepare-commit-msg hook." @@ -188,7 +188,7 @@ msgstr "Zusammenführen" #: git-gui.sh:2465 lib/choose_rev.tcl:557 msgid "Remote" -msgstr "Andere Archive" +msgstr "Externe Archive" #: git-gui.sh:2468 msgid "Tools" @@ -478,7 +478,7 @@ msgstr "Zusammenführungswerkzeug" #: git-gui.sh:3328 msgid "Use Remote Version" -msgstr "Entfernte Version benutzen" +msgstr "Externe Version benutzen" #: git-gui.sh:3332 msgid "Use Local Version" @@ -771,7 +771,7 @@ msgstr "Bitte wählen Sie einen Übernahmezweig." #: lib/branch_create.tcl:140 #, tcl-format msgid "Tracking branch %s is not a branch in the remote repository." -msgstr "Übernahmezweig »%s« ist kein Zweig im anderen Projektarchiv." +msgstr "Übernahmezweig »%s« ist kein Zweig im externen Projektarchiv." #: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 msgid "Please supply a branch name." @@ -1446,7 +1446,7 @@ msgstr "" #: lib/commit.tcl:234 msgid "Calling pre-commit hook..." -msgstr "Aufrufen der Vor-Eintragen-Kontrolle..." +msgstr "Aufrufen der Vor-Eintragen-Kontrolle (»pre-commit hook«)..." #: lib/commit.tcl:249 msgid "Commit declined by pre-commit hook." @@ -1454,7 +1454,7 @@ msgstr "Eintragen abgelehnt durch Vor-Eintragen-Kontrolle (»pre-commit hook«). #: lib/commit.tcl:272 msgid "Calling commit-msg hook..." -msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle..." +msgstr "Aufrufen der Versionsbeschreibungs-Kontrolle (»commit-message hook«)..." #: lib/commit.tcl:287 msgid "Commit declined by commit-msg hook." @@ -2134,11 +2134,11 @@ msgstr "Optionen konnten nicht gespeichert werden:" #: lib/remote_add.tcl:19 msgid "Add Remote" -msgstr "Anderes Archiv hinzufügen" +msgstr "Externes Archiv hinzufügen" #: lib/remote_add.tcl:24 msgid "Add New Remote" -msgstr "Neues anderes Archiv hinzufügen" +msgstr "Neues externes Archiv hinzufügen" #: lib/remote_add.tcl:28 lib/tools_dlg.tcl:36 msgid "Add" @@ -2146,7 +2146,7 @@ msgstr "Hinzufügen" #: lib/remote_add.tcl:37 msgid "Remote Details" -msgstr "Einzelheiten des anderen Archivs" +msgstr "Einzelheiten des externen Archivs" #: lib/remote_add.tcl:50 msgid "Location:" @@ -2162,7 +2162,7 @@ msgstr "Gleich anfordern" #: lib/remote_add.tcl:71 msgid "Initialize Remote Repository and Push" -msgstr "Anderes Archiv initialisieren und dahin versenden" +msgstr "Externes Archiv initialisieren und dahin versenden" #: lib/remote_add.tcl:77 msgid "Do Nothing Else Now" @@ -2170,17 +2170,17 @@ msgstr "Nichts tun" #: lib/remote_add.tcl:101 msgid "Please supply a remote name." -msgstr "Bitte geben Sie einen Namen des anderen Archivs an." +msgstr "Bitte geben Sie einen Namen des externen Archivs an." #: lib/remote_add.tcl:114 #, tcl-format msgid "'%s' is not an acceptable remote name." -msgstr "»%s« ist kein zulässiger Name eines anderen Archivs." +msgstr "»%s« ist kein zulässiger Name eines externen Archivs." #: lib/remote_add.tcl:125 #, tcl-format msgid "Failed to add remote '%s' of location '%s'." -msgstr "Fehler beim Hinzufügen des anderen Archivs »%s« aus Herkunftsort »%s«." +msgstr "Fehler beim Hinzufügen des externen Archivs »%s« aus Herkunftsort »%s«." #: lib/remote_add.tcl:133 lib/transport.tcl:6 #, tcl-format @@ -2195,7 +2195,7 @@ msgstr "»%s« anfordern" #: lib/remote_add.tcl:157 #, tcl-format msgid "Do not know how to initialize repository at location '%s'." -msgstr "Initialisieren eines anderen Archivs an Adresse »%s« ist nicht möglich." +msgstr "Initialisieren eines externen Archivs an Adresse »%s« ist nicht möglich." #: lib/remote_add.tcl:163 lib/transport.tcl:25 lib/transport.tcl:63 #: lib/transport.tcl:81 @@ -2210,7 +2210,7 @@ msgstr "Einrichten von »%s« an »%s«" #: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 msgid "Delete Branch Remotely" -msgstr "Zweig in anderem Archiv löschen" +msgstr "Zweig in externem Archiv löschen" #: lib/remote_branch_delete.tcl:47 msgid "From Repository" @@ -2218,7 +2218,7 @@ msgstr "In Projektarchiv" #: lib/remote_branch_delete.tcl:50 lib/transport.tcl:134 msgid "Remote:" -msgstr "Anderes Archiv:" +msgstr "Externes Archiv:" #: lib/remote_branch_delete.tcl:66 lib/transport.tcl:149 msgid "Arbitrary Location:" @@ -2281,7 +2281,7 @@ msgstr "»%s« laden..." #: lib/remote.tcl:163 msgid "Remove Remote" -msgstr "Anderes Archiv entfernen" +msgstr "Externes Archiv entfernen" #: lib/remote.tcl:168 msgid "Prune from" @@ -2397,7 +2397,7 @@ msgid "Generation failed." msgstr "Schlüsselerzeugung fehlgeschlagen." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Schlüsselerzeugung erfolgreich, aber keine Schlüssel gefunden." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/fr.po b/git-gui/po/fr.po index 81706965f3..40441dbb0d 100644 --- a/git-gui/po/fr.po +++ b/git-gui/po/fr.po @@ -2399,7 +2399,7 @@ msgid "Generation failed." msgstr "La génération a échoué." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "La génération a réussi, mais aucune clé n'a été trouvée." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/git-gui.pot b/git-gui/po/git-gui.pot index 1ae2aaa0b3..0c94f9c2c6 100644 --- a/git-gui/po/git-gui.pot +++ b/git-gui/po/git-gui.pot @@ -2203,7 +2203,7 @@ msgid "Generation failed." msgstr "" #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "" #: lib/sshkey.tcl:121 diff --git a/git-gui/po/hu.po b/git-gui/po/hu.po index 0f87bc1cbe..d106dadac8 100644 --- a/git-gui/po/hu.po +++ b/git-gui/po/hu.po @@ -2354,7 +2354,7 @@ msgid "Generation failed." msgstr "A generálás nem sikerült." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "A generálás sikeres, de egy kulcs se található." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/it.po b/git-gui/po/it.po index aa15a204d8..1bd8b8e04f 100644 --- a/git-gui/po/it.po +++ b/git-gui/po/it.po @@ -2397,7 +2397,7 @@ msgid "Generation failed." msgstr "Errore durante la creazione della chiave." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "La chiave è stata creata con successo, ma non è stata trovata." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/ja.po b/git-gui/po/ja.po index 15017985e5..9aff249d5f 100644 --- a/git-gui/po/ja.po +++ b/git-gui/po/ja.po @@ -2362,7 +2362,7 @@ msgid "Generation failed." msgstr "生成に失敗しました。" #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "生成には成功しましたが、鍵が見つかりません。" #: lib/sshkey.tcl:121 diff --git a/git-gui/po/nb.po b/git-gui/po/nb.po index 6de93c28c2..d66aa50263 100644 --- a/git-gui/po/nb.po +++ b/git-gui/po/nb.po @@ -2286,7 +2286,7 @@ msgid "Generation failed." msgstr "Generering feilet." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Generering vellykket, men ingen nøkler er funnet." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/pt_br.po b/git-gui/po/pt_br.po index b175b9791e..bad116c780 100644 --- a/git-gui/po/pt_br.po +++ b/git-gui/po/pt_br.po @@ -2375,7 +2375,7 @@ msgid "Generation failed." msgstr "A geração da chave falhou." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "A geração da chave foi bem-sucedida, mas nenhuma chave foi encontrada." #: lib/sshkey.tcl:121 diff --git a/git-gui/po/ru.po b/git-gui/po/ru.po index 30f4b77dac..ca4343b40c 100644 --- a/git-gui/po/ru.po +++ b/git-gui/po/ru.po @@ -2370,7 +2370,7 @@ msgid "Generation failed." msgstr "Ключ не создан." #: lib/sshkey.tcl:118 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Создание ключа завершилось, но результат не был найден" #: lib/sshkey.tcl:121 diff --git a/git-gui/po/sv.po b/git-gui/po/sv.po index 24cc4e3675..fcb063ffa6 100644 --- a/git-gui/po/sv.po +++ b/git-gui/po/sv.po @@ -2382,7 +2382,7 @@ msgid "Generation failed." msgstr "Misslyckades med att skapa." #: lib/sshkey.tcl:120 -msgid "Generation succeded, but no keys found." +msgid "Generation succeeded, but no keys found." msgstr "Lyckades skapa nyckeln, men hittar inte nÃ¥gon nyckel." #: lib/sshkey.tcl:123 diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 54cb708254..f013a03506 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -104,13 +104,49 @@ run_merge_tool () { if merge_mode then - merge_cmd "$1" + run_merge_cmd "$1" else - diff_cmd "$1" + run_diff_cmd "$1" fi return $status } +# Run a either a configured or built-in diff tool +run_diff_cmd () { + merge_tool_cmd="$(get_merge_tool_cmd "$1")" + if test -n "$merge_tool_cmd" + then + ( eval $merge_tool_cmd ) + status=$? + return $status + else + diff_cmd "$1" + fi +} + +# Run a either a configured or built-in merge tool +run_merge_cmd () { + merge_tool_cmd="$(get_merge_tool_cmd "$1")" + if test -n "$merge_tool_cmd" + then + trust_exit_code="$(git config --bool \ + mergetool."$1".trustExitCode || echo false)" + if test "$trust_exit_code" = "false" + then + touch "$BACKUP" + ( eval $merge_tool_cmd ) + status=$? + check_unchanged + else + ( eval $merge_tool_cmd ) + status=$? + fi + return $status + else + merge_cmd "$1" + fi +} + list_merge_tool_candidates () { if merge_mode then diff --git a/git-p4.py b/git-p4.py index aed1a2de32..882b1bbab5 100755 --- a/git-p4.py +++ b/git-p4.py @@ -844,6 +844,9 @@ def run(self, args): return True class P4Submit(Command, P4UserMap): + + conflict_behavior_choices = ("ask", "skip", "quit") + def __init__(self): Command.__init__(self) P4UserMap.__init__(self) @@ -853,12 +856,19 @@ def __init__(self): # preserve the user, requires relevant p4 permissions optparse.make_option("--preserve-user", dest="preserveUser", action="store_true"), optparse.make_option("--export-labels", dest="exportLabels", action="store_true"), + optparse.make_option("--dry-run", "-n", dest="dry_run", action="store_true"), + optparse.make_option("--prepare-p4-only", dest="prepare_p4_only", action="store_true"), + optparse.make_option("--conflict", dest="conflict_behavior", + choices=self.conflict_behavior_choices) ] self.description = "Submit changes from git to the perforce depot." self.usage += " [name of git branch to submit into perforce depot]" self.origin = "" self.detectRenames = False self.preserveUser = gitConfig("git-p4.preserveUser").lower() == "true" + self.dry_run = False + self.prepare_p4_only = False + self.conflict_behavior = None self.isWindows = (platform.system() == "Windows") self.exportLabels = False self.p4HasMoveCommand = p4_has_command("move") @@ -1088,7 +1098,10 @@ def edit_template(self, template_file): return False def applyCommit(self, id): - print "Applying %s" % (read_pipe("git log --max-count=1 --pretty=oneline %s" % id)) + """Apply one commit, return True if it succeeded.""" + + print "Applying", read_pipe(["git", "show", "-s", + "--format=format:%h %s", id]) (p4User, gitEmail) = self.p4UserForCommit(id) @@ -1195,34 +1208,13 @@ def applyCommit(self, id): patch_succeeded = True if not patch_succeeded: - print "What do you want to do?" - response = "x" - while response != "s" and response != "a" and response != "w": - response = raw_input("[s]kip this patch / [a]pply the patch forcibly " - "and with .rej files / [w]rite the patch to a file (patch.txt) ") - if response == "s": - print "Skipping! Good luck with the next patches..." - for f in editedFiles: - p4_revert(f) - for f in filesToAdd: - os.remove(f) - return - elif response == "a": - os.system(applyPatchCmd) - if len(filesToAdd) > 0: - print "You may also want to call p4 add on the following files:" - print " ".join(filesToAdd) - if len(filesToDelete): - print "The following files should be scheduled for deletion with p4 delete:" - print " ".join(filesToDelete) - die("Please resolve and submit the conflict manually and " - + "continue afterwards with git p4 submit --continue") - elif response == "w": - system(diffcmd + " > patch.txt") - print "Patch saved to patch.txt in %s !" % self.clientPath - die("Please resolve and submit the conflict manually and " - "continue afterwards with git p4 submit --continue") + for f in editedFiles: + p4_revert(f) + return False + # + # Apply the patch for real, and do add/delete/+x handling. + # system(applyPatchCmd) for f in filesToAdd: @@ -1236,6 +1228,10 @@ def applyCommit(self, id): mode = filesToChangeExecBit[f] setP4ExecBit(f, mode) + # + # Build p4 change description, starting with the contents + # of the git commit message. + # logMessage = extractLogMessageFromGitCommit(id) logMessage = logMessage.strip() (logMessage, jobs) = self.separate_jobs_from_description(logMessage) @@ -1244,8 +1240,16 @@ def applyCommit(self, id): submitTemplate = self.prepareLogMessage(template, logMessage, jobs) if self.preserveUser: - submitTemplate = submitTemplate + ("\n######## Actual user %s, modified after commit\n" % p4User) + submitTemplate += "\n######## Actual user %s, modified after commit\n" % p4User + + if self.checkAuthorship and not self.p4UserIsMe(p4User): + submitTemplate += "######## git author %s does not match your p4 account.\n" % gitEmail + submitTemplate += "######## Use option --preserve-user to modify authorship.\n" + submitTemplate += "######## Variable git-p4.skipUserNameCheck hides this message.\n" + separatorLine = "######## everything below this line is just the diff #######\n" + + # diff if os.environ.has_key("P4DIFF"): del(os.environ["P4DIFF"]) diff = "" @@ -1253,6 +1257,7 @@ def applyCommit(self, id): diff += p4_read_pipe(['diff', '-du', wildcard_encode(editedFile)]) + # new file diff newdiff = "" for newFile in filesToAdd: newdiff += "==== new file ====\n" @@ -1263,13 +1268,7 @@ def applyCommit(self, id): newdiff += "+" + line f.close() - if self.checkAuthorship and not self.p4UserIsMe(p4User): - submitTemplate += "######## git author %s does not match your p4 account.\n" % gitEmail - submitTemplate += "######## Use option --preserve-user to modify authorship.\n" - submitTemplate += "######## Variable git-p4.skipUserNameCheck hides this message.\n" - - separatorLine = "######## everything below this line is just the diff #######\n" - + # change description file: submitTemplate, separatorLine, diff, newdiff (handle, fileName) = tempfile.mkstemp() tmpFile = os.fdopen(handle, "w+") if self.isWindows: @@ -1279,8 +1278,47 @@ def applyCommit(self, id): tmpFile.write(submitTemplate + separatorLine + diff + newdiff) tmpFile.close() + if self.prepare_p4_only: + # + # Leave the p4 tree prepared, and the submit template around + # and let the user decide what to do next + # + print + print "P4 workspace prepared for submission." + print "To submit or revert, go to client workspace" + print " " + self.clientPath + print + print "To submit, use \"p4 submit\" to write a new description," + print "or \"p4 submit -i %s\" to use the one prepared by" \ + " \"git p4\"." % fileName + print "You can delete the file \"%s\" when finished." % fileName + + if self.preserveUser and p4User and not self.p4UserIsMe(p4User): + print "To preserve change ownership by user %s, you must\n" \ + "do \"p4 change -f \" after submitting and\n" \ + "edit the User field." + if pureRenameCopy: + print "After submitting, renamed files must be re-synced." + print "Invoke \"p4 sync -f\" on each of these files:" + for f in pureRenameCopy: + print " " + f + + print + print "To revert the changes, use \"p4 revert ...\", and delete" + print "the submit template file \"%s\"" % fileName + if filesToAdd: + print "Since the commit adds new files, they must be deleted:" + for f in filesToAdd: + print " " + f + print + return True + + # + # Let the user edit the change description, then submit it. + # if self.edit_template(fileName): # read the edited message and submit + ret = True tmpFile = open(fileName, "rb") message = tmpFile.read() tmpFile.close() @@ -1304,14 +1342,18 @@ def applyCommit(self, id): else: # skip this patch + ret = False print "Submission cancelled, undoing p4 changes." for f in editedFiles: p4_revert(f) for f in filesToAdd: p4_revert(f) os.remove(f) + for f in filesToDelete: + p4_revert(f) os.remove(fileName) + return ret # Export git tags as p4 labels. Create a p4 label and then tag # with that. @@ -1369,14 +1411,20 @@ def exportGitTags(self, gitTags): for mapping in clientSpec.mappings: labelTemplate += "\t%s\n" % mapping.depot_side.path - p4_write_pipe(["label", "-i"], labelTemplate) + if self.dry_run: + print "Would create p4 label %s for tag" % name + elif self.prepare_p4_only: + print "Not creating p4 label %s for tag due to option" \ + " --prepare-p4-only" % name + else: + p4_write_pipe(["label", "-i"], labelTemplate) - # Use the label - p4_system(["tag", "-l", name] + - ["%s@%s" % (mapping.depot_side.path, changelist) for mapping in clientSpec.mappings]) + # Use the label + p4_system(["tag", "-l", name] + + ["%s@%s" % (mapping.depot_side.path, changelist) for mapping in clientSpec.mappings]) - if verbose: - print "created p4 label for tag %s" % name + if verbose: + print "created p4 label for tag %s" % name def run(self, args): if len(args) == 0: @@ -1403,6 +1451,16 @@ def run(self, args): if not self.canChangeChangelists(): die("Cannot preserve user names without p4 super-user or admin permissions") + # if not set from the command line, try the config file + if self.conflict_behavior is None: + val = gitConfig("git-p4.conflict") + if val: + if val not in self.conflict_behavior_choices: + die("Invalid value '%s' for config git-p4.conflict" % val) + else: + val = "ask" + self.conflict_behavior = val + if self.verbose: print "Origin branch is " + self.origin @@ -1435,12 +1493,15 @@ def run(self, args): os.makedirs(self.clientPath) chdir(self.clientPath) - print "Synchronizing p4 checkout..." - if new_client_dir: - # old one was destroyed, and maybe nobody told p4 - p4_sync("...", "-f") + if self.dry_run: + print "Would synchronize p4 checkout in %s" % self.clientPath else: - p4_sync("...") + print "Synchronizing p4 checkout..." + if new_client_dir: + # old one was destroyed, and maybe nobody told p4 + p4_sync("...", "-f") + else: + p4_sync("...") self.check() commits = [] @@ -1487,14 +1548,64 @@ def run(self, args): if gitConfig("git-p4.detectCopiesHarder", "--bool") == "true": self.diffOpts += " --find-copies-harder" - while len(commits) > 0: - commit = commits[0] - commits = commits[1:] - self.applyCommit(commit) + # + # Apply the commits, one at a time. On failure, ask if should + # continue to try the rest of the patches, or quit. + # + if self.dry_run: + print "Would apply" + applied = [] + last = len(commits) - 1 + for i, commit in enumerate(commits): + if self.dry_run: + print " ", read_pipe(["git", "show", "-s", + "--format=format:%h %s", commit]) + ok = True + else: + ok = self.applyCommit(commit) + if ok: + applied.append(commit) + else: + if self.prepare_p4_only and i < last: + print "Processing only the first commit due to option" \ + " --prepare-p4-only" + break + if i < last: + quit = False + while True: + # prompt for what to do, or use the option/variable + if self.conflict_behavior == "ask": + print "What do you want to do?" + response = raw_input("[s]kip this commit but apply" + " the rest, or [q]uit? ") + if not response: + continue + elif self.conflict_behavior == "skip": + response = "s" + elif self.conflict_behavior == "quit": + response = "q" + else: + die("Unknown conflict_behavior '%s'" % + self.conflict_behavior) + + if response[0] == "s": + print "Skipping this commit, but applying the rest" + break + if response[0] == "q": + print "Quitting" + quit = True + break + if quit: + break + + chdir(self.oldWorkingDirectory) - if len(commits) == 0: - print "All changes applied!" - chdir(self.oldWorkingDirectory) + if self.dry_run: + pass + elif self.prepare_p4_only: + pass + elif len(commits) == len(applied): + print "All commits applied!" sync = P4Sync() sync.run([]) @@ -1502,6 +1613,20 @@ def run(self, args): rebase = P4Rebase() rebase.rebase() + else: + if len(applied) == 0: + print "No commits applied." + else: + print "Applied only the commits marked with '*':" + for c in commits: + if c in applied: + star = "*" + else: + star = " " + print star, read_pipe(["git", "show", "-s", + "--format=format:%h %s", c]) + print "You will have to do 'git p4 sync' and rebase." + if gitConfig("git-p4.exportLabels", "--bool") == "true": self.exportLabels = True @@ -1512,6 +1637,10 @@ def run(self, args): missingGitTags = gitTags - p4Labels self.exportGitTags(missingGitTags) + # exit with error unless everything applied perfecly + if len(commits) != len(applied): + sys.exit(1) + return True class View(object): @@ -3015,7 +3144,7 @@ def main(): args = sys.argv[2:] - options.append(optparse.make_option("--verbose", dest="verbose", action="store_true")) + options.append(optparse.make_option("--verbose", "-v", dest="verbose", action="store_true")) if cmd.needsGit: options.append(optparse.make_option("--git-dir", dest="gitdir")) diff --git a/git-pull.sh b/git-pull.sh index 2a10047eb7..266e682f6c 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -200,6 +200,7 @@ test true = "$rebase" && { require_clean_work_tree "pull with rebase" "Please commit or stash them." fi oldremoteref= && + test -n "$curr_branch" && . git-parse-remote && remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" && oldremoteref="$(git rev-parse -q --verify "$remoteref")" && diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index a09e8423dd..44901d53c4 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -115,6 +115,23 @@ mark_action_done () { fi } +append_todo_help () { + cat >> "$todo" << EOF +# +# Commands: +# p, pick = use commit +# r, reword = use commit, but edit the commit message +# e, edit = use commit, but stop for amending +# s, squash = use commit, but meld into previous commit +# f, fixup = like "squash", but discard this commit's log message +# x, exec = run command (the rest of the line) using shell +# +# These lines can be re-ordered; they are executed from top to bottom. +# +# If you remove a line here THAT COMMIT WILL BE LOST. +EOF +} + make_patch () { sha1_and_parents="$(git rev-list --parents -1 "$1")" case "$sha1_and_parents" in @@ -544,6 +561,10 @@ do_next () { warn warn " git rebase --continue" warn + if test $status -eq 127 # command not found + then + status=1 + fi exit "$status" elif test "$dirty" = t then @@ -558,11 +579,12 @@ do_next () { ;; *) warn "Unknown command: $command $sha1 $rest" + fixtodo="Please fix this using 'git rebase --edit-todo'." if git rev-parse --verify -q "$sha1" >/dev/null then - die_with_patch $sha1 "Please fix this in the file $todo." + die_with_patch $sha1 "$fixtodo" else - die "Please fix this in the file $todo." + die "$fixtodo" fi ;; esac @@ -775,6 +797,23 @@ skip) do_rest ;; +edit-todo) + sed -e '/^#/d' < "$todo" > "$todo".new + mv -f "$todo".new "$todo" + append_todo_help + cat >> "$todo" << EOF +# +# You are editing the todo file of an ongoing interactive rebase. +# To continue rebase after editing, run: +# git rebase --continue +# +EOF + + git_sequence_editor "$todo" || + die "Could not execute editor" + + exit + ;; esac git var GIT_COMMITTER_IDENT >/dev/null || @@ -901,18 +940,10 @@ test -n "$cmd" && add_exec_commands "$todo" cat >> "$todo" << EOF # Rebase $shortrevisions onto $shortonto +EOF +append_todo_help +cat >> "$todo" << EOF # -# Commands: -# p, pick = use commit -# r, reword = use commit, but edit the commit message -# e, edit = use commit, but stop for amending -# s, squash = use commit, but meld into previous commit -# f, fixup = like "squash", but discard this commit's log message -# x, exec = run command (the rest of the line) using shell -# -# These lines can be re-ordered; they are executed from top to bottom. -# -# If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. # EOF diff --git a/git-rebase.sh b/git-rebase.sh index 15da926ce0..b2f1c76dc3 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -8,7 +8,7 @@ OPTIONS_KEEPDASHDASH= OPTIONS_SPEC="\ git rebase [-i] [options] [--exec ] [--onto ] [] [] git rebase [-i] [options] [--exec ] [--onto ] --root [] -git-rebase [-i] --continue | --abort | --skip +git-rebase --continue | --abort | --skip | --edit-todo -- Available options are v,verbose! display a diffstat of what changed upstream @@ -38,6 +38,7 @@ C=! passed to 'git apply' continue! continue abort! abort and check out the original branch skip! skip current patch and continue +edit-todo! edit the todo list during an interactive rebase " . git-sh-setup . git-sh-i18n @@ -190,7 +191,7 @@ do --verify) ok_to_skip_pre_rebase= ;; - --continue|--skip|--abort) + --continue|--skip|--abort|--edit-todo) test $total_argc -eq 2 || usage action=${1##--} ;; @@ -306,6 +307,11 @@ then fi fi +if test "$action" = "edit-todo" && test "$type" != "interactive" +then + die "$(gettext "The --edit-todo action can only be used during interactive rebase.")" +fi + case "$action" in continue) # Sanity check @@ -338,6 +344,9 @@ abort) rm -r "$state_dir" exit ;; +edit-todo) + run_specific_rebase + ;; esac # Make sure no rebase is in progress diff --git a/git-send-email.perl b/git-send-email.perl index aea66a0d47..5a7c29db93 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -56,6 +56,7 @@ sub usage { --in-reply-to * Email "In-Reply-To:" --annotate * Review each patch that will be sent in an editor. --compose * Open an editor for introduction. + --compose-encoding * Encoding to assume for introduction. --8bit-encoding * Encoding to assume 8bit mails if undeclared Sending: @@ -198,6 +199,7 @@ sub do_edit { my ($validate, $confirm); my (@suppress_cc); my ($auto_8bit_encoding); +my ($compose_encoding); my ($debug_net_smtp) = 0; # Net::SMTP, see send_message() @@ -231,6 +233,7 @@ sub do_edit { "confirm" => \$confirm, "from" => \$sender, "assume8bitencoding" => \$auto_8bit_encoding, + "composeencoding" => \$compose_encoding, ); my %config_path_settings = ( @@ -315,6 +318,7 @@ sub signal_handler { "validate!" => \$validate, "format-patch!" => \$format_patch, "8bit-encoding=s" => \$auto_8bit_encoding, + "compose-encoding=s" => \$compose_encoding, "force" => \$force, ); @@ -632,6 +636,9 @@ sub get_patch_subject { my $need_8bit_cte = file_has_nonascii($compose_filename); my $in_body = 0; my $summary_empty = 1; + if (!defined $compose_encoding) { + $compose_encoding = "UTF-8"; + } while(<$c>) { next if m/^GIT:/; if ($in_body) { @@ -641,7 +648,7 @@ sub get_patch_subject { if ($need_8bit_cte) { print $c2 "MIME-Version: 1.0\n", "Content-Type: text/plain; ", - "charset=UTF-8\n", + "charset=$compose_encoding\n", "Content-Transfer-Encoding: 8bit\n"; } } elsif (/^MIME-Version:/i) { @@ -650,9 +657,7 @@ sub get_patch_subject { $initial_subject = $1; my $subject = $initial_subject; $_ = "Subject: " . - ($subject =~ /[^[:ascii:]]/ ? - quote_rfc2047($subject) : - $subject) . + quote_subject($subject, $compose_encoding) . "\n"; } elsif (/^In-Reply-To:\s*(.+)\s*$/i) { $initial_reply_to = $1; @@ -900,6 +905,22 @@ sub is_rfc2047_quoted { $s =~ m/^(?:"[[:ascii:]]*"|=\?$token\?$token\?$encoded_text\?=)$/o; } +sub subject_needs_rfc2047_quoting { + my $s = shift; + + return ($s =~ /[^[:ascii:]]/) || ($s =~ /=\?/); +} + +sub quote_subject { + local $subject = shift; + my $encoding = shift || 'UTF-8'; + + if (subject_needs_rfc2047_quoting($subject)) { + return quote_rfc2047($subject, $encoding); + } + return $subject; +} + # use the simplest quoting being able to handle the recipient sub sanitize_address { my ($recipient) = @_; @@ -1321,7 +1342,7 @@ sub send_message { } if ($broken_encoding{$t} && !is_rfc2047_quoted($subject)) { - $subject = quote_rfc2047($subject, $auto_8bit_encoding); + $subject = quote_subject($subject, $auto_8bit_encoding); } if (defined $author and $author ne $sender) { diff --git a/git-sh-setup.sh b/git-sh-setup.sh index ee0e0bc045..22f0aed6db 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -191,28 +191,52 @@ require_clean_work_tree () { fi } +# Generate a sed script to parse identities from a commit. +# +# Reads the commit from stdin, which should be in raw format (e.g., from +# cat-file or "--pretty=raw"). +# +# The first argument specifies the ident line to parse (e.g., "author"), and +# the second specifies the environment variable to put it in (e.g., "AUTHOR" +# for "GIT_AUTHOR_*"). Multiple pairs can be given to parse author and +# committer. +pick_ident_script () { + while test $# -gt 0 + do + lid=$1; shift + uid=$1; shift + printf '%s' " + /^$lid /{ + s/'/'\\\\''/g + h + s/^$lid "'\([^<]*\) <[^>]*> .*$/\1/'" + s/.*/GIT_${uid}_NAME='&'/p + + g + s/^$lid "'[^<]* <\([^>]*\)> .*$/\1/'" + s/.*/GIT_${uid}_EMAIL='&'/p + + g + s/^$lid "'[^<]* <[^>]*> \(.*\)$/@\1/'" + s/.*/GIT_${uid}_DATE='&'/p + } + " + done + echo '/^$/q' +} + +# Create a pick-script as above and feed it to sed. Stdout is suitable for +# feeding to eval. +parse_ident_from_commit () { + LANG=C LC_ALL=C sed -ne "$(pick_ident_script "$@")" +} + +# Parse the author from a commit given as an argument. Stdout is suitable for +# feeding to eval to set the usual GIT_* ident variables. get_author_ident_from_commit () { - pick_author_script=' - /^author /{ - s/'\''/'\''\\'\'\''/g - h - s/^author \([^<]*\) <[^>]*> .*$/\1/ - s/.*/GIT_AUTHOR_NAME='\''&'\''/p - - g - s/^author [^<]* <\([^>]*\)> .*$/\1/ - s/.*/GIT_AUTHOR_EMAIL='\''&'\''/p - - g - s/^author [^<]* <[^>]*> \(.*\)$/@\1/ - s/.*/GIT_AUTHOR_DATE='\''&'\''/p - - q - } - ' encoding=$(git config i18n.commitencoding || echo UTF-8) git show -s --pretty=raw --encoding="$encoding" "$1" -- | - LANG=C LC_ALL=C sed -ne "$pick_author_script" + parse_ident_from_commit author AUTHOR } # Clear repo-local GIT_* environment variables. Useful when switching to diff --git a/git-submodule.sh b/git-submodule.sh index 3e2045e52d..0522c3871a 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -5,13 +5,13 @@ # Copyright (c) 2007 Lars Hjemli dashless=$(basename "$0" | sed -e 's/-/ /') -USAGE="[--quiet] add [-b branch] [-f|--force] [--reference ] [--] [] +USAGE="[--quiet] add [-b branch] [-f|--force] [--name ] [--reference ] [--] [] or: $dashless [--quiet] status [--cached] [--recursive] [--] [...] or: $dashless [--quiet] init [--] [...] or: $dashless [--quiet] update [--init] [-N|--no-fetch] [-f|--force] [--rebase] [--reference ] [--merge] [--recursive] [--] [...] or: $dashless [--quiet] summary [--cached|--files] [--summary-limit ] [commit] [--] [...] or: $dashless [--quiet] foreach [--recursive] - or: $dashless [--quiet] sync [--] [...]" + or: $dashless [--quiet] sync [--recursive] [--] [...]" OPTIONS_SPEC= . git-sh-setup . git-sh-i18n @@ -29,6 +29,7 @@ files= nofetch= update= prefix= +custom_name= # The function takes at most 2 arguments. The first argument is the # URL that navigates to the submodule origin repo. When relative, this URL @@ -179,8 +180,9 @@ module_name() module_clone() { sm_path=$1 - url=$2 - reference="$3" + name=$2 + url=$3 + reference="$4" quiet= if test -n "$GIT_QUIET" then @@ -189,8 +191,6 @@ module_clone() gitdir= gitdir_base= - name=$(module_name "$sm_path" 2>/dev/null) - test -n "$name" || name="$sm_path" base_name=$(dirname "$name") gitdir=$(git rev-parse --git-dir) @@ -270,6 +270,10 @@ cmd_add() ;; --reference=*) reference="$1" + ;; + --name) + case "$2" in '') usage ;; esac + custom_name=$2 shift ;; --) @@ -336,6 +340,13 @@ Use -f if you really want to add it." >&2 exit 1 fi + if test -n "$custom_name" + then + sm_name="$custom_name" + else + sm_name="$sm_path" + fi + # perhaps the path exists and is already a git repo, else clone it if test -e "$sm_path" then @@ -347,8 +358,21 @@ Use -f if you really want to add it." >&2 fi else - - module_clone "$sm_path" "$realrepo" "$reference" || exit + if test -d ".git/modules/$sm_name" + then + if test -z "$force" + then + echo >&2 "$(eval_gettext "A git directory for '\$sm_name' is found locally with remote(s):")" + GIT_DIR=".git/modules/$sm_name" GIT_WORK_TREE=. git remote -v | grep '(fetch)' | sed -e s,^," ", -e s,' (fetch)',, >&2 + echo >&2 "$(eval_gettext "If you want to reuse this local git directory instead of cloning again from")" + echo >&2 " $realrepo" + echo >&2 "$(eval_gettext "use the '--force' option. If the local git directory is not the correct repo")" + die "$(eval_gettext "or you are unsure what this means choose another name with the '--name' option.")" + else + echo "$(eval_gettext "Reactivating local git directory for submodule '\$sm_name'.")" + fi + fi + module_clone "$sm_path" "$sm_name" "$realrepo" "$reference" || exit ( clear_local_git_env cd "$sm_path" && @@ -359,13 +383,13 @@ Use -f if you really want to add it." >&2 esac ) || die "$(eval_gettext "Unable to checkout submodule '\$sm_path'")" fi - git config submodule."$sm_path".url "$realrepo" + git config submodule."$sm_name".url "$realrepo" git add $force "$sm_path" || die "$(eval_gettext "Failed to add submodule '\$sm_path'")" - git config -f .gitmodules submodule."$sm_path".path "$sm_path" && - git config -f .gitmodules submodule."$sm_path".url "$repo" && + git config -f .gitmodules submodule."$sm_name".path "$sm_path" && + git config -f .gitmodules submodule."$sm_name".url "$repo" && git add --force .gitmodules || die "$(eval_gettext "Failed to register submodule '\$sm_path'")" } @@ -594,7 +618,7 @@ Maybe you want to use 'update --init'?")" if ! test -d "$sm_path"/.git -o -f "$sm_path"/.git then - module_clone "$sm_path" "$url" "$reference"|| exit + module_clone "$sm_path" "$name" "$url" "$reference" || exit cloned_modules="$cloned_modules;$name" subsha1= else @@ -926,7 +950,6 @@ cmd_summary() { cmd_status() { # parse $args after "submodule ... status". - orig_flags= while test $# -ne 0 do case "$1" in @@ -950,7 +973,6 @@ cmd_status() break ;; esac - orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")" shift done @@ -990,7 +1012,7 @@ cmd_status() prefix="$displaypath/" clear_local_git_env cd "$sm_path" && - eval cmd_status "$orig_args" + eval cmd_status ) || die "$(eval_gettext "Failed to recurse into submodule path '\$sm_path'")" fi @@ -1010,6 +1032,10 @@ cmd_sync() GIT_QUIET=1 shift ;; + --recursive) + recursive=1 + shift + ;; --) shift break @@ -1051,7 +1077,7 @@ cmd_sync() if git config "submodule.$name.url" >/dev/null 2>/dev/null then - say "$(eval_gettext "Synchronizing submodule url for '\$name'")" + say "$(eval_gettext "Synchronizing submodule url for '\$prefix\$sm_path'")" git config submodule."$name".url "$super_config_url" if test -e "$sm_path"/.git @@ -1061,6 +1087,12 @@ cmd_sync() cd "$sm_path" remote=$(get_default_remote) git config remote."$remote".url "$sub_origin_url" + + if test -n "$recursive" + then + prefix="$prefix$sm_path/" + eval cmd_sync + fi ) fi fi @@ -1107,7 +1139,15 @@ do done # No command word defaults to "status" -test -n "$command" || command=status +if test -z "$command" +then + if test $# = 0 + then + command=status + else + usage + fi +fi # "-b branch" is accepted only by "add" if test -n "$branch" && test "$command" != add diff --git a/git-svn.perl b/git-svn.perl index 0d77ffb0b9..bd5266c86b 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1314,7 +1314,7 @@ sub get_svnprops { $path = $cmd_dir_prefix . $path; fatal("No such file or directory: $path") unless -e $path; my $is_dir = -d $path ? 1 : 0; - $path = join_paths($gs->{path}, $path); + $path = join_paths($gs->path, $path); # canonicalize the path (otherwise libsvn will abort or fail to # find the file) diff --git a/git.c b/git.c index 8788b32ccd..d33f9b32a2 100644 --- a/git.c +++ b/git.c @@ -17,39 +17,6 @@ const char git_more_info_string[] = static struct startup_info git_startup_info; static int use_pager = -1; -struct pager_config { - const char *cmd; - int want; - char *value; -}; - -static int pager_command_config(const char *var, const char *value, void *data) -{ - struct pager_config *c = data; - if (!prefixcmp(var, "pager.") && !strcmp(var + 6, c->cmd)) { - int b = git_config_maybe_bool(var, value); - if (b >= 0) - c->want = b; - else { - c->want = 1; - c->value = xstrdup(value); - } - } - return 0; -} - -/* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" */ -int check_pager_config(const char *cmd) -{ - struct pager_config c; - c.cmd = cmd; - c.want = -1; - c.value = NULL; - git_config(pager_command_config, &c); - if (c.value) - pager_program = c.value; - return c.want; -} static void commit_pager_choice(void) { switch (use_pager) { diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7f8c1878d4..10ed9e51a5 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -8028,7 +8028,7 @@ sub git_feed { %latest_commit = %{$commitlist[0]}; my $latest_epoch = $latest_commit{'committer_epoch'}; exit_if_unmodified_since($latest_epoch); - %latest_date = parse_date($latest_epoch, $latest_commit{'comitter_tz'}); + %latest_date = parse_date($latest_epoch, $latest_commit{'committer_tz'}); } print $cgi->header( -type => $content_type, diff --git a/graph.c b/graph.c index 7e0a099f83..e864fe2c6a 100644 --- a/graph.c +++ b/graph.c @@ -7,6 +7,34 @@ /* Internal API */ +/* + * Output the next line for a graph. + * This formats the next graph line into the specified strbuf. It is not + * terminated with a newline. + * + * Returns 1 if the line includes the current commit, and 0 otherwise. + * graph_next_line() will return 1 exactly once for each time + * graph_update() is called. + */ +static int graph_next_line(struct git_graph *graph, struct strbuf *sb); + +/* + * Set up a custom scheme for column colors. + * + * The default column color scheme inserts ANSI color escapes to colorize + * the graph. The various color escapes are stored in an array of strings + * where each entry corresponds to a color, except for the last entry, + * which denotes the escape for resetting the color back to the default. + * When generating the graph, strings from this array are inserted before + * and after the various column characters. + * + * This function allows you to enable a custom array of color escapes. + * The 'colors_max' argument is the index of the last "reset" entry. + * + * This functions must be called BEFORE graph_init() is called. + */ +static void graph_set_column_colors(const char **colors, unsigned short colors_max); + /* * Output a padding line in the graph. * This is similar to graph_next_line(). However, it is guaranteed to @@ -62,7 +90,7 @@ enum graph_state { static const char **column_colors; static unsigned short column_colors_max; -void graph_set_column_colors(const char **colors, unsigned short colors_max) +static void graph_set_column_colors(const char **colors, unsigned short colors_max) { column_colors = colors; column_colors_max = colors_max; @@ -1116,7 +1144,7 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct strbuf graph_update_state(graph, GRAPH_PADDING); } -int graph_next_line(struct git_graph *graph, struct strbuf *sb) +static int graph_next_line(struct git_graph *graph, struct strbuf *sb) { switch (graph->state) { case GRAPH_PADDING: diff --git a/graph.h b/graph.h index aff960c7e8..19b0f66316 100644 --- a/graph.h +++ b/graph.h @@ -4,22 +4,6 @@ /* A graph is a pointer to this opaque structure */ struct git_graph; -/* - * Set up a custom scheme for column colors. - * - * The default column color scheme inserts ANSI color escapes to colorize - * the graph. The various color escapes are stored in an array of strings - * where each entry corresponds to a color, except for the last entry, - * which denotes the escape for resetting the color back to the default. - * When generating the graph, strings from this array are inserted before - * and after the various column characters. - * - * This function allows you to enable a custom array of color escapes. - * The 'colors_max' argument is the index of the last "reset" entry. - * - * This functions must be called BEFORE graph_init() is called. - */ -void graph_set_column_colors(const char **colors, unsigned short colors_max); /* * Create a new struct git_graph. @@ -49,17 +33,6 @@ void graph_update(struct git_graph *graph, struct commit *commit); */ int graph_is_commit_finished(struct git_graph const *graph); -/* - * Output the next line for a graph. - * This formats the next graph line into the specified strbuf. It is not - * terminated with a newline. - * - * Returns 1 if the line includes the current commit, and 0 otherwise. - * graph_next_line() will return 1 exactly once for each time - * graph_update() is called. - */ -int graph_next_line(struct git_graph *graph, struct strbuf *sb); - /* * graph_show_*: helper functions for printing to stdout diff --git a/grep.c b/grep.c index 04e3ec6c6e..4bd1b8b1dd 100644 --- a/grep.c +++ b/grep.c @@ -3,6 +3,187 @@ #include "userdiff.h" #include "xdiff-interface.h" +static int grep_source_load(struct grep_source *gs); +static int grep_source_is_binary(struct grep_source *gs); + +static struct grep_opt grep_defaults; + +/* + * Initialize the grep_defaults template with hardcoded defaults. + * We could let the compiler do this, but without C99 initializers + * the code gets unwieldy and unreadable, so... + */ +void init_grep_defaults(void) +{ + struct grep_opt *opt = &grep_defaults; + static int run_once; + + if (run_once) + return; + run_once++; + + memset(opt, 0, sizeof(*opt)); + opt->relative = 1; + opt->pathname = 1; + opt->regflags = REG_NEWLINE; + opt->max_depth = -1; + opt->pattern_type_option = GREP_PATTERN_TYPE_UNSPECIFIED; + opt->extended_regexp_option = 0; + strcpy(opt->color_context, ""); + strcpy(opt->color_filename, ""); + strcpy(opt->color_function, ""); + strcpy(opt->color_lineno, ""); + strcpy(opt->color_match, GIT_COLOR_BOLD_RED); + strcpy(opt->color_selected, ""); + strcpy(opt->color_sep, GIT_COLOR_CYAN); + opt->color = -1; +} + +static int parse_pattern_type_arg(const char *opt, const char *arg) +{ + if (!strcmp(arg, "default")) + return GREP_PATTERN_TYPE_UNSPECIFIED; + else if (!strcmp(arg, "basic")) + return GREP_PATTERN_TYPE_BRE; + else if (!strcmp(arg, "extended")) + return GREP_PATTERN_TYPE_ERE; + else if (!strcmp(arg, "fixed")) + return GREP_PATTERN_TYPE_FIXED; + else if (!strcmp(arg, "perl")) + return GREP_PATTERN_TYPE_PCRE; + die("bad %s argument: %s", opt, arg); +} + +/* + * Read the configuration file once and store it in + * the grep_defaults template. + */ +int grep_config(const char *var, const char *value, void *cb) +{ + struct grep_opt *opt = &grep_defaults; + char *color = NULL; + + if (userdiff_config(var, value) < 0) + return -1; + + if (!strcmp(var, "grep.extendedregexp")) { + if (git_config_bool(var, value)) + opt->extended_regexp_option = 1; + else + opt->extended_regexp_option = 0; + return 0; + } + + if (!strcmp(var, "grep.patterntype")) { + opt->pattern_type_option = parse_pattern_type_arg(var, value); + return 0; + } + + if (!strcmp(var, "grep.linenumber")) { + opt->linenum = git_config_bool(var, value); + return 0; + } + + if (!strcmp(var, "color.grep")) + opt->color = git_config_colorbool(var, value); + else if (!strcmp(var, "color.grep.context")) + color = opt->color_context; + else if (!strcmp(var, "color.grep.filename")) + color = opt->color_filename; + else if (!strcmp(var, "color.grep.function")) + color = opt->color_function; + else if (!strcmp(var, "color.grep.linenumber")) + color = opt->color_lineno; + else if (!strcmp(var, "color.grep.match")) + color = opt->color_match; + else if (!strcmp(var, "color.grep.selected")) + color = opt->color_selected; + else if (!strcmp(var, "color.grep.separator")) + color = opt->color_sep; + + if (color) { + if (!value) + return config_error_nonbool(var); + color_parse(value, var, color); + } + return 0; +} + +/* + * Initialize one instance of grep_opt and copy the + * default values from the template we read the configuration + * information in an earlier call to git_config(grep_config). + */ +void grep_init(struct grep_opt *opt, const char *prefix) +{ + struct grep_opt *def = &grep_defaults; + + memset(opt, 0, sizeof(*opt)); + opt->prefix = prefix; + opt->prefix_length = (prefix && *prefix) ? strlen(prefix) : 0; + opt->pattern_tail = &opt->pattern_list; + opt->header_tail = &opt->header_list; + + opt->color = def->color; + opt->extended_regexp_option = def->extended_regexp_option; + opt->pattern_type_option = def->pattern_type_option; + opt->linenum = def->linenum; + opt->max_depth = def->max_depth; + opt->pathname = def->pathname; + opt->regflags = def->regflags; + opt->relative = def->relative; + + strcpy(opt->color_context, def->color_context); + strcpy(opt->color_filename, def->color_filename); + strcpy(opt->color_function, def->color_function); + strcpy(opt->color_lineno, def->color_lineno); + strcpy(opt->color_match, def->color_match); + strcpy(opt->color_selected, def->color_selected); + strcpy(opt->color_sep, def->color_sep); +} + +void grep_commit_pattern_type(enum grep_pattern_type pattern_type, struct grep_opt *opt) +{ + if (pattern_type != GREP_PATTERN_TYPE_UNSPECIFIED) + grep_set_pattern_type_option(pattern_type, opt); + else if (opt->pattern_type_option != GREP_PATTERN_TYPE_UNSPECIFIED) + grep_set_pattern_type_option(opt->pattern_type_option, opt); + else if (opt->extended_regexp_option) + grep_set_pattern_type_option(GREP_PATTERN_TYPE_ERE, opt); +} + +void grep_set_pattern_type_option(enum grep_pattern_type pattern_type, struct grep_opt *opt) +{ + switch (pattern_type) { + case GREP_PATTERN_TYPE_UNSPECIFIED: + /* fall through */ + + case GREP_PATTERN_TYPE_BRE: + opt->fixed = 0; + opt->pcre = 0; + opt->regflags &= ~REG_EXTENDED; + break; + + case GREP_PATTERN_TYPE_ERE: + opt->fixed = 0; + opt->pcre = 0; + opt->regflags |= REG_EXTENDED; + break; + + case GREP_PATTERN_TYPE_FIXED: + opt->fixed = 1; + opt->pcre = 0; + opt->regflags &= ~REG_EXTENDED; + break; + + case GREP_PATTERN_TYPE_PCRE: + opt->fixed = 0; + opt->pcre = 1; + opt->regflags &= ~REG_EXTENDED; + break; + } +} + static struct grep_pat *create_grep_pat(const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t, @@ -60,6 +241,8 @@ void append_header_grep_pattern(struct grep_opt *opt, { struct grep_pat *p = create_grep_pat(pat, strlen(pat), "header", 0, GREP_PATTERN_HEAD, field); + if (field == GREP_HEADER_REFLOG) + opt->use_reflog_filter = 1; do_append_grep_pat(&opt->header_tail, p); } @@ -332,6 +515,87 @@ static struct grep_expr *compile_pattern_expr(struct grep_pat **list) return compile_pattern_or(list); } +static void indent(int in) +{ + while (in-- > 0) + fputc(' ', stderr); +} + +static void dump_grep_pat(struct grep_pat *p) +{ + switch (p->token) { + case GREP_AND: fprintf(stderr, "*and*"); break; + case GREP_OPEN_PAREN: fprintf(stderr, "*(*"); break; + case GREP_CLOSE_PAREN: fprintf(stderr, "*)*"); break; + case GREP_NOT: fprintf(stderr, "*not*"); break; + case GREP_OR: fprintf(stderr, "*or*"); break; + + case GREP_PATTERN: fprintf(stderr, "pattern"); break; + case GREP_PATTERN_HEAD: fprintf(stderr, "pattern_head"); break; + case GREP_PATTERN_BODY: fprintf(stderr, "pattern_body"); break; + } + + switch (p->token) { + default: break; + case GREP_PATTERN_HEAD: + fprintf(stderr, "", p->field); break; + case GREP_PATTERN_BODY: + fprintf(stderr, ""); break; + } + switch (p->token) { + default: break; + case GREP_PATTERN_HEAD: + case GREP_PATTERN_BODY: + case GREP_PATTERN: + fprintf(stderr, "%.*s", (int)p->patternlen, p->pattern); + break; + } + fputc('\n', stderr); +} + +static void dump_grep_expression_1(struct grep_expr *x, int in) +{ + indent(in); + switch (x->node) { + case GREP_NODE_TRUE: + fprintf(stderr, "true\n"); + break; + case GREP_NODE_ATOM: + dump_grep_pat(x->u.atom); + break; + case GREP_NODE_NOT: + fprintf(stderr, "(not\n"); + dump_grep_expression_1(x->u.unary, in+1); + indent(in); + fprintf(stderr, ")\n"); + break; + case GREP_NODE_AND: + fprintf(stderr, "(and\n"); + dump_grep_expression_1(x->u.binary.left, in+1); + dump_grep_expression_1(x->u.binary.right, in+1); + indent(in); + fprintf(stderr, ")\n"); + break; + case GREP_NODE_OR: + fprintf(stderr, "(or\n"); + dump_grep_expression_1(x->u.binary.left, in+1); + dump_grep_expression_1(x->u.binary.right, in+1); + indent(in); + fprintf(stderr, ")\n"); + break; + } +} + +static void dump_grep_expression(struct grep_opt *opt) +{ + struct grep_expr *x = opt->pattern_expression; + + if (opt->all_match) + fprintf(stderr, "[all-match]\n"); + dump_grep_expression_1(x, 0); + fflush(NULL); +} + static struct grep_expr *grep_true_expr(void) { struct grep_expr *z = xcalloc(1, sizeof(*z)); @@ -395,7 +659,23 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt) return header_expr; } -void compile_grep_patterns(struct grep_opt *opt) +static struct grep_expr *grep_splice_or(struct grep_expr *x, struct grep_expr *y) +{ + struct grep_expr *z = x; + + while (x) { + assert(x->node == GREP_NODE_OR); + if (x->u.binary.right && + x->u.binary.right->node == GREP_NODE_TRUE) { + x->u.binary.right = y; + break; + } + x = x->u.binary.right; + } + return z; +} + +static void compile_grep_patterns_real(struct grep_opt *opt) { struct grep_pat *p; struct grep_expr *header_expr = prep_header_patterns(opt); @@ -415,7 +695,7 @@ void compile_grep_patterns(struct grep_opt *opt) if (opt->all_match || header_expr) opt->extended = 1; - else if (!opt->extended) + else if (!opt->extended && !opt->debug) return; p = opt->pattern_list; @@ -429,12 +709,22 @@ void compile_grep_patterns(struct grep_opt *opt) if (!opt->pattern_expression) opt->pattern_expression = header_expr; + else if (opt->all_match) + opt->pattern_expression = grep_splice_or(header_expr, + opt->pattern_expression); else opt->pattern_expression = grep_or_expr(opt->pattern_expression, header_expr); opt->all_match = 1; } +void compile_grep_patterns(struct grep_opt *opt) +{ + compile_grep_patterns_real(opt); + if (opt->debug) + dump_grep_expression(opt); +} + static void free_pattern_expr(struct grep_expr *x) { switch (x->node) { @@ -586,6 +876,7 @@ static struct { } header_field[] = { { "author ", 7 }, { "committer ", 10 }, + { "reflog ", 7 }, }; static int match_one_pattern(struct grep_pat *p, char *bol, char *eol, @@ -609,7 +900,14 @@ static int match_one_pattern(struct grep_pat *p, char *bol, char *eol, if (strncmp(bol, field, len)) return 0; bol += len; - saved_ch = strip_timestamp(bol, &eol); + switch (p->field) { + case GREP_HEADER_AUTHOR: + case GREP_HEADER_COMMITTER: + saved_ch = strip_timestamp(bol, &eol); + break; + default: + break; + } } again: @@ -1252,7 +1550,7 @@ int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size) struct grep_source gs; int r; - grep_source_init(&gs, GREP_SOURCE_BUF, NULL, NULL); + grep_source_init(&gs, GREP_SOURCE_BUF, NULL, NULL, NULL); gs.buf = buf; gs.size = size; @@ -1263,10 +1561,12 @@ int grep_buffer(struct grep_opt *opt, char *buf, unsigned long size) } void grep_source_init(struct grep_source *gs, enum grep_source_type type, - const char *name, const void *identifier) + const char *name, const char *path, + const void *identifier) { gs->type = type; gs->name = name ? xstrdup(name) : NULL; + gs->path = path ? xstrdup(path) : NULL; gs->buf = NULL; gs->size = 0; gs->driver = NULL; @@ -1288,6 +1588,8 @@ void grep_source_clear(struct grep_source *gs) { free(gs->name); gs->name = NULL; + free(gs->path); + gs->path = NULL; free(gs->identifier); gs->identifier = NULL; grep_source_clear_data(gs); @@ -1358,7 +1660,7 @@ static int grep_source_load_file(struct grep_source *gs) return 0; } -int grep_source_load(struct grep_source *gs) +static int grep_source_load(struct grep_source *gs) { if (gs->buf) return 0; @@ -1380,13 +1682,14 @@ void grep_source_load_driver(struct grep_source *gs) return; grep_attr_lock(); - gs->driver = userdiff_find_by_path(gs->name); + if (gs->path) + gs->driver = userdiff_find_by_path(gs->path); if (!gs->driver) gs->driver = userdiff_find_by_name("default"); grep_attr_unlock(); } -int grep_source_is_binary(struct grep_source *gs) +static int grep_source_is_binary(struct grep_source *gs) { grep_source_load_driver(gs); if (gs->driver->binary != -1) diff --git a/grep.h b/grep.h index 75afb7b105..8fc854f400 100644 --- a/grep.h +++ b/grep.h @@ -29,9 +29,12 @@ enum grep_context { enum grep_header_field { GREP_HEADER_AUTHOR = 0, - GREP_HEADER_COMMITTER + GREP_HEADER_COMMITTER, + GREP_HEADER_REFLOG, + + /* Must be at the end of the enum */ + GREP_HEADER_FIELD_MAX }; -#define GREP_HEADER_FIELD_MAX (GREP_HEADER_COMMITTER + 1) struct grep_pat { struct grep_pat *next; @@ -98,11 +101,13 @@ struct grep_opt { int word_regexp; int fixed; int all_match; + int debug; #define GREP_BINARY_DEFAULT 0 #define GREP_BINARY_NOMATCH 1 #define GREP_BINARY_TEXT 2 int binary; int extended; + int use_reflog_filter; int pcre; int relative; int pathname; @@ -133,6 +138,12 @@ struct grep_opt { void *output_priv; }; +extern void init_grep_defaults(void); +extern int grep_config(const char *var, const char *value, void *); +extern void grep_init(struct grep_opt *, const char *prefix); +void grep_set_pattern_type_option(enum grep_pattern_type, struct grep_opt *opt); +void grep_commit_pattern_type(enum grep_pattern_type, struct grep_opt *opt); + extern void append_grep_pat(struct grep_opt *opt, const char *pat, size_t patlen, const char *origin, int no, enum grep_pat_token t); extern void append_grep_pattern(struct grep_opt *opt, const char *pat, const char *origin, int no, enum grep_pat_token t); extern void append_header_grep_pattern(struct grep_opt *, enum grep_header_field, const char *); @@ -153,16 +164,17 @@ struct grep_source { char *buf; unsigned long size; + char *path; /* for attribute lookups */ struct userdiff_driver *driver; }; void grep_source_init(struct grep_source *gs, enum grep_source_type type, - const char *name, const void *identifier); -int grep_source_load(struct grep_source *gs); + const char *name, const char *path, + const void *identifier); void grep_source_clear_data(struct grep_source *gs); void grep_source_clear(struct grep_source *gs); void grep_source_load_driver(struct grep_source *gs); -int grep_source_is_binary(struct grep_source *gs); + int grep_source(struct grep_opt *opt, struct grep_source *gs); diff --git a/http-walker.c b/http-walker.c index 51a906e9e3..1516c5eb29 100644 --- a/http-walker.c +++ b/http-walker.c @@ -396,7 +396,7 @@ static int fetch_indices(struct walker *walker, struct alt_base *repo) return ret; } -static int fetch_pack(struct walker *walker, struct alt_base *repo, unsigned char *sha1) +static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigned char *sha1) { struct packed_git *target; int ret; @@ -524,7 +524,7 @@ static int fetch(struct walker *walker, unsigned char *sha1) if (!fetch_object(walker, altbase, sha1)) return 0; while (altbase) { - if (!fetch_pack(walker, altbase, sha1)) + if (!http_fetch_pack(walker, altbase, sha1)) return 0; fetch_alternates(walker, data->alt->base); altbase = altbase->next; diff --git a/http.c b/http.c index 9bac1d89fd..0a8abf3be3 100644 --- a/http.c +++ b/http.c @@ -631,6 +631,18 @@ void run_active_slot(struct active_request_slot *slot) FD_ZERO(&excfds); curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd); + /* + * It can happen that curl_multi_timeout returns a pathologically + * long timeout when curl_multi_fdset returns no file descriptors + * to read. See commit message for more details. + */ + if (max_fd < 0 && + (select_timeout.tv_sec > 0 || + select_timeout.tv_usec > 50000)) { + select_timeout.tv_sec = 0; + select_timeout.tv_usec = 50000; + } + select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout); } } @@ -745,10 +757,8 @@ char *get_remote_object_url(const char *url, const char *hex, return strbuf_detach(&buf, NULL); } -int handle_curl_result(struct active_request_slot *slot) +int handle_curl_result(struct slot_results *results) { - struct slot_results *results = slot->results; - if (results->curl_result == CURLE_OK) { credential_approve(&http_auth); return HTTP_OK; @@ -760,7 +770,6 @@ int handle_curl_result(struct active_request_slot *slot) return HTTP_NOAUTH; } else { credential_fill(&http_auth); - init_curl_http_auth(slot->curl); return HTTP_REAUTH; } } else { @@ -818,10 +827,11 @@ static int http_request(const char *url, void *result, int target, int options) curl_easy_setopt(slot->curl, CURLOPT_URL, url); curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(slot->curl, CURLOPT_ENCODING, "gzip"); if (start_active_slot(slot)) { run_active_slot(slot); - ret = handle_curl_result(slot); + ret = handle_curl_result(&results); } else { error("Unable to start HTTP request for %s", url); ret = HTTP_START_FAILED; diff --git a/http.h b/http.h index 12de25597d..0a80d303e3 100644 --- a/http.h +++ b/http.h @@ -78,7 +78,7 @@ extern int start_active_slot(struct active_request_slot *slot); extern void run_active_slot(struct active_request_slot *slot); extern void finish_active_slot(struct active_request_slot *slot); extern void finish_all_active_slots(void); -extern int handle_curl_result(struct active_request_slot *slot); +extern int handle_curl_result(struct slot_results *results); #ifdef USE_CURL_MULTI extern void fill_active_slots(void); diff --git a/ident.c b/ident.c index 484e0a9803..a4bf206e2f 100644 --- a/ident.c +++ b/ident.c @@ -93,7 +93,7 @@ static void copy_email(const struct passwd *pw, struct strbuf *email) add_domainname(email); } -const char *ident_default_name(void) +static const char *ident_default_name(void) { if (!git_default_name.len) { copy_gecos(xgetpwuid_self(), &git_default_name); @@ -117,7 +117,7 @@ const char *ident_default_email(void) return git_default_email.buf; } -const char *ident_default_date(void) +static const char *ident_default_date(void) { if (!git_default_date[0]) datestamp(git_default_date, sizeof(git_default_date)); diff --git a/mailmap.c b/mailmap.c index 47aa419245..ea4b471ede 100644 --- a/mailmap.c +++ b/mailmap.c @@ -118,7 +118,7 @@ static char *parse_name_and_email(char *buffer, char **name, while (isspace(*nstart) && nstart < left) ++nstart; nend = left-1; - while (isspace(*nend) && nend > nstart) + while (nend > nstart && isspace(*nend)) --nend; *name = (nstart < nend ? nstart : NULL); diff --git a/merge-recursive.h b/merge-recursive.h index 58f3435e9e..9e090a3470 100644 --- a/merge-recursive.h +++ b/merge-recursive.h @@ -59,9 +59,4 @@ struct tree *write_tree_from_memory(struct merge_options *o); int parse_merge_opt(struct merge_options *out, const char *s); -/* builtin/merge.c */ -int try_merge_command(const char *strategy, size_t xopts_nr, - const char **xopts, struct commit_list *common, - const char *head_arg, struct commit_list *remotes); - #endif diff --git a/merge.c b/merge.c new file mode 100644 index 0000000000..70f1000fcb --- /dev/null +++ b/merge.c @@ -0,0 +1,112 @@ +#include "cache.h" +#include "commit.h" +#include "run-command.h" +#include "resolve-undo.h" +#include "tree-walk.h" +#include "unpack-trees.h" +#include "dir.h" + +static const char *merge_argument(struct commit *commit) +{ + if (commit) + return sha1_to_hex(commit->object.sha1); + else + return EMPTY_TREE_SHA1_HEX; +} + +int try_merge_command(const char *strategy, size_t xopts_nr, + const char **xopts, struct commit_list *common, + const char *head_arg, struct commit_list *remotes) +{ + const char **args; + int i = 0, x = 0, ret; + struct commit_list *j; + struct strbuf buf = STRBUF_INIT; + + args = xmalloc((4 + xopts_nr + commit_list_count(common) + + commit_list_count(remotes)) * sizeof(char *)); + strbuf_addf(&buf, "merge-%s", strategy); + args[i++] = buf.buf; + for (x = 0; x < xopts_nr; x++) { + char *s = xmalloc(strlen(xopts[x])+2+1); + strcpy(s, "--"); + strcpy(s+2, xopts[x]); + args[i++] = s; + } + for (j = common; j; j = j->next) + args[i++] = xstrdup(merge_argument(j->item)); + args[i++] = "--"; + args[i++] = head_arg; + for (j = remotes; j; j = j->next) + args[i++] = xstrdup(merge_argument(j->item)); + args[i] = NULL; + ret = run_command_v_opt(args, RUN_GIT_CMD); + strbuf_release(&buf); + i = 1; + for (x = 0; x < xopts_nr; x++) + free((void *)args[i++]); + for (j = common; j; j = j->next) + free((void *)args[i++]); + i += 2; + for (j = remotes; j; j = j->next) + free((void *)args[i++]); + free(args); + discard_cache(); + if (read_cache() < 0) + die(_("failed to read the cache")); + resolve_undo_clear(); + + return ret; +} + +int checkout_fast_forward(const unsigned char *head, + const unsigned char *remote, + int overwrite_ignore) +{ + struct tree *trees[MAX_UNPACK_TREES]; + struct unpack_trees_options opts; + struct tree_desc t[MAX_UNPACK_TREES]; + int i, fd, nr_trees = 0; + struct dir_struct dir; + struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); + + refresh_cache(REFRESH_QUIET); + + fd = hold_locked_index(lock_file, 1); + + memset(&trees, 0, sizeof(trees)); + memset(&opts, 0, sizeof(opts)); + memset(&t, 0, sizeof(t)); + if (overwrite_ignore) { + memset(&dir, 0, sizeof(dir)); + dir.flags |= DIR_SHOW_IGNORED; + setup_standard_excludes(&dir); + opts.dir = &dir; + } + + opts.head_idx = 1; + opts.src_index = &the_index; + opts.dst_index = &the_index; + opts.update = 1; + opts.verbose_update = 1; + opts.merge = 1; + opts.fn = twoway_merge; + setup_unpack_trees_porcelain(&opts, "merge"); + + trees[nr_trees] = parse_tree_indirect(head); + if (!trees[nr_trees++]) + return -1; + trees[nr_trees] = parse_tree_indirect(remote); + if (!trees[nr_trees++]) + return -1; + for (i = 0; i < nr_trees; i++) { + parse_tree(trees[i]); + init_tree_desc(t+i, trees[i]->buffer, trees[i]->size); + } + if (unpack_trees(nr_trees, t, &opts)) + return -1; + if (write_cache(fd, active_cache, active_nr) || + commit_locked_index(lock_file)) + die(_("unable to write new index file")); + return 0; +} diff --git a/mergetools/defaults b/mergetools/defaults index 1d8f2a3dd3..21e63ecc3e 100644 --- a/mergetools/defaults +++ b/mergetools/defaults @@ -8,36 +8,12 @@ can_diff () { } diff_cmd () { - merge_tool_cmd="$(get_merge_tool_cmd "$1")" - if test -z "$merge_tool_cmd" - then - status=1 - break - fi - ( eval $merge_tool_cmd ) - status=$? + status=1 return $status } merge_cmd () { - merge_tool_cmd="$(get_merge_tool_cmd "$1")" - if test -z "$merge_tool_cmd" - then - status=1 - break - fi - trust_exit_code="$(git config --bool \ - mergetool."$1".trustExitCode || echo false)" - if test "$trust_exit_code" = "false" - then - touch "$BACKUP" - ( eval $merge_tool_cmd ) - status=$? - check_unchanged - else - ( eval $merge_tool_cmd ) - status=$? - fi + status=1 return $status } diff --git a/mergetools/p4merge b/mergetools/p4merge index 1a45c1b0c5..295361a8aa 100644 --- a/mergetools/p4merge +++ b/mergetools/p4merge @@ -1,5 +1,30 @@ diff_cmd () { + # p4merge does not like /dev/null + rm_local= + rm_remote= + if test "/dev/null" = "$LOCAL" + then + LOCAL="./p4merge-dev-null.LOCAL.$$" + >"$LOCAL" + rm_local=true + fi + if test "/dev/null" = "$REMOTE" + then + REMOTE="./p4merge-dev-null.REMOTE.$$" + >"$REMOTE" + rm_remote=true + fi + "$merge_tool_path" "$LOCAL" "$REMOTE" + + if test -n "$rm_local" + then + rm -f "$LOCAL" + fi + if test -n "$rm_remote" + then + rm -f "$REMOTE" + fi } merge_cmd () { diff --git a/notes.c b/notes.c index 93e9868d5d..ee8f01f1d5 100644 --- a/notes.c +++ b/notes.c @@ -1196,8 +1196,18 @@ void free_notes(struct notes_tree *t) memset(t, 0, sizeof(struct notes_tree)); } -void format_note(struct notes_tree *t, const unsigned char *object_sha1, - struct strbuf *sb, const char *output_encoding, int flags) +/* + * Fill the given strbuf with the notes associated with the given object. + * + * If the given notes_tree structure is not initialized, it will be auto- + * initialized to the default value (see documentation for init_notes() above). + * If the given notes_tree is NULL, the internal/default notes_tree will be + * used instead. + * + * 'flags' is a bitwise combination of the flags for format_display_notes. + */ +static void format_note(struct notes_tree *t, const unsigned char *object_sha1, + struct strbuf *sb, const char *output_encoding, int flags) { static const char utf8[] = "utf-8"; const unsigned char *sha1; @@ -1221,7 +1231,7 @@ void format_note(struct notes_tree *t, const unsigned char *object_sha1, } if (output_encoding && *output_encoding && - strcmp(utf8, output_encoding)) { + !is_encoding_utf8(output_encoding)) { char *reencoded = reencode_string(msg, output_encoding, utf8); if (reencoded) { free(msg); diff --git a/notes.h b/notes.h index c716694b9e..3592b19d2d 100644 --- a/notes.h +++ b/notes.h @@ -241,20 +241,6 @@ void free_notes(struct notes_tree *t); #define NOTES_SHOW_HEADER 1 #define NOTES_INDENT 2 -/* - * Fill the given strbuf with the notes associated with the given object. - * - * If the given notes_tree structure is not initialized, it will be auto- - * initialized to the default value (see documentation for init_notes() above). - * If the given notes_tree is NULL, the internal/default notes_tree will be - * used instead. - * - * 'flags' is a bitwise combination of the above formatting flags. - */ -void format_note(struct notes_tree *t, const unsigned char *object_sha1, - struct strbuf *sb, const char *output_encoding, int flags); - - struct string_list; struct display_notes_opt { diff --git a/pager.c b/pager.c index 4dcb08d967..c1ecf657fd 100644 --- a/pager.c +++ b/pager.c @@ -6,26 +6,17 @@ #define DEFAULT_PAGER "less" #endif +struct pager_config { + const char *cmd; + int want; + char *value; +}; + /* * This is split up from the rest of git so that we can do * something different on Windows. */ -#ifndef WIN32 -static void pager_preexec(void) -{ - /* - * Work around bug in "less" by not starting it until we - * have real input - */ - fd_set in; - - FD_ZERO(&in); - FD_SET(0, &in); - select(1, &in, NULL, &in, NULL); -} -#endif - static const char *pager_argv[] = { NULL, NULL }; static struct child_process pager_process; @@ -93,9 +84,6 @@ void setup_pager(void) static const char *env[] = { "LESS=FRSX", NULL }; pager_process.env = env; } -#ifndef WIN32 - pager_process.preexec_cb = pager_preexec; -#endif if (start_command(&pager_process)) return; @@ -159,3 +147,31 @@ int decimal_width(int number) i *= 10; return width; } + +static int pager_command_config(const char *var, const char *value, void *data) +{ + struct pager_config *c = data; + if (!prefixcmp(var, "pager.") && !strcmp(var + 6, c->cmd)) { + int b = git_config_maybe_bool(var, value); + if (b >= 0) + c->want = b; + else { + c->want = 1; + c->value = xstrdup(value); + } + } + return 0; +} + +/* returns 0 for "no pager", 1 for "use pager", and -1 for "not specified" */ +int check_pager_config(const char *cmd) +{ + struct pager_config c; + c.cmd = cmd; + c.want = -1; + c.value = NULL; + git_config(pager_command_config, &c); + if (c.value) + pager_program = c.value; + return c.want; +} diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index acb25394f4..59215fa86e 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -1679,7 +1679,6 @@ sub parents_exclude { if ( $commit eq $excluded ) { push @excluded, $commit; $found++; - last; } else { push @new, $commit; @@ -1713,14 +1712,14 @@ sub find_extra_svn_parents { my @merge_tips; my $url = $self->url; my $uuid = $self->ra_uuid; - my %ranges; + my @all_ranges; for my $merge ( @merges ) { my ($tip_commit, @ranges) = lookup_svn_merge( $uuid, $url, $merge ); unless (!$tip_commit or grep { $_ eq $tip_commit } @$parents ) { push @merge_tips, $tip_commit; - $ranges{$tip_commit} = \@ranges; + push @all_ranges, @ranges; } else { push @merge_tips, undef; } @@ -1735,8 +1734,6 @@ sub find_extra_svn_parents { my $spec = shift @merges; next unless $merge_tip and $excluded{$merge_tip}; - my $ranges = $ranges{$merge_tip}; - # check out 'new' tips my $merge_base; eval { @@ -1758,7 +1755,7 @@ sub find_extra_svn_parents { my (@incomplete) = check_cherry_pick( $merge_base, $merge_tip, $parents, - @$ranges, + @all_ranges, ); if ( @incomplete ) { @@ -2334,11 +2331,11 @@ sub path { if (@_) { my $path = shift; - $self->{path} = canonicalize_path($path); + $self->{_path} = canonicalize_path($path); return; } - return $self->{path}; + return $self->{_path}; } sub url { diff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm index 755092fdff..3bbc20a054 100644 --- a/perl/Git/SVN/Editor.pm +++ b/perl/Git/SVN/Editor.pm @@ -345,7 +345,30 @@ sub M { $self->close_file($fbat,undef,$self->{pool}); } -sub T { shift->M(@_) } +sub T { + my ($self, $m, $deletions) = @_; + + # Work around subversion issue 4091: toggling the "is a + # symlink" property requires removing and re-adding a + # file or else "svn up" on affected clients trips an + # assertion and aborts. + if (($m->{mode_b} =~ /^120/ && $m->{mode_a} !~ /^120/) || + ($m->{mode_b} !~ /^120/ && $m->{mode_a} =~ /^120/)) { + $self->D({ + mode_a => $m->{mode_a}, mode_b => '000000', + sha1_a => $m->{sha1_a}, sha1_b => '0' x 40, + chg => 'D', file_b => $m->{file_b} + }); + $self->A({ + mode_a => '000000', mode_b => $m->{mode_b}, + sha1_a => '0' x 40, sha1_b => $m->{sha1_b}, + chg => 'A', file_b => $m->{file_b} + }); + return; + } + + $self->M($m, $deletions); +} sub change_file_prop { my ($self, $fbat, $pname, $pval) = @_; diff --git a/perl/Git/SVN/GlobSpec.pm b/perl/Git/SVN/GlobSpec.pm index 96cfd9896e..c95f5d76ca 100644 --- a/perl/Git/SVN/GlobSpec.pm +++ b/perl/Git/SVN/GlobSpec.pm @@ -44,7 +44,9 @@ sub new { my $right = join('/', @right); $re = join('/', @patterns); $re = join('\/', - grep(length, quotemeta($left), "($re)", quotemeta($right))); + grep(length, quotemeta($left), + "($re)(?=/|\$)", + quotemeta($right))); my $left_re = qr/^\/\Q$left\E(\/|$)/; bless { left => $left, right => $right, left_regex => $left_re, regex => qr/$re/, glob => $glob, depth => $depth }, $class; diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm index 90ec30bfff..049c97bfaf 100644 --- a/perl/Git/SVN/Ra.pm +++ b/perl/Git/SVN/Ra.pm @@ -416,7 +416,7 @@ sub gs_fetch_loop_common { } $SVN::Error::handler = $err_handler; - my %exists = map { $_->{path} => $_ } @$gsv; + my %exists = map { $_->path => $_ } @$gsv; foreach my $r (sort {$a <=> $b} keys %revs) { my ($paths, $logged) = @{$revs{$r}}; diff --git a/perl/Git/SVN/Utils.pm b/perl/Git/SVN/Utils.pm index 4bb4dde89a..8b8cf3755c 100644 --- a/perl/Git/SVN/Utils.pm +++ b/perl/Git/SVN/Utils.pm @@ -122,7 +122,6 @@ sub _canonicalize_path_ourselves { $path = _collapse_dotdot($path); $path =~ s#/$##g; $path =~ s#^\./## if $dot_slash_added; - $path =~ s#^/##; $path =~ s#^\.$##; return $path; } diff --git a/po/de.po b/po/de.po index d19b4e72b8..0db9a9b2ab 100644 --- a/po/de.po +++ b/po/de.po @@ -55,7 +55,7 @@ msgstr "Konnte '%s' nicht öffnen" #: bundle.c:140 msgid "Repository lacks these prerequisite commits:" -msgstr "Dem Projektarchiv fehlen folgende vorrausgesetzte Versionen:" +msgstr "Dem Projektarchiv fehlen folgende vorausgesetzte Versionen:" #: bundle.c:164 sequencer.c:550 sequencer.c:982 builtin/log.c:290 #: builtin/log.c:727 builtin/log.c:1313 builtin/log.c:1529 builtin/merge.c:347 @@ -1755,7 +1755,7 @@ msgstr "Anzahl" #: builtin/apply.c:4290 msgid "remove leading slashes from traditional diff paths" msgstr "" -"entfernt vorrangestellte Schrägstriche von herkömmlichen " +"entfernt vorangestellte Schrägstriche von herkömmlichen " "Differenzpfaden" #: builtin/apply.c:4293 @@ -2062,7 +2062,7 @@ msgstr "Konnte einige Referenzen nicht lesen" #: builtin/branch.c:613 msgid "cannot rename the current branch while not on any." msgstr "" -"Kann aktuellen Zweig nicht umbennen, solange du dich auf keinem befindest." +"Kann aktuellen Zweig nicht umbenennen, solange du dich auf keinem befindest." #: builtin/branch.c:623 #, c-format @@ -2346,7 +2346,7 @@ msgid "" "git checkout: --ours/--theirs, --force and --merge are incompatible when\n" "checking out of the index." msgstr "" -"git checkout: --ours/--theirs, --force and --merge sind inkompatibel wenn\n" +"git checkout: --ours/--theirs, --force und --merge sind inkompatibel wenn\n" "du aus der Bereitstellung auscheckst." #: builtin/checkout.c:1092 @@ -3654,7 +3654,7 @@ msgstr "Konnte %s nicht nach %s verschieben" #: builtin/init-db.c:363 #, c-format msgid "Could not create git link %s" -msgstr "Konnte git-Verknüfung %s nicht erstellen" +msgstr "Konnte git-Verknüpfung %s nicht erstellen" #. #. * TRANSLATORS: The first '%s' is either "Reinitialized @@ -3766,11 +3766,11 @@ msgstr "unechte Einreicher-Informationen %s" #: builtin/log.c:1202 msgid "-n and -k are mutually exclusive." -msgstr "-n und -k schliessen sich gegenseitig aus" +msgstr "-n und -k schließen sich gegenseitig aus" #: builtin/log.c:1204 msgid "--subject-prefix and -k are mutually exclusive." -msgstr "--subject-prefix und -k schliessen sich gegenseitig aus" +msgstr "--subject-prefix und -k schließen sich gegenseitig aus" #: builtin/log.c:1212 msgid "--name-only does not make sense" @@ -5773,14 +5773,14 @@ msgid "" "and run me again. I am stopping in case you still have something\n" "valuable there." msgstr "" -"Es scheint so, als gäbe es das Verzeichnis $state_dir_base bereits, und\n" -"es wäre verwunderlich, wenn ein Neuaufbau bereits im Gange ist. Wenn das\n" -"der Fall ist, probiere bitte\n" +"Es sieht so aus, als ob es das Verzeichnis $state_dir_base bereits gibt\n" +"und es könnte ein anderer Neuaufbau im Gange sein. Wenn das der Fall ist,\n" +"probiere bitte\n" "\t$cmd_live_rebase\n" "Wenn das nicht der Fall ist, probiere bitte\n" "\t$cmd_clear_stale_rebase\n" -"und führe dieses Kommando nochmal aus. Es wird angehalten, falls bereits\n" -"etwas Nützliches vorhanden ist." +"und führe dieses Kommando nochmal aus. Es wird angehalten, falls noch\n" +"etwas Schützenswertes vorhanden ist." #: git-rebase.sh:395 #, sh-format diff --git a/po/git.pot b/po/git.pot index 6915b02153..e5611581e6 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 \n" -"POT-Creation-Date: 2012-09-05 06:20+0800\n" +"POT-Creation-Date: 2012-10-16 08:38+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -35,6 +35,91 @@ msgid "" "or use 'git commit -a'." msgstr "" +#: archive.c:10 +msgid "git archive [options] [...]" +msgstr "" + +#: archive.c:11 +msgid "git archive --list" +msgstr "" + +#: archive.c:12 +msgid "" +"git archive --remote [--exec ] [options] [...]" +msgstr "" + +#: archive.c:13 +msgid "git archive --remote [--exec ] --list" +msgstr "" + +#: archive.c:322 +msgid "fmt" +msgstr "" + +#: archive.c:322 +msgid "archive format" +msgstr "" + +#: archive.c:323 builtin/log.c:1079 +msgid "prefix" +msgstr "" + +#: archive.c:324 +msgid "prepend prefix to each pathname in the archive" +msgstr "" + +#: archive.c:325 builtin/archive.c:91 builtin/blame.c:2389 +#: builtin/blame.c:2390 builtin/config.c:56 builtin/fast-export.c:642 +#: builtin/fast-export.c:644 builtin/grep.c:801 builtin/hash-object.c:77 +#: builtin/ls-files.c:494 builtin/ls-files.c:497 builtin/notes.c:540 +#: builtin/notes.c:697 builtin/read-tree.c:107 parse-options.h:149 +msgid "file" +msgstr "" + +#: archive.c:326 builtin/archive.c:92 +msgid "write the archive to this file" +msgstr "" + +#: archive.c:328 +msgid "read .gitattributes in working directory" +msgstr "" + +#: archive.c:329 +msgid "report archived files on stderr" +msgstr "" + +#: archive.c:330 +msgid "store only" +msgstr "" + +#: archive.c:331 +msgid "compress faster" +msgstr "" + +#: archive.c:339 +msgid "compress better" +msgstr "" + +#: archive.c:342 +msgid "list supported archive formats" +msgstr "" + +#: archive.c:344 builtin/archive.c:93 builtin/clone.c:85 +msgid "repo" +msgstr "" + +#: archive.c:345 builtin/archive.c:94 +msgid "retrieve the archive from remote repository " +msgstr "" + +#: archive.c:346 builtin/archive.c:95 builtin/notes.c:619 +msgid "command" +msgstr "" + +#: archive.c:347 builtin/archive.c:96 +msgid "path to the remote git-upload-archive command" +msgstr "" + #: bundle.c:36 #, c-format msgid "'%s' does not look like a v2 bundle file" @@ -45,7 +130,7 @@ msgstr "" msgid "unrecognized header: %s%s (%d)" msgstr "" -#: bundle.c:89 builtin/commit.c:699 +#: bundle.c:89 builtin/commit.c:672 #, c-format msgid "could not open '%s'" msgstr "" @@ -54,7 +139,7 @@ msgstr "" msgid "Repository lacks these prerequisite commits:" msgstr "" -#: bundle.c:164 sequencer.c:550 sequencer.c:982 builtin/log.c:290 +#: bundle.c:164 sequencer.c:562 sequencer.c:994 builtin/log.c:290 #: builtin/log.c:727 builtin/log.c:1313 builtin/log.c:1529 builtin/merge.c:347 #: builtin/shortlog.c:181 msgid "revision walk setup failed" @@ -113,12 +198,12 @@ msgstr "" msgid "index-pack died" msgstr "" -#: commit.c:48 +#: commit.c:50 #, c-format msgid "could not parse %s" msgstr "" -#: commit.c:50 +#: commit.c:52 #, c-format msgid "%s %s is not a commit!" msgstr "" @@ -225,32 +310,7 @@ msgid "" "%s" msgstr "" -#: diff.c:1401 -msgid " 0 files changed" -msgstr "" - -#: diff.c:1405 -#, c-format -msgid " %d file changed" -msgid_plural " %d files changed" -msgstr[0] "" -msgstr[1] "" - -#: diff.c:1422 -#, c-format -msgid ", %d insertion(+)" -msgid_plural ", %d insertions(+)" -msgstr[0] "" -msgstr[1] "" - -#: diff.c:1433 -#, c-format -msgid ", %d deletion(-)" -msgid_plural ", %d deletions(-)" -msgstr[0] "" -msgstr[1] "" - -#: diff.c:3460 +#: diff.c:3458 #, c-format msgid "" "Failed to parse --dirstat/-X option parameter:\n" @@ -269,17 +329,17 @@ msgstr "" msgid "gpg failed to sign the data" msgstr "" -#: grep.c:1320 +#: grep.c:1441 #, c-format msgid "'%s': unable to read %s" msgstr "" -#: grep.c:1337 +#: grep.c:1458 #, c-format msgid "'%s': %s" msgstr "" -#: grep.c:1348 +#: grep.c:1469 #, c-format msgid "'%s': short read %s" msgstr "" @@ -391,189 +451,189 @@ msgstr "" msgid "do not know what to do with %06o %s '%s'" msgstr "" -#: merge-recursive.c:921 +#: merge-recursive.c:922 msgid "Failed to execute internal merge" msgstr "" -#: merge-recursive.c:925 +#: merge-recursive.c:926 #, c-format msgid "Unable to add %s to database" msgstr "" -#: merge-recursive.c:941 +#: merge-recursive.c:942 msgid "unsupported object type in the tree" msgstr "" -#: merge-recursive.c:1020 merge-recursive.c:1034 +#: merge-recursive.c:1021 merge-recursive.c:1035 #, c-format msgid "" "CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left " "in tree." msgstr "" -#: merge-recursive.c:1026 merge-recursive.c:1039 +#: merge-recursive.c:1027 merge-recursive.c:1040 #, c-format msgid "" "CONFLICT (%s/delete): %s deleted in %s and %s in %s. Version %s of %s left " "in tree at %s." msgstr "" -#: merge-recursive.c:1080 +#: merge-recursive.c:1081 msgid "rename" msgstr "" -#: merge-recursive.c:1080 +#: merge-recursive.c:1081 msgid "renamed" msgstr "" -#: merge-recursive.c:1136 +#: merge-recursive.c:1137 #, c-format msgid "%s is a directory in %s adding as %s instead" msgstr "" -#: merge-recursive.c:1158 +#: merge-recursive.c:1159 #, c-format msgid "" "CONFLICT (rename/rename): Rename \"%s\"->\"%s\" in branch \"%s\" rename \"%s" "\"->\"%s\" in \"%s\"%s" msgstr "" -#: merge-recursive.c:1163 +#: merge-recursive.c:1164 msgid " (left unresolved)" msgstr "" -#: merge-recursive.c:1217 +#: merge-recursive.c:1218 #, c-format msgid "CONFLICT (rename/rename): Rename %s->%s in %s. Rename %s->%s in %s" msgstr "" -#: merge-recursive.c:1247 +#: merge-recursive.c:1248 #, c-format msgid "Renaming %s to %s and %s to %s instead" msgstr "" -#: merge-recursive.c:1446 +#: merge-recursive.c:1447 #, c-format msgid "CONFLICT (rename/add): Rename %s->%s in %s. %s added in %s" msgstr "" -#: merge-recursive.c:1456 +#: merge-recursive.c:1457 #, c-format msgid "Adding merged %s" msgstr "" -#: merge-recursive.c:1461 merge-recursive.c:1659 +#: merge-recursive.c:1462 merge-recursive.c:1660 #, c-format msgid "Adding as %s instead" msgstr "" -#: merge-recursive.c:1512 +#: merge-recursive.c:1513 #, c-format msgid "cannot read object %s" msgstr "" -#: merge-recursive.c:1515 +#: merge-recursive.c:1516 #, c-format msgid "object %s is not a blob" msgstr "" -#: merge-recursive.c:1563 +#: merge-recursive.c:1564 msgid "modify" msgstr "" -#: merge-recursive.c:1563 +#: merge-recursive.c:1564 msgid "modified" msgstr "" -#: merge-recursive.c:1573 +#: merge-recursive.c:1574 msgid "content" msgstr "" -#: merge-recursive.c:1580 +#: merge-recursive.c:1581 msgid "add/add" msgstr "" -#: merge-recursive.c:1614 +#: merge-recursive.c:1615 #, c-format msgid "Skipped %s (merged same as existing)" msgstr "" -#: merge-recursive.c:1628 +#: merge-recursive.c:1629 #, c-format msgid "Auto-merging %s" msgstr "" -#: merge-recursive.c:1632 git-submodule.sh:869 +#: merge-recursive.c:1633 git-submodule.sh:869 msgid "submodule" msgstr "" -#: merge-recursive.c:1633 +#: merge-recursive.c:1634 #, c-format msgid "CONFLICT (%s): Merge conflict in %s" msgstr "" -#: merge-recursive.c:1723 +#: merge-recursive.c:1724 #, c-format msgid "Removing %s" msgstr "" -#: merge-recursive.c:1748 +#: merge-recursive.c:1749 msgid "file/directory" msgstr "" -#: merge-recursive.c:1754 +#: merge-recursive.c:1755 msgid "directory/file" msgstr "" -#: merge-recursive.c:1759 +#: merge-recursive.c:1760 #, c-format msgid "CONFLICT (%s): There is a directory with name %s in %s. Adding %s as %s" msgstr "" -#: merge-recursive.c:1769 +#: merge-recursive.c:1770 #, c-format msgid "Adding %s" msgstr "" -#: merge-recursive.c:1786 +#: merge-recursive.c:1787 msgid "Fatal merge failure, shouldn't happen." msgstr "" -#: merge-recursive.c:1805 +#: merge-recursive.c:1806 msgid "Already up-to-date!" msgstr "" -#: merge-recursive.c:1814 +#: merge-recursive.c:1815 #, c-format msgid "merging of trees %s and %s failed" msgstr "" -#: merge-recursive.c:1844 +#: merge-recursive.c:1845 #, c-format msgid "Unprocessed path??? %s" msgstr "" -#: merge-recursive.c:1889 +#: merge-recursive.c:1890 msgid "Merging:" msgstr "" -#: merge-recursive.c:1902 +#: merge-recursive.c:1903 #, c-format msgid "found %u common ancestor:" msgid_plural "found %u common ancestors:" msgstr[0] "" msgstr[1] "" -#: merge-recursive.c:1939 +#: merge-recursive.c:1940 msgid "merge returned no commit" msgstr "" -#: merge-recursive.c:1996 +#: merge-recursive.c:1997 #, c-format msgid "Could not parse object '%s'" msgstr "" -#: merge-recursive.c:2008 builtin/merge.c:696 +#: merge-recursive.c:2009 builtin/merge.c:696 msgid "Unable to write index." msgstr "" @@ -624,239 +684,239 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: sequencer.c:121 builtin/merge.c:864 builtin/merge.c:977 +#: sequencer.c:123 builtin/merge.c:864 builtin/merge.c:977 #: builtin/merge.c:1087 builtin/merge.c:1097 #, c-format msgid "Could not open '%s' for writing" msgstr "" -#: sequencer.c:123 builtin/merge.c:333 builtin/merge.c:867 +#: sequencer.c:125 builtin/merge.c:333 builtin/merge.c:867 #: builtin/merge.c:1089 builtin/merge.c:1102 #, c-format msgid "Could not write to '%s'" msgstr "" -#: sequencer.c:144 +#: sequencer.c:146 msgid "" "after resolving the conflicts, mark the corrected paths\n" "with 'git add ' or 'git rm '" msgstr "" -#: sequencer.c:147 +#: sequencer.c:149 msgid "" "after resolving the conflicts, mark the corrected paths\n" "with 'git add ' or 'git rm '\n" "and commit the result with 'git commit'" msgstr "" -#: sequencer.c:160 sequencer.c:758 sequencer.c:841 +#: sequencer.c:162 sequencer.c:770 sequencer.c:853 #, c-format msgid "Could not write to %s" msgstr "" -#: sequencer.c:163 +#: sequencer.c:165 #, c-format msgid "Error wrapping up %s" msgstr "" -#: sequencer.c:178 +#: sequencer.c:180 msgid "Your local changes would be overwritten by cherry-pick." msgstr "" -#: sequencer.c:180 +#: sequencer.c:182 msgid "Your local changes would be overwritten by revert." msgstr "" -#: sequencer.c:183 +#: sequencer.c:185 msgid "Commit your changes or stash them to proceed." msgstr "" #. TRANSLATORS: %s will be "revert" or "cherry-pick" -#: sequencer.c:233 +#: sequencer.c:235 #, c-format msgid "%s: Unable to write new index file" msgstr "" -#: sequencer.c:261 +#: sequencer.c:266 msgid "Could not resolve HEAD commit\n" msgstr "" -#: sequencer.c:282 +#: sequencer.c:287 msgid "Unable to update cache tree\n" msgstr "" -#: sequencer.c:324 +#: sequencer.c:332 #, c-format msgid "Could not parse commit %s\n" msgstr "" -#: sequencer.c:329 +#: sequencer.c:337 #, c-format msgid "Could not parse parent commit %s\n" msgstr "" -#: sequencer.c:395 +#: sequencer.c:403 msgid "Your index file is unmerged." msgstr "" -#: sequencer.c:398 +#: sequencer.c:406 msgid "You do not have a valid HEAD" msgstr "" -#: sequencer.c:413 +#: sequencer.c:421 #, c-format msgid "Commit %s is a merge but no -m option was given." msgstr "" -#: sequencer.c:421 +#: sequencer.c:429 #, c-format msgid "Commit %s does not have parent %d" msgstr "" -#: sequencer.c:425 +#: sequencer.c:433 #, 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:436 +#: sequencer.c:444 #, c-format msgid "%s: cannot parse parent commit %s" msgstr "" -#: sequencer.c:440 +#: sequencer.c:448 #, c-format msgid "Cannot get commit message for %s" msgstr "" -#: sequencer.c:524 +#: sequencer.c:532 #, c-format msgid "could not revert %s... %s" msgstr "" -#: sequencer.c:525 +#: sequencer.c:533 #, c-format msgid "could not apply %s... %s" msgstr "" -#: sequencer.c:553 +#: sequencer.c:565 msgid "empty commit set passed" msgstr "" -#: sequencer.c:561 +#: sequencer.c:573 #, c-format msgid "git %s: failed to read the index" msgstr "" -#: sequencer.c:566 +#: sequencer.c:578 #, c-format msgid "git %s: failed to refresh the index" msgstr "" -#: sequencer.c:624 +#: sequencer.c:636 #, c-format msgid "Cannot %s during a %s" msgstr "" -#: sequencer.c:646 +#: sequencer.c:658 #, c-format msgid "Could not parse line %d." msgstr "" -#: sequencer.c:651 +#: sequencer.c:663 msgid "No commits parsed." msgstr "" -#: sequencer.c:664 +#: sequencer.c:676 #, c-format msgid "Could not open %s" msgstr "" -#: sequencer.c:668 +#: sequencer.c:680 #, c-format msgid "Could not read %s." msgstr "" -#: sequencer.c:675 +#: sequencer.c:687 #, c-format msgid "Unusable instruction sheet: %s" msgstr "" -#: sequencer.c:703 +#: sequencer.c:715 #, c-format msgid "Invalid key: %s" msgstr "" -#: sequencer.c:706 +#: sequencer.c:718 #, c-format msgid "Invalid value for %s: %s" msgstr "" -#: sequencer.c:718 +#: sequencer.c:730 #, c-format msgid "Malformed options sheet: %s" msgstr "" -#: sequencer.c:739 +#: sequencer.c:751 msgid "a cherry-pick or revert is already in progress" msgstr "" -#: sequencer.c:740 +#: sequencer.c:752 msgid "try \"git cherry-pick (--continue | --quit | --abort)\"" msgstr "" -#: sequencer.c:744 +#: sequencer.c:756 #, c-format msgid "Could not create sequencer directory %s" msgstr "" -#: sequencer.c:760 sequencer.c:845 +#: sequencer.c:772 sequencer.c:857 #, c-format msgid "Error wrapping up %s." msgstr "" -#: sequencer.c:779 sequencer.c:913 +#: sequencer.c:791 sequencer.c:925 msgid "no cherry-pick or revert in progress" msgstr "" -#: sequencer.c:781 +#: sequencer.c:793 msgid "cannot resolve HEAD" msgstr "" -#: sequencer.c:783 +#: sequencer.c:795 msgid "cannot abort from a branch yet to be born" msgstr "" -#: sequencer.c:805 builtin/apply.c:3987 +#: sequencer.c:817 builtin/apply.c:4005 #, c-format msgid "cannot open %s: %s" msgstr "" -#: sequencer.c:808 +#: sequencer.c:820 #, c-format msgid "cannot read %s: %s" msgstr "" -#: sequencer.c:809 +#: sequencer.c:821 msgid "unexpected end of file" msgstr "" -#: sequencer.c:815 +#: sequencer.c:827 #, c-format msgid "stored pre-cherry-pick HEAD file '%s' is corrupt" msgstr "" -#: sequencer.c:838 +#: sequencer.c:850 #, c-format msgid "Could not format %s." msgstr "" -#: sequencer.c:1000 +#: sequencer.c:1012 msgid "Can't revert as initial commit" msgstr "" -#: sequencer.c:1001 +#: sequencer.c:1013 msgid "Can't cherry-pick into empty head" msgstr "" @@ -879,12 +939,17 @@ msgstr "" msgid "Upstream branch '%s' not stored as a remote-tracking branch" msgstr "" -#: wrapper.c:413 +#: wrapper.c:408 +#, c-format +msgid "unable to access '%s': %s" +msgstr "" + +#: wrapper.c:426 #, c-format msgid "unable to look up current user in the passwd file: %s" msgstr "" -#: wrapper.c:414 +#: wrapper.c:427 msgid "no such user" msgstr "" @@ -938,11 +1003,6 @@ msgstr "" msgid " (commit or discard the untracked or modified content in submodules)" msgstr "" -#: wt-status.c:224 -#, c-format -msgid "%s files:" -msgstr "" - #: wt-status.c:227 #, c-format msgid " (use \"git %s ...\" to include in what will be committed)" @@ -1143,11 +1203,11 @@ msgid "Initial commit" msgstr "" #: wt-status.c:1011 -msgid "Untracked" +msgid "Untracked files" msgstr "" #: wt-status.c:1013 -msgid "Ignored" +msgid "Ignored files" msgstr "" #: wt-status.c:1015 @@ -1163,58 +1223,65 @@ msgstr "" msgid "No changes" msgstr "" -#: wt-status.c:1027 +#: wt-status.c:1028 #, c-format -msgid "no changes added to commit%s\n" +msgid "no changes added to commit (use \"git add\" and/or \"git commit -a\")\n" msgstr "" -#: wt-status.c:1029 -msgid " (use \"git add\" and/or \"git commit -a\")" +#: wt-status.c:1031 +#, c-format +msgid "no changes added to commit\n" msgstr "" -#: wt-status.c:1031 +#: wt-status.c:1034 #, c-format -msgid "nothing added to commit but untracked files present%s\n" +msgid "" +"nothing added to commit but untracked files present (use \"git add\" to " +"track)\n" msgstr "" -#: wt-status.c:1033 -msgid " (use \"git add\" to track)" +#: wt-status.c:1037 +#, c-format +msgid "nothing added to commit but untracked files present\n" msgstr "" -#: wt-status.c:1035 wt-status.c:1038 wt-status.c:1041 +#: wt-status.c:1040 #, c-format -msgid "nothing to commit%s\n" +msgid "nothing to commit (create/copy files and use \"git add\" to track)\n" msgstr "" -#: wt-status.c:1036 -msgid " (create/copy files and use \"git add\" to track)" +#: wt-status.c:1043 wt-status.c:1048 +#, c-format +msgid "nothing to commit\n" msgstr "" -#: wt-status.c:1039 -msgid " (use -u to show untracked files)" +#: wt-status.c:1046 +#, c-format +msgid "nothing to commit (use -u to show untracked files)\n" msgstr "" -#: wt-status.c:1042 -msgid " (working directory clean)" +#: wt-status.c:1050 +#, c-format +msgid "nothing to commit, working directory clean\n" msgstr "" -#: wt-status.c:1150 +#: wt-status.c:1158 msgid "HEAD (no branch)" msgstr "" -#: wt-status.c:1156 +#: wt-status.c:1164 msgid "Initial commit on " msgstr "" -#: wt-status.c:1171 +#: wt-status.c:1179 msgid "behind " msgstr "" -#: wt-status.c:1174 wt-status.c:1177 +#: wt-status.c:1182 wt-status.c:1185 msgid "ahead " msgstr "" -#: wt-status.c:1179 +#: wt-status.c:1187 msgid ", behind " msgstr "" @@ -1223,12 +1290,16 @@ msgstr "" msgid "failed to unlink '%s'" msgstr "" +#: builtin/add.c:19 +msgid "git add [options] [--] ..." +msgstr "" + #: builtin/add.c:62 #, c-format msgid "unexpected diff status %c" msgstr "" -#: builtin/add.c:67 builtin/commit.c:229 +#: builtin/add.c:67 builtin/commit.c:230 msgid "updating files failed" msgstr "" @@ -1246,7 +1317,7 @@ msgstr "" msgid "Unstaged changes after refreshing the index:" msgstr "" -#: builtin/add.c:195 builtin/add.c:459 builtin/rm.c:186 +#: builtin/add.c:195 builtin/add.c:460 builtin/rm.c:186 #, c-format msgid "pathspec '%s' did not match any files" msgstr "" @@ -1283,47 +1354,99 @@ msgstr "" msgid "Could not apply '%s'" msgstr "" -#: builtin/add.c:312 +#: builtin/add.c:313 msgid "The following paths are ignored by one of your .gitignore files:\n" msgstr "" -#: builtin/add.c:352 +#: builtin/add.c:319 builtin/clean.c:52 builtin/fetch.c:78 builtin/mv.c:63 +#: builtin/prune-packed.c:76 builtin/push.c:388 builtin/remote.c:1253 +#: builtin/rm.c:133 +msgid "dry run" +msgstr "" + +#: builtin/add.c:320 builtin/apply.c:4354 builtin/commit.c:1154 +#: builtin/count-objects.c:82 builtin/fsck.c:613 builtin/log.c:1477 +#: builtin/mv.c:62 builtin/read-tree.c:112 +msgid "be verbose" +msgstr "" + +#: builtin/add.c:322 +msgid "interactive picking" +msgstr "" + +#: builtin/add.c:323 builtin/checkout.c:1028 builtin/reset.c:248 +msgid "select hunks interactively" +msgstr "" + +#: builtin/add.c:324 +msgid "edit current diff and apply" +msgstr "" + +#: builtin/add.c:325 +msgid "allow adding otherwise ignored files" +msgstr "" + +#: builtin/add.c:326 +msgid "update tracked files" +msgstr "" + +#: builtin/add.c:327 +msgid "record only the fact that the path will be added later" +msgstr "" + +#: builtin/add.c:328 +msgid "add changes from all tracked and untracked files" +msgstr "" + +#: builtin/add.c:329 +msgid "don't add, only refresh the index" +msgstr "" + +#: builtin/add.c:330 +msgid "just skip files which cannot be added because of errors" +msgstr "" + +#: builtin/add.c:331 +msgid "check if - even missing - files are ignored in dry run" +msgstr "" + +#: builtin/add.c:353 #, c-format msgid "Use -f if you really want to add them.\n" msgstr "" -#: builtin/add.c:353 +#: builtin/add.c:354 msgid "no files added" msgstr "" -#: builtin/add.c:359 +#: builtin/add.c:360 msgid "adding files failed" msgstr "" -#: builtin/add.c:391 +#: builtin/add.c:392 msgid "-A and -u are mutually incompatible" msgstr "" -#: builtin/add.c:393 +#: builtin/add.c:394 msgid "Option --ignore-missing can only be used together with --dry-run" msgstr "" -#: builtin/add.c:413 +#: builtin/add.c:414 #, c-format msgid "Nothing specified, nothing added.\n" msgstr "" -#: builtin/add.c:414 +#: builtin/add.c:415 #, c-format msgid "Maybe you wanted to say 'git add .'?\n" msgstr "" -#: builtin/add.c:420 builtin/clean.c:95 builtin/commit.c:289 builtin/mv.c:82 +#: builtin/add.c:421 builtin/clean.c:95 builtin/commit.c:290 builtin/mv.c:82 #: builtin/rm.c:162 msgid "index file corrupt" msgstr "" -#: builtin/add.c:480 builtin/apply.c:4432 builtin/mv.c:229 builtin/rm.c:260 +#: builtin/add.c:481 builtin/apply.c:4450 builtin/mv.c:229 builtin/rm.c:260 msgid "Unable to write new index file" msgstr "" @@ -1376,17 +1499,17 @@ msgstr "" msgid "git apply: bad git-diff - expected /dev/null on line %d" msgstr "" -#: builtin/apply.c:1402 +#: builtin/apply.c:1420 #, c-format msgid "recount: unexpected line: %.*s" msgstr "" -#: builtin/apply.c:1459 +#: builtin/apply.c:1477 #, c-format msgid "patch fragment without header at line %d: %.*s" msgstr "" -#: builtin/apply.c:1476 +#: builtin/apply.c:1494 #, c-format msgid "" "git diff header lacks filename information when removing %d leading pathname " @@ -1397,403 +1520,400 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:1636 +#: builtin/apply.c:1654 msgid "new file depends on old contents" msgstr "" -#: builtin/apply.c:1638 +#: builtin/apply.c:1656 msgid "deleted file still has contents" msgstr "" -#: builtin/apply.c:1664 +#: builtin/apply.c:1682 #, c-format msgid "corrupt patch at line %d" msgstr "" -#: builtin/apply.c:1700 +#: builtin/apply.c:1718 #, c-format msgid "new file %s depends on old contents" msgstr "" -#: builtin/apply.c:1702 +#: builtin/apply.c:1720 #, c-format msgid "deleted file %s still has contents" msgstr "" -#: builtin/apply.c:1705 +#: builtin/apply.c:1723 #, c-format msgid "** warning: file %s becomes empty but is not deleted" msgstr "" -#: builtin/apply.c:1851 +#: builtin/apply.c:1869 #, c-format msgid "corrupt binary patch at line %d: %.*s" msgstr "" #. there has to be one hunk (forward hunk) -#: builtin/apply.c:1880 +#: builtin/apply.c:1898 #, c-format msgid "unrecognized binary patch at line %d" msgstr "" -#: builtin/apply.c:1966 +#: builtin/apply.c:1984 #, c-format msgid "patch with only garbage at line %d" msgstr "" -#: builtin/apply.c:2056 +#: builtin/apply.c:2074 #, c-format msgid "unable to read symlink %s" msgstr "" -#: builtin/apply.c:2060 +#: builtin/apply.c:2078 #, c-format msgid "unable to open or read %s" msgstr "" -#: builtin/apply.c:2131 +#: builtin/apply.c:2149 msgid "oops" msgstr "" -#: builtin/apply.c:2653 +#: builtin/apply.c:2671 #, c-format msgid "invalid start of line: '%c'" msgstr "" -#: builtin/apply.c:2771 +#: builtin/apply.c:2789 #, c-format msgid "Hunk #%d succeeded at %d (offset %d line)." msgid_plural "Hunk #%d succeeded at %d (offset %d lines)." msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:2783 +#: builtin/apply.c:2801 #, c-format msgid "Context reduced to (%ld/%ld) to apply fragment at %d" msgstr "" -#: builtin/apply.c:2789 +#: builtin/apply.c:2807 #, c-format msgid "" "while searching for:\n" "%.*s" msgstr "" -#: builtin/apply.c:2808 +#: builtin/apply.c:2826 #, c-format msgid "missing binary patch data for '%s'" msgstr "" -#: builtin/apply.c:2911 +#: builtin/apply.c:2929 #, c-format msgid "binary patch does not apply to '%s'" msgstr "" -#: builtin/apply.c:2917 +#: builtin/apply.c:2935 #, c-format msgid "binary patch to '%s' creates incorrect result (expecting %s, got %s)" msgstr "" -#: builtin/apply.c:2938 +#: builtin/apply.c:2956 #, c-format msgid "patch failed: %s:%ld" msgstr "" -#: builtin/apply.c:3060 +#: builtin/apply.c:3078 #, c-format msgid "cannot checkout %s" msgstr "" -#: builtin/apply.c:3105 builtin/apply.c:3114 builtin/apply.c:3158 +#: builtin/apply.c:3123 builtin/apply.c:3132 builtin/apply.c:3176 #, c-format msgid "read of %s failed" msgstr "" -#: builtin/apply.c:3138 builtin/apply.c:3360 +#: builtin/apply.c:3156 builtin/apply.c:3378 #, c-format msgid "path %s has been renamed/deleted" msgstr "" -#: builtin/apply.c:3219 builtin/apply.c:3374 +#: builtin/apply.c:3237 builtin/apply.c:3392 #, c-format msgid "%s: does not exist in index" msgstr "" -#: builtin/apply.c:3223 builtin/apply.c:3366 builtin/apply.c:3388 +#: builtin/apply.c:3241 builtin/apply.c:3384 builtin/apply.c:3406 #, c-format msgid "%s: %s" msgstr "" -#: builtin/apply.c:3228 builtin/apply.c:3382 +#: builtin/apply.c:3246 builtin/apply.c:3400 #, c-format msgid "%s: does not match index" msgstr "" -#: builtin/apply.c:3330 +#: builtin/apply.c:3348 msgid "removal patch leaves file contents" msgstr "" -#: builtin/apply.c:3399 +#: builtin/apply.c:3417 #, c-format msgid "%s: wrong type" msgstr "" -#: builtin/apply.c:3401 +#: builtin/apply.c:3419 #, c-format msgid "%s has type %o, expected %o" msgstr "" -#: builtin/apply.c:3502 +#: builtin/apply.c:3520 #, c-format msgid "%s: already exists in index" msgstr "" -#: builtin/apply.c:3505 +#: builtin/apply.c:3523 #, c-format msgid "%s: already exists in working directory" msgstr "" -#: builtin/apply.c:3525 +#: builtin/apply.c:3543 #, c-format msgid "new mode (%o) of %s does not match old mode (%o)" msgstr "" -#: builtin/apply.c:3530 +#: builtin/apply.c:3548 #, c-format msgid "new mode (%o) of %s does not match old mode (%o) of %s" msgstr "" -#: builtin/apply.c:3538 +#: builtin/apply.c:3556 #, c-format msgid "%s: patch does not apply" msgstr "" -#: builtin/apply.c:3551 +#: builtin/apply.c:3569 #, c-format msgid "Checking patch %s..." msgstr "" -#: builtin/apply.c:3606 builtin/checkout.c:213 builtin/reset.c:158 +#: builtin/apply.c:3624 builtin/checkout.c:215 builtin/reset.c:158 #, c-format msgid "make_cache_entry failed for path '%s'" msgstr "" -#: builtin/apply.c:3749 +#: builtin/apply.c:3767 #, c-format msgid "unable to remove %s from index" msgstr "" -#: builtin/apply.c:3777 +#: builtin/apply.c:3795 #, c-format msgid "corrupt patch for subproject %s" msgstr "" -#: builtin/apply.c:3781 +#: builtin/apply.c:3799 #, c-format msgid "unable to stat newly created file '%s'" msgstr "" -#: builtin/apply.c:3786 +#: builtin/apply.c:3804 #, c-format msgid "unable to create backing store for newly created file %s" msgstr "" -#: builtin/apply.c:3789 builtin/apply.c:3897 +#: builtin/apply.c:3807 builtin/apply.c:3915 #, c-format msgid "unable to add cache entry for %s" msgstr "" -#: builtin/apply.c:3822 +#: builtin/apply.c:3840 #, c-format msgid "closing file '%s'" msgstr "" -#: builtin/apply.c:3871 +#: builtin/apply.c:3889 #, c-format msgid "unable to write file '%s' mode %o" msgstr "" -#: builtin/apply.c:3958 +#: builtin/apply.c:3976 #, c-format msgid "Applied patch %s cleanly." msgstr "" -#: builtin/apply.c:3966 +#: builtin/apply.c:3984 msgid "internal error" msgstr "" #. Say this even without --verbose -#: builtin/apply.c:3969 +#: builtin/apply.c:3987 #, c-format msgid "Applying patch %%s with %d reject..." msgid_plural "Applying patch %%s with %d rejects..." msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:3979 +#: builtin/apply.c:3997 #, c-format msgid "truncating .rej filename to %.*s.rej" msgstr "" -#: builtin/apply.c:4000 +#: builtin/apply.c:4018 #, c-format msgid "Hunk #%d applied cleanly." msgstr "" -#: builtin/apply.c:4003 +#: builtin/apply.c:4021 #, c-format msgid "Rejected hunk #%d." msgstr "" -#: builtin/apply.c:4153 +#: builtin/apply.c:4171 msgid "unrecognized input" msgstr "" -#: builtin/apply.c:4164 +#: builtin/apply.c:4182 msgid "unable to read index file" msgstr "" -#: builtin/apply.c:4283 builtin/apply.c:4286 +#: builtin/apply.c:4301 builtin/apply.c:4304 builtin/clone.c:91 +#: builtin/fetch.c:63 msgid "path" msgstr "" -#: builtin/apply.c:4284 +#: builtin/apply.c:4302 msgid "don't apply changes matching the given path" msgstr "" -#: builtin/apply.c:4287 +#: builtin/apply.c:4305 msgid "apply changes matching the given path" msgstr "" -#: builtin/apply.c:4289 +#: builtin/apply.c:4307 msgid "num" msgstr "" -#: builtin/apply.c:4290 +#: builtin/apply.c:4308 msgid "remove leading slashes from traditional diff paths" msgstr "" -#: builtin/apply.c:4293 +#: builtin/apply.c:4311 msgid "ignore additions made by the patch" msgstr "" -#: builtin/apply.c:4295 +#: builtin/apply.c:4313 msgid "instead of applying the patch, output diffstat for the input" msgstr "" -#: builtin/apply.c:4299 -msgid "shows number of added and deleted lines in decimal notation" +#: builtin/apply.c:4317 +msgid "show number of added and deleted lines in decimal notation" msgstr "" -#: builtin/apply.c:4301 +#: builtin/apply.c:4319 msgid "instead of applying the patch, output a summary for the input" msgstr "" -#: builtin/apply.c:4303 +#: builtin/apply.c:4321 msgid "instead of applying the patch, see if the patch is applicable" msgstr "" -#: builtin/apply.c:4305 +#: builtin/apply.c:4323 msgid "make sure the patch is applicable to the current index" msgstr "" -#: builtin/apply.c:4307 +#: builtin/apply.c:4325 msgid "apply a patch without touching the working tree" msgstr "" -#: builtin/apply.c:4309 +#: builtin/apply.c:4327 msgid "also apply the patch (use with --stat/--summary/--check)" msgstr "" -#: builtin/apply.c:4311 +#: builtin/apply.c:4329 msgid "attempt three-way merge if a patch does not apply" msgstr "" -#: builtin/apply.c:4313 +#: builtin/apply.c:4331 msgid "build a temporary index based on embedded index information" msgstr "" -#: builtin/apply.c:4315 +#: builtin/apply.c:4333 builtin/checkout-index.c:197 builtin/ls-files.c:460 msgid "paths are separated with NUL character" msgstr "" -#: builtin/apply.c:4318 +#: builtin/apply.c:4336 msgid "ensure at least lines of context match" msgstr "" -#: builtin/apply.c:4319 +#: builtin/apply.c:4337 msgid "action" msgstr "" -#: builtin/apply.c:4320 +#: builtin/apply.c:4338 msgid "detect new or modified lines that have whitespace errors" msgstr "" -#: builtin/apply.c:4323 builtin/apply.c:4326 +#: builtin/apply.c:4341 builtin/apply.c:4344 msgid "ignore changes in whitespace when finding context" msgstr "" -#: builtin/apply.c:4329 +#: builtin/apply.c:4347 msgid "apply the patch in reverse" msgstr "" -#: builtin/apply.c:4331 +#: builtin/apply.c:4349 msgid "don't expect at least one line of context" msgstr "" -#: builtin/apply.c:4333 +#: builtin/apply.c:4351 msgid "leave the rejected hunks in corresponding *.rej files" msgstr "" -#: builtin/apply.c:4335 +#: builtin/apply.c:4353 msgid "allow overlapping hunks" msgstr "" -#: builtin/apply.c:4336 -msgid "be verbose" -msgstr "" - -#: builtin/apply.c:4338 +#: builtin/apply.c:4356 msgid "tolerate incorrectly detected missing new-line at the end of file" msgstr "" -#: builtin/apply.c:4341 +#: builtin/apply.c:4359 msgid "do not trust the line counts in the hunk headers" msgstr "" -#: builtin/apply.c:4343 +#: builtin/apply.c:4361 msgid "root" msgstr "" -#: builtin/apply.c:4344 +#: builtin/apply.c:4362 msgid "prepend to all filenames" msgstr "" -#: builtin/apply.c:4366 +#: builtin/apply.c:4384 msgid "--3way outside a repository" msgstr "" -#: builtin/apply.c:4374 +#: builtin/apply.c:4392 msgid "--index outside a repository" msgstr "" -#: builtin/apply.c:4377 +#: builtin/apply.c:4395 msgid "--cached outside a repository" msgstr "" -#: builtin/apply.c:4393 +#: builtin/apply.c:4411 #, c-format msgid "can't open patch '%s'" msgstr "" -#: builtin/apply.c:4407 +#: builtin/apply.c:4425 #, c-format msgid "squelched %d whitespace error" msgid_plural "squelched %d whitespace errors" msgstr[0] "" msgstr[1] "" -#: builtin/apply.c:4413 builtin/apply.c:4423 +#: builtin/apply.c:4431 builtin/apply.c:4441 #, c-format msgid "%d line adds whitespace errors." msgid_plural "%d lines add whitespace errors." @@ -1835,2883 +1955,5816 @@ msgstr "" msgid "git archive: expected a flush" msgstr "" -#: builtin/branch.c:144 +#: builtin/bisect--helper.c:7 +msgid "git bisect--helper --next-all [--no-checkout]" +msgstr "" + +#: builtin/bisect--helper.c:17 +msgid "perform 'git bisect next'" +msgstr "" + +#: builtin/bisect--helper.c:19 +msgid "update BISECT_HEAD instead of checking out the current commit" +msgstr "" + +#: builtin/blame.c:25 +msgid "git blame [options] [rev-opts] [rev] [--] file" +msgstr "" + +#: builtin/blame.c:30 builtin/shortlog.c:15 +msgid "[rev-opts] are documented in git-rev-list(1)" +msgstr "" + +#: builtin/blame.c:2373 +msgid "Show blame entries as we find them, incrementally" +msgstr "" + +#: builtin/blame.c:2374 +msgid "Show blank SHA-1 for boundary commits (Default: off)" +msgstr "" + +#: builtin/blame.c:2375 +msgid "Do not treat root commits as boundaries (Default: off)" +msgstr "" + +#: builtin/blame.c:2376 +msgid "Show work cost statistics" +msgstr "" + +#: builtin/blame.c:2377 +msgid "Show output score for blame entries" +msgstr "" + +#: builtin/blame.c:2378 +msgid "Show original filename (Default: auto)" +msgstr "" + +#: builtin/blame.c:2379 +msgid "Show original linenumber (Default: off)" +msgstr "" + +#: builtin/blame.c:2380 +msgid "Show in a format designed for machine consumption" +msgstr "" + +#: builtin/blame.c:2381 +msgid "Show porcelain format with per-line commit information" +msgstr "" + +#: builtin/blame.c:2382 +msgid "Use the same output mode as git-annotate (Default: off)" +msgstr "" + +#: builtin/blame.c:2383 +msgid "Show raw timestamp (Default: off)" +msgstr "" + +#: builtin/blame.c:2384 +msgid "Show long commit SHA1 (Default: off)" +msgstr "" + +#: builtin/blame.c:2385 +msgid "Suppress author name and timestamp (Default: off)" +msgstr "" + +#: builtin/blame.c:2386 +msgid "Show author email instead of name (Default: off)" +msgstr "" + +#: builtin/blame.c:2387 +msgid "Ignore whitespace differences" +msgstr "" + +#: builtin/blame.c:2388 +msgid "Spend extra cycles to find better match" +msgstr "" + +#: builtin/blame.c:2389 +msgid "Use revisions from instead of calling git-rev-list" +msgstr "" + +#: builtin/blame.c:2390 +msgid "Use 's contents as the final image" +msgstr "" + +#: builtin/blame.c:2391 builtin/blame.c:2392 +msgid "score" +msgstr "" + +#: builtin/blame.c:2391 +msgid "Find line copies within and across files" +msgstr "" + +#: builtin/blame.c:2392 +msgid "Find line movements within and across files" +msgstr "" + +#: builtin/blame.c:2393 +msgid "n,m" +msgstr "" + +#: builtin/blame.c:2393 +msgid "Process only line range n,m, counting from 1" +msgstr "" + +#: builtin/branch.c:23 +msgid "git branch [options] [-r | -a] [--merged | --no-merged]" +msgstr "" + +#: builtin/branch.c:24 +msgid "git branch [options] [-l] [-f] []" +msgstr "" + +#: builtin/branch.c:25 +msgid "git branch [options] [-r] (-d | -D) ..." +msgstr "" + +#: builtin/branch.c:26 +msgid "git branch [options] (-m | -M) [] " +msgstr "" + +#: builtin/branch.c:145 #, c-format msgid "" "deleting branch '%s' that has been merged to\n" " '%s', but not yet merged to HEAD." msgstr "" -#: builtin/branch.c:148 +#: builtin/branch.c:149 #, c-format msgid "" "not deleting branch '%s' that is not yet merged to\n" " '%s', even though it is merged to HEAD." msgstr "" -#: builtin/branch.c:180 +#: builtin/branch.c:181 msgid "cannot use -a with -d" msgstr "" -#: builtin/branch.c:186 +#: builtin/branch.c:187 msgid "Couldn't look up commit object for HEAD" msgstr "" -#: builtin/branch.c:191 +#: builtin/branch.c:192 #, c-format msgid "Cannot delete the branch '%s' which you are currently on." msgstr "" -#: builtin/branch.c:202 +#: builtin/branch.c:203 #, c-format msgid "remote branch '%s' not found." msgstr "" -#: builtin/branch.c:203 +#: builtin/branch.c:204 #, c-format msgid "branch '%s' not found." msgstr "" -#: builtin/branch.c:210 +#: builtin/branch.c:211 #, c-format msgid "Couldn't look up commit object for '%s'" msgstr "" -#: builtin/branch.c:216 +#: builtin/branch.c:217 #, c-format msgid "" "The branch '%s' is not fully merged.\n" "If you are sure you want to delete it, run 'git branch -D %s'." msgstr "" -#: builtin/branch.c:225 +#: builtin/branch.c:226 #, c-format msgid "Error deleting remote branch '%s'" msgstr "" -#: builtin/branch.c:226 +#: builtin/branch.c:227 #, c-format msgid "Error deleting branch '%s'" msgstr "" -#: builtin/branch.c:233 +#: builtin/branch.c:234 #, c-format msgid "Deleted remote branch %s (was %s).\n" msgstr "" -#: builtin/branch.c:234 +#: builtin/branch.c:235 #, c-format msgid "Deleted branch %s (was %s).\n" msgstr "" -#: builtin/branch.c:239 +#: builtin/branch.c:240 msgid "Update of config-file failed" msgstr "" -#: builtin/branch.c:337 +#: builtin/branch.c:338 #, c-format msgid "branch '%s' does not point at a commit" msgstr "" -#: builtin/branch.c:409 +#: builtin/branch.c:410 #, c-format msgid "[%s: behind %d]" msgstr "" -#: builtin/branch.c:411 +#: builtin/branch.c:412 #, c-format msgid "[behind %d]" msgstr "" -#: builtin/branch.c:415 +#: builtin/branch.c:416 #, c-format msgid "[%s: ahead %d]" msgstr "" -#: builtin/branch.c:417 +#: builtin/branch.c:418 #, c-format msgid "[ahead %d]" msgstr "" -#: builtin/branch.c:420 +#: builtin/branch.c:421 #, c-format msgid "[%s: ahead %d, behind %d]" msgstr "" -#: builtin/branch.c:423 +#: builtin/branch.c:424 #, c-format msgid "[ahead %d, behind %d]" msgstr "" -#: builtin/branch.c:535 +#: builtin/branch.c:537 msgid "(no branch)" msgstr "" -#: builtin/branch.c:600 +#: builtin/branch.c:602 msgid "some refs could not be read" msgstr "" -#: builtin/branch.c:613 +#: builtin/branch.c:615 msgid "cannot rename the current branch while not on any." msgstr "" -#: builtin/branch.c:623 +#: builtin/branch.c:625 #, c-format msgid "Invalid branch name: '%s'" msgstr "" -#: builtin/branch.c:638 +#: builtin/branch.c:640 msgid "Branch rename failed" msgstr "" -#: builtin/branch.c:642 +#: builtin/branch.c:644 #, c-format msgid "Renamed a misnamed branch '%s' away" msgstr "" -#: builtin/branch.c:646 +#: builtin/branch.c:648 #, c-format msgid "Branch renamed to %s, but HEAD is not updated!" msgstr "" -#: builtin/branch.c:653 +#: builtin/branch.c:655 msgid "Branch is renamed, but update of config-file failed" msgstr "" -#: builtin/branch.c:668 +#: builtin/branch.c:670 #, c-format msgid "malformed object name %s" msgstr "" -#: builtin/branch.c:692 +#: builtin/branch.c:694 #, c-format msgid "could not write branch description template: %s" msgstr "" -#: builtin/branch.c:783 -msgid "Failed to resolve HEAD as a valid ref." +#: builtin/branch.c:724 +msgid "Generic options" msgstr "" -#: builtin/branch.c:788 builtin/clone.c:561 -msgid "HEAD not found below refs/heads!" +#: builtin/branch.c:726 +msgid "show hash and subject, give twice for upstream branch" msgstr "" -#: builtin/branch.c:808 -msgid "--column and --verbose are incompatible" +#: builtin/branch.c:727 +msgid "suppress informational messages" msgstr "" -#: builtin/branch.c:857 -msgid "-a and -r options to 'git branch' do not make sense with a branch name" +#: builtin/branch.c:728 +msgid "set up tracking mode (see git-pull(1))" msgstr "" -#: builtin/bundle.c:47 -#, c-format -msgid "%s is okay\n" +#: builtin/branch.c:730 +msgid "change upstream info" msgstr "" -#: builtin/bundle.c:56 -msgid "Need a repository to create a bundle." +#: builtin/branch.c:734 +msgid "use colored output" msgstr "" -#: builtin/bundle.c:60 -msgid "Need a repository to unbundle." +#: builtin/branch.c:735 +msgid "act on remote-tracking branches" msgstr "" -#: builtin/checkout.c:114 builtin/checkout.c:147 -#, c-format -msgid "path '%s' does not have our version" +#: builtin/branch.c:738 builtin/branch.c:744 builtin/branch.c:765 +#: builtin/branch.c:771 builtin/commit.c:1362 builtin/commit.c:1363 +#: builtin/commit.c:1364 builtin/commit.c:1365 builtin/tag.c:470 +msgid "commit" msgstr "" -#: builtin/checkout.c:116 builtin/checkout.c:149 -#, c-format -msgid "path '%s' does not have their version" +#: builtin/branch.c:739 builtin/branch.c:745 +msgid "print only branches that contain the commit" msgstr "" -#: builtin/checkout.c:132 -#, c-format -msgid "path '%s' does not have all necessary versions" +#: builtin/branch.c:751 +msgid "Specific git-branch actions:" msgstr "" -#: builtin/checkout.c:176 -#, c-format -msgid "path '%s' does not have necessary versions" +#: builtin/branch.c:752 +msgid "list both remote-tracking and local branches" msgstr "" -#: builtin/checkout.c:193 -#, c-format -msgid "path '%s': cannot merge" +#: builtin/branch.c:754 +msgid "delete fully merged branch" msgstr "" -#: builtin/checkout.c:210 -#, c-format -msgid "Unable to add merge result for '%s'" +#: builtin/branch.c:755 +msgid "delete branch (even if not merged)" msgstr "" -#: builtin/checkout.c:235 builtin/checkout.c:392 -msgid "corrupt index file" +#: builtin/branch.c:756 +msgid "move/rename a branch and its reflog" msgstr "" -#: builtin/checkout.c:265 builtin/checkout.c:272 -#, c-format -msgid "path '%s' is unmerged" +#: builtin/branch.c:757 +msgid "move/rename a branch, even if target exists" msgstr "" -#: builtin/checkout.c:303 builtin/checkout.c:498 builtin/clone.c:586 -#: builtin/merge.c:811 -msgid "unable to write new index file" +#: builtin/branch.c:758 +msgid "list branch names" msgstr "" -#: builtin/checkout.c:414 -msgid "you need to resolve your current index first" +#: builtin/branch.c:759 +msgid "create the branch's reflog" msgstr "" -#: builtin/checkout.c:533 -#, c-format -msgid "Can not do reflog for '%s'\n" +#: builtin/branch.c:761 +msgid "edit the description for the branch" msgstr "" -#: builtin/checkout.c:566 -msgid "HEAD is now at" +#: builtin/branch.c:762 +msgid "force creation (when already exists)" msgstr "" -#: builtin/checkout.c:573 -#, c-format -msgid "Reset branch '%s'\n" +#: builtin/branch.c:765 +msgid "print only not merged branches" msgstr "" -#: builtin/checkout.c:576 -#, c-format -msgid "Already on '%s'\n" +#: builtin/branch.c:771 +msgid "print only merged branches" msgstr "" -#: builtin/checkout.c:580 -#, c-format -msgid "Switched to and reset branch '%s'\n" +#: builtin/branch.c:775 +msgid "list branches in columns" msgstr "" -#: builtin/checkout.c:582 -#, c-format -msgid "Switched to a new branch '%s'\n" +#: builtin/branch.c:788 +msgid "Failed to resolve HEAD as a valid ref." msgstr "" -#: builtin/checkout.c:584 -#, c-format -msgid "Switched to branch '%s'\n" +#: builtin/branch.c:793 builtin/clone.c:561 +msgid "HEAD not found below refs/heads!" +msgstr "" + +#: builtin/branch.c:813 +msgid "--column and --verbose are incompatible" msgstr "" -#: builtin/checkout.c:640 +#: builtin/branch.c:864 #, c-format -msgid " ... and %d more.\n" +msgid "branch '%s' does not exist" msgstr "" -#. The singular version -#: builtin/checkout.c:646 +#: builtin/branch.c:876 #, c-format -msgid "" -"Warning: you are leaving %d commit behind, not connected to\n" -"any of your branches:\n" -"\n" -"%s\n" -msgid_plural "" -"Warning: you are leaving %d commits behind, not connected to\n" -"any of your branches:\n" -"\n" -"%s\n" -msgstr[0] "" -msgstr[1] "" +msgid "Branch '%s' has no upstream information" +msgstr "" + +#: builtin/branch.c:891 +msgid "-a and -r options to 'git branch' do not make sense with a branch name" +msgstr "" -#: builtin/checkout.c:664 +#: builtin/branch.c:894 +#, c-format +msgid "" +"The --set-upstream flag is deprecated and will be removed. Consider using --" +"track or --set-upstream-to\n" +msgstr "" + +#: builtin/branch.c:911 #, c-format msgid "" -"If you want to keep them by creating a new branch, this may be a good time\n" -"to do so with:\n" "\n" -" git branch new_branch_name %s\n" +"If you wanted to make '%s' track '%s', do this:\n" "\n" msgstr "" -#: builtin/checkout.c:694 -msgid "internal error in revision walk" +#: builtin/branch.c:912 +#, c-format +msgid " git branch -d %s\n" msgstr "" -#: builtin/checkout.c:698 -msgid "Previous HEAD position was" +#: builtin/branch.c:913 +#, c-format +msgid " git branch --set-upstream-to %s\n" msgstr "" -#: builtin/checkout.c:724 builtin/checkout.c:919 -msgid "You are on a branch yet to be born" +#: builtin/bundle.c:47 +#, c-format +msgid "%s is okay\n" msgstr "" -#. case (1) -#: builtin/checkout.c:855 -#, c-format -msgid "invalid reference: %s" +#: builtin/bundle.c:56 +msgid "Need a repository to create a bundle." msgstr "" -#. case (1): want a tree -#: builtin/checkout.c:894 -#, c-format -msgid "reference is not a tree: %s" +#: builtin/bundle.c:60 +msgid "Need a repository to unbundle." msgstr "" -#: builtin/checkout.c:976 -msgid "-B cannot be used with -b" +#: builtin/cat-file.c:247 +msgid "git cat-file (-t|-s|-e|-p||--textconv) " msgstr "" -#: builtin/checkout.c:985 -msgid "--patch is incompatible with all other options" +#: builtin/cat-file.c:248 +msgid "git cat-file (--batch|--batch-check) < " msgstr "" -#: builtin/checkout.c:988 -msgid "--detach cannot be used with -b/-B/--orphan" +#: builtin/cat-file.c:266 +msgid " can be one of: blob, tree, commit, tag" msgstr "" -#: builtin/checkout.c:990 -msgid "--detach cannot be used with -t" +#: builtin/cat-file.c:267 +msgid "show object type" msgstr "" -#: builtin/checkout.c:996 -msgid "--track needs a branch name" +#: builtin/cat-file.c:268 +msgid "show object size" msgstr "" -#: builtin/checkout.c:1003 -msgid "Missing branch name; try -b" +#: builtin/cat-file.c:270 +msgid "exit with zero when there's no error" msgstr "" -#: builtin/checkout.c:1009 -msgid "--orphan and -b|-B are mutually exclusive" +#: builtin/cat-file.c:271 +msgid "pretty-print object's content" msgstr "" -#: builtin/checkout.c:1011 -msgid "--orphan cannot be used with -t" +#: builtin/cat-file.c:273 +msgid "for blob objects, run textconv on object's content" msgstr "" -#: builtin/checkout.c:1021 -msgid "git checkout: -f and -m are incompatible" +#: builtin/cat-file.c:275 +msgid "show info and content of objects fed from the standard input" msgstr "" -#: builtin/checkout.c:1055 -msgid "invalid path specification" +#: builtin/cat-file.c:278 +msgid "show info about objects fed from the standard input" msgstr "" -#: builtin/checkout.c:1063 -#, c-format -msgid "" -"git checkout: updating paths is incompatible with switching branches.\n" -"Did you intend to checkout '%s' which can not be resolved as commit?" +#: builtin/check-attr.c:11 +msgid "git check-attr [-a | --all | attr...] [--] pathname..." msgstr "" -#: builtin/checkout.c:1065 -msgid "git checkout: updating paths is incompatible with switching branches." +#: builtin/check-attr.c:12 +msgid "git check-attr --stdin [-z] [-a | --all | attr...] < " msgstr "" -#: builtin/checkout.c:1070 -msgid "git checkout: --detach does not take a path argument" +#: builtin/check-attr.c:19 +msgid "report all attributes set on file" msgstr "" -#: builtin/checkout.c:1073 -msgid "" -"git checkout: --ours/--theirs, --force and --merge are incompatible when\n" -"checking out of the index." +#: builtin/check-attr.c:20 +msgid "use .gitattributes only from the index" msgstr "" -#: builtin/checkout.c:1092 -msgid "Cannot switch branch to a non-commit." +#: builtin/check-attr.c:21 builtin/hash-object.c:75 +msgid "read file names from stdin" msgstr "" -#: builtin/checkout.c:1095 -msgid "--ours/--theirs is incompatible with switching branches." +#: builtin/check-attr.c:23 +msgid "input paths are terminated by a null character" msgstr "" -#: builtin/clean.c:78 -msgid "-x and -X cannot be used together" +#: builtin/checkout-index.c:126 +msgid "git checkout-index [options] [--] [...]" msgstr "" -#: builtin/clean.c:82 -msgid "" -"clean.requireForce set to true and neither -n nor -f given; refusing to clean" +#: builtin/checkout-index.c:187 +msgid "check out all files in the index" msgstr "" -#: builtin/clean.c:85 -msgid "" -"clean.requireForce defaults to true and neither -n nor -f given; refusing to " -"clean" +#: builtin/checkout-index.c:188 +msgid "force overwrite of existing files" msgstr "" -#: builtin/clean.c:155 builtin/clean.c:176 -#, c-format -msgid "Would remove %s\n" +#: builtin/checkout-index.c:190 +msgid "no warning for existing files and files not in index" msgstr "" -#: builtin/clean.c:159 builtin/clean.c:179 -#, c-format -msgid "Removing %s\n" +#: builtin/checkout-index.c:192 +msgid "don't checkout new files" msgstr "" -#: builtin/clean.c:162 builtin/clean.c:182 -#, c-format -msgid "failed to remove %s" +#: builtin/checkout-index.c:194 +msgid "update stat information in the index file" msgstr "" -#: builtin/clean.c:166 -#, c-format -msgid "Would not remove %s\n" +#: builtin/checkout-index.c:200 +msgid "read list of paths from the standard input" msgstr "" -#: builtin/clean.c:168 -#, c-format -msgid "Not removing %s\n" +#: builtin/checkout-index.c:202 +msgid "write the content to temporary files" msgstr "" -#: builtin/clone.c:243 -#, c-format -msgid "reference repository '%s' is not a local directory." +#: builtin/checkout-index.c:203 builtin/column.c:30 +msgid "string" msgstr "" -#: builtin/clone.c:306 -#, c-format -msgid "failed to create directory '%s'" +#: builtin/checkout-index.c:204 +msgid "when creating files, prepend " msgstr "" -#: builtin/clone.c:308 builtin/diff.c:77 -#, c-format -msgid "failed to stat '%s'" +#: builtin/checkout-index.c:207 +msgid "copy out the files from named stage" msgstr "" -#: builtin/clone.c:310 -#, c-format -msgid "%s exists and is not a directory" +#: builtin/checkout.c:25 +msgid "git checkout [options] " msgstr "" -#: builtin/clone.c:324 -#, c-format -msgid "failed to stat %s\n" +#: builtin/checkout.c:26 +msgid "git checkout [options] [] -- ..." msgstr "" -#: builtin/clone.c:346 +#: builtin/checkout.c:116 builtin/checkout.c:149 #, c-format -msgid "failed to create link '%s'" +msgid "path '%s' does not have our version" msgstr "" -#: builtin/clone.c:350 +#: builtin/checkout.c:118 builtin/checkout.c:151 #, c-format -msgid "failed to copy file to '%s'" +msgid "path '%s' does not have their version" msgstr "" -#: builtin/clone.c:373 +#: builtin/checkout.c:134 #, c-format -msgid "done.\n" +msgid "path '%s' does not have all necessary versions" msgstr "" -#: builtin/clone.c:443 +#: builtin/checkout.c:178 #, c-format -msgid "Could not find remote branch %s to clone." +msgid "path '%s' does not have necessary versions" msgstr "" -#: builtin/clone.c:552 -msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n" +#: builtin/checkout.c:195 +#, c-format +msgid "path '%s': cannot merge" msgstr "" -#: builtin/clone.c:642 -msgid "Too many arguments." +#: builtin/checkout.c:212 +#, c-format +msgid "Unable to add merge result for '%s'" msgstr "" -#: builtin/clone.c:646 -msgid "You must specify a repository to clone." +#: builtin/checkout.c:236 builtin/checkout.c:239 builtin/checkout.c:242 +#: builtin/checkout.c:245 +#, c-format +msgid "'%s' cannot be used with updating paths" msgstr "" -#: builtin/clone.c:657 +#: builtin/checkout.c:248 builtin/checkout.c:251 #, c-format -msgid "--bare and --origin %s options are incompatible." +msgid "'%s' cannot be used with %s" msgstr "" -#: builtin/clone.c:671 +#: builtin/checkout.c:254 #, c-format -msgid "repository '%s' does not exist" +msgid "Cannot update paths and switch to branch '%s' at the same time." msgstr "" -#: builtin/clone.c:676 -msgid "--depth is ignored in local clones; use file:// instead." +#: builtin/checkout.c:265 builtin/checkout.c:426 +msgid "corrupt index file" msgstr "" -#: builtin/clone.c:686 +#: builtin/checkout.c:295 builtin/checkout.c:302 #, c-format -msgid "destination path '%s' already exists and is not an empty directory." +msgid "path '%s' is unmerged" msgstr "" -#: builtin/clone.c:696 -#, c-format -msgid "working tree '%s' already exists." +#: builtin/checkout.c:333 builtin/checkout.c:534 builtin/clone.c:586 +#: builtin/merge.c:811 +msgid "unable to write new index file" msgstr "" -#: builtin/clone.c:709 builtin/clone.c:723 -#, c-format -msgid "could not create leading directories of '%s'" +#: builtin/checkout.c:448 +msgid "you need to resolve your current index first" msgstr "" -#: builtin/clone.c:712 +#: builtin/checkout.c:569 #, c-format -msgid "could not create work tree dir '%s'." +msgid "Can not do reflog for '%s'\n" +msgstr "" + +#: builtin/checkout.c:602 +msgid "HEAD is now at" msgstr "" -#: builtin/clone.c:731 +#: builtin/checkout.c:609 #, c-format -msgid "Cloning into bare repository '%s'...\n" +msgid "Reset branch '%s'\n" msgstr "" -#: builtin/clone.c:733 +#: builtin/checkout.c:612 #, c-format -msgid "Cloning into '%s'...\n" +msgid "Already on '%s'\n" msgstr "" -#: builtin/clone.c:789 +#: builtin/checkout.c:616 #, c-format -msgid "Don't know how to clone %s" +msgid "Switched to and reset branch '%s'\n" msgstr "" -#: builtin/clone.c:838 +#: builtin/checkout.c:618 #, c-format -msgid "Remote branch %s not found in upstream %s" +msgid "Switched to a new branch '%s'\n" msgstr "" -#: builtin/clone.c:845 -msgid "You appear to have cloned an empty repository." +#: builtin/checkout.c:620 +#, c-format +msgid "Switched to branch '%s'\n" msgstr "" -#: builtin/column.c:51 -msgid "--command must be the first argument" +#: builtin/checkout.c:676 +#, c-format +msgid " ... and %d more.\n" msgstr "" -#: builtin/commit.c:43 +#. The singular version +#: builtin/checkout.c:682 +#, c-format msgid "" -"Your name and email address were configured automatically based\n" -"on your username and hostname. Please check that they are accurate.\n" -"You can suppress this message by setting them explicitly:\n" -"\n" -" git config --global user.name \"Your Name\"\n" -" git config --global user.email you@example.com\n" +"Warning: you are leaving %d commit behind, not connected to\n" +"any of your branches:\n" "\n" -"After doing this, you may fix the identity used for this commit with:\n" +"%s\n" +msgid_plural "" +"Warning: you are leaving %d commits behind, not connected to\n" +"any of your branches:\n" "\n" -" git commit --amend --reset-author\n" -msgstr "" - -#: builtin/commit.c:55 -msgid "" -"You asked to amend the most recent commit, but doing so would make\n" -"it empty. You can repeat your command with --allow-empty, or you can\n" -"remove the commit entirely with \"git reset HEAD^\".\n" -msgstr "" +"%s\n" +msgstr[0] "" +msgstr[1] "" -#: builtin/commit.c:60 +#: builtin/checkout.c:700 +#, c-format msgid "" -"The previous cherry-pick is now empty, possibly due to conflict resolution.\n" -"If you wish to commit it anyway, use:\n" +"If you want to keep them by creating a new branch, this may be a good time\n" +"to do so with:\n" "\n" -" git commit --allow-empty\n" +" git branch new_branch_name %s\n" "\n" -"Otherwise, please use 'git reset'\n" msgstr "" -#: builtin/commit.c:256 -msgid "failed to unpack HEAD tree object" +#: builtin/checkout.c:730 +msgid "internal error in revision walk" msgstr "" -#: builtin/commit.c:298 -msgid "unable to create temporary index" +#: builtin/checkout.c:734 +msgid "Previous HEAD position was" msgstr "" -#: builtin/commit.c:304 -msgid "interactive add failed" +#: builtin/checkout.c:761 builtin/checkout.c:950 +msgid "You are on a branch yet to be born" msgstr "" -#: builtin/commit.c:337 builtin/commit.c:358 builtin/commit.c:408 -msgid "unable to write new_index file" +#. case (1) +#: builtin/checkout.c:886 +#, c-format +msgid "invalid reference: %s" msgstr "" -#: builtin/commit.c:389 -msgid "cannot do a partial commit during a merge." +#. case (1): want a tree +#: builtin/checkout.c:925 +#, c-format +msgid "reference is not a tree: %s" msgstr "" -#: builtin/commit.c:391 -msgid "cannot do a partial commit during a cherry-pick." +#: builtin/checkout.c:961 +msgid "paths cannot be used with switching branches" msgstr "" -#: builtin/commit.c:401 -msgid "cannot read the index" +#: builtin/checkout.c:964 builtin/checkout.c:968 +#, c-format +msgid "'%s' cannot be used with switching branches" msgstr "" -#: builtin/commit.c:421 -msgid "unable to write temporary index file" +#: builtin/checkout.c:972 builtin/checkout.c:975 builtin/checkout.c:980 +#: builtin/checkout.c:983 +#, c-format +msgid "'%s' cannot be used with '%s'" msgstr "" -#: builtin/commit.c:496 builtin/commit.c:502 +#: builtin/checkout.c:988 #, c-format -msgid "invalid commit: %s" +msgid "Cannot switch branch to a non-commit '%s'" msgstr "" -#: builtin/commit.c:525 -msgid "malformed --author parameter" +#: builtin/checkout.c:1009 builtin/gc.c:177 +msgid "suppress progress reporting" msgstr "" -#: builtin/commit.c:585 -#, c-format -msgid "Malformed ident string: '%s'" +#: builtin/checkout.c:1010 builtin/checkout.c:1012 builtin/clone.c:89 +#: builtin/remote.c:169 builtin/remote.c:171 +msgid "branch" msgstr "" -#: builtin/commit.c:623 builtin/commit.c:656 builtin/commit.c:970 -#, c-format -msgid "could not lookup commit %s" +#: builtin/checkout.c:1011 +msgid "create and checkout a new branch" msgstr "" -#: builtin/commit.c:635 builtin/shortlog.c:296 -#, c-format -msgid "(reading log message from standard input)\n" +#: builtin/checkout.c:1013 +msgid "create/reset and checkout a branch" msgstr "" -#: builtin/commit.c:637 -msgid "could not read log from standard input" +#: builtin/checkout.c:1014 +msgid "create reflog for new branch" msgstr "" -#: builtin/commit.c:641 -#, c-format -msgid "could not read log file '%s'" +#: builtin/checkout.c:1015 +msgid "detach the HEAD at named commit" msgstr "" -#: builtin/commit.c:647 -msgid "commit has empty message" +#: builtin/checkout.c:1016 +msgid "set upstream info for new branch" msgstr "" -#: builtin/commit.c:663 -msgid "could not read MERGE_MSG" +#: builtin/checkout.c:1018 +msgid "new branch" msgstr "" -#: builtin/commit.c:667 -msgid "could not read SQUASH_MSG" +#: builtin/checkout.c:1018 +msgid "new unparented branch" msgstr "" -#: builtin/commit.c:671 -#, c-format -msgid "could not read '%s'" +#: builtin/checkout.c:1019 +msgid "checkout our version for unmerged files" msgstr "" -#: builtin/commit.c:723 -msgid "could not write commit template" +#: builtin/checkout.c:1021 +msgid "checkout their version for unmerged files" msgstr "" -#: builtin/commit.c:734 -#, c-format -msgid "" -"\n" -"It looks like you may be committing a merge.\n" -"If this is not correct, please remove the file\n" -"\t%s\n" -"and try again.\n" +#: builtin/checkout.c:1023 +msgid "force checkout (throw away local modifications)" msgstr "" -#: builtin/commit.c:739 -#, c-format -msgid "" -"\n" -"It looks like you may be committing a cherry-pick.\n" -"If this is not correct, please remove the file\n" -"\t%s\n" -"and try again.\n" +#: builtin/checkout.c:1024 +msgid "perform a 3-way merge with the new branch" msgstr "" -#: builtin/commit.c:751 -msgid "" -"Please enter the commit message for your changes. Lines starting\n" -"with '#' will be ignored, and an empty message aborts the commit.\n" +#: builtin/checkout.c:1025 builtin/merge.c:215 +msgid "update ignored files (default)" msgstr "" -#: builtin/commit.c:756 -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" +#: builtin/checkout.c:1026 builtin/log.c:1111 parse-options.h:241 +msgid "style" msgstr "" -#: builtin/commit.c:769 -#, c-format -msgid "%sAuthor: %s" +#: builtin/checkout.c:1027 +msgid "conflict style (merge or diff3)" msgstr "" -#: builtin/commit.c:776 -#, c-format -msgid "%sCommitter: %s" +#: builtin/checkout.c:1030 +msgid "second guess 'git checkout no-such-branch'" msgstr "" -#: builtin/commit.c:796 -msgid "Cannot read index" +#: builtin/checkout.c:1054 +msgid "-b, -B and --orphan are mutually exclusive" msgstr "" -#: builtin/commit.c:833 -msgid "Error building trees" +#: builtin/checkout.c:1071 +msgid "--track needs a branch name" msgstr "" -#: builtin/commit.c:848 builtin/tag.c:361 -#, c-format -msgid "Please supply the message using either -m or -F option.\n" +#: builtin/checkout.c:1078 +msgid "Missing branch name; try -b" msgstr "" -#: builtin/commit.c:945 -#, c-format -msgid "No existing author found with '%s'" +#: builtin/checkout.c:1113 +msgid "invalid path specification" msgstr "" -#: builtin/commit.c:960 builtin/commit.c:1160 +#: builtin/checkout.c:1120 #, c-format -msgid "Invalid untracked files mode '%s'" +msgid "" +"Cannot update paths and switch to branch '%s' at the same time.\n" +"Did you intend to checkout '%s' which can not be resolved as commit?" msgstr "" -#: builtin/commit.c:1000 -msgid "Using both --reset-author and --author does not make sense" -msgstr "" - -#: builtin/commit.c:1011 -msgid "You have nothing to amend." -msgstr "" - -#: builtin/commit.c:1014 -msgid "You are in the middle of a merge -- cannot amend." -msgstr "" - -#: builtin/commit.c:1016 -msgid "You are in the middle of a cherry-pick -- cannot amend." -msgstr "" - -#: builtin/commit.c:1019 -msgid "Options --squash and --fixup cannot be used together" -msgstr "" - -#: builtin/commit.c:1029 -msgid "Only one of -c/-C/-F/--fixup can be used." -msgstr "" - -#: builtin/commit.c:1031 -msgid "Option -m cannot be combined with -c/-C/-F/--fixup." +#: builtin/checkout.c:1125 +#, c-format +msgid "git checkout: --detach does not take a path argument '%s'" msgstr "" -#: builtin/commit.c:1039 -msgid "--reset-author can be used only with -C, -c or --amend." +#: builtin/checkout.c:1129 +msgid "" +"git checkout: --ours/--theirs, --force and --merge are incompatible when\n" +"checking out of the index." msgstr "" -#: builtin/commit.c:1056 -msgid "Only one of --include/--only/--all/--interactive/--patch can be used." +#: builtin/clean.c:19 +msgid "git clean [-d] [-f] [-n] [-q] [-e ] [-x | -X] [--] ..." msgstr "" -#: builtin/commit.c:1058 -msgid "No paths with --include/--only does not make sense." +#: builtin/clean.c:51 +msgid "do not print names of files removed" msgstr "" -#: builtin/commit.c:1060 -msgid "Clever... amending the last one with dirty index." +#: builtin/clean.c:53 +msgid "force" msgstr "" -#: builtin/commit.c:1062 -msgid "Explicit paths specified without -i nor -o; assuming --only paths..." +#: builtin/clean.c:55 +msgid "remove whole directories" msgstr "" -#: builtin/commit.c:1072 builtin/tag.c:577 -#, c-format -msgid "Invalid cleanup mode %s" +#: builtin/clean.c:56 builtin/describe.c:413 builtin/grep.c:803 +#: builtin/ls-files.c:491 builtin/name-rev.c:231 builtin/show-ref.c:199 +msgid "pattern" msgstr "" -#: builtin/commit.c:1077 -msgid "Paths with -a does not make sense." +#: builtin/clean.c:57 +msgid "add to ignore rules" msgstr "" -#: builtin/commit.c:1260 -msgid "couldn't look up newly created commit" +#: builtin/clean.c:58 +msgid "remove ignored files, too" msgstr "" -#: builtin/commit.c:1262 -msgid "could not parse newly created commit" +#: builtin/clean.c:60 +msgid "remove only ignored files" msgstr "" -#: builtin/commit.c:1303 -msgid "detached HEAD" +#: builtin/clean.c:78 +msgid "-x and -X cannot be used together" msgstr "" -#: builtin/commit.c:1305 -msgid " (root-commit)" +#: builtin/clean.c:82 +msgid "" +"clean.requireForce set to true and neither -n nor -f given; refusing to clean" msgstr "" -#: builtin/commit.c:1449 -msgid "could not parse HEAD commit" +#: builtin/clean.c:85 +msgid "" +"clean.requireForce defaults to true and neither -n nor -f given; refusing to " +"clean" msgstr "" -#: builtin/commit.c:1487 builtin/merge.c:508 +#: builtin/clean.c:155 builtin/clean.c:176 #, c-format -msgid "could not open '%s' for reading" +msgid "Would remove %s\n" msgstr "" -#: builtin/commit.c:1494 +#: builtin/clean.c:159 builtin/clean.c:179 #, c-format -msgid "Corrupt MERGE_HEAD file (%s)" -msgstr "" - -#: builtin/commit.c:1501 -msgid "could not read MERGE_MODE" +msgid "Removing %s\n" msgstr "" -#: builtin/commit.c:1520 +#: builtin/clean.c:162 builtin/clean.c:182 #, c-format -msgid "could not read commit message: %s" +msgid "failed to remove %s" msgstr "" -#: builtin/commit.c:1534 +#: builtin/clean.c:166 #, c-format -msgid "Aborting commit; you did not edit the message.\n" +msgid "Would not remove %s\n" msgstr "" -#: builtin/commit.c:1539 +#: builtin/clean.c:168 #, c-format -msgid "Aborting commit due to empty commit message.\n" +msgid "Not removing %s\n" msgstr "" -#: builtin/commit.c:1554 builtin/merge.c:935 builtin/merge.c:960 -msgid "failed to write commit object" +#: builtin/clone.c:36 +msgid "git clone [options] [--] []" msgstr "" -#: builtin/commit.c:1575 -msgid "cannot lock HEAD ref" +#: builtin/clone.c:64 builtin/fetch.c:82 builtin/merge.c:212 +#: builtin/push.c:399 +msgid "force progress reporting" msgstr "" -#: builtin/commit.c:1579 -msgid "cannot update HEAD ref" +#: builtin/clone.c:66 +msgid "don't create a checkout" msgstr "" -#: builtin/commit.c:1590 -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." +#: builtin/clone.c:67 builtin/clone.c:69 builtin/init-db.c:488 +msgid "create a bare repository" msgstr "" -#: builtin/describe.c:234 -#, c-format -msgid "annotated tag %s not available" +#: builtin/clone.c:72 +msgid "create a mirror repository (implies bare)" msgstr "" -#: builtin/describe.c:238 -#, c-format -msgid "annotated tag %s has no embedded name" +#: builtin/clone.c:74 +msgid "to clone from a local repository" msgstr "" -#: builtin/describe.c:240 -#, c-format -msgid "tag '%s' is really '%s' here" +#: builtin/clone.c:76 +msgid "don't use local hardlinks, always copy" msgstr "" -#: builtin/describe.c:267 -#, c-format -msgid "Not a valid object name %s" +#: builtin/clone.c:78 +msgid "setup as shared repository" msgstr "" -#: builtin/describe.c:270 -#, c-format -msgid "%s is not a valid '%s' object" +#: builtin/clone.c:80 builtin/clone.c:82 +msgid "initialize submodules in the clone" msgstr "" -#: builtin/describe.c:287 -#, c-format -msgid "no tag exactly matches '%s'" +#: builtin/clone.c:83 builtin/init-db.c:485 +msgid "template-directory" msgstr "" -#: builtin/describe.c:289 -#, c-format -msgid "searching to describe %s\n" +#: builtin/clone.c:84 builtin/init-db.c:486 +msgid "directory from which templates will be used" msgstr "" -#: builtin/describe.c:329 -#, c-format -msgid "finished search at %s\n" +#: builtin/clone.c:86 +msgid "reference repository" msgstr "" -#: builtin/describe.c:353 -#, c-format -msgid "" -"No annotated tags can describe '%s'.\n" -"However, there were unannotated tags: try --tags." +#: builtin/clone.c:87 builtin/column.c:26 builtin/merge-file.c:44 +msgid "name" msgstr "" -#: builtin/describe.c:357 -#, c-format -msgid "" -"No tags can describe '%s'.\n" -"Try --always, or create some tags." +#: builtin/clone.c:88 +msgid "use instead of 'origin' to track upstream" msgstr "" -#: builtin/describe.c:378 -#, c-format -msgid "traversed %lu commits\n" +#: builtin/clone.c:90 +msgid "checkout instead of the remote's HEAD" msgstr "" -#: builtin/describe.c:381 -#, c-format -msgid "" -"more than %i tags found; listed %i most recent\n" -"gave up search at %s\n" +#: builtin/clone.c:92 +msgid "path to git-upload-pack on the remote" msgstr "" -#: builtin/describe.c:436 -msgid "--long is incompatible with --abbrev=0" +#: builtin/clone.c:93 builtin/fetch.c:83 builtin/grep.c:748 +msgid "depth" msgstr "" -#: builtin/describe.c:462 -msgid "No names found, cannot describe anything." +#: builtin/clone.c:94 +msgid "create a shallow clone of that depth" msgstr "" -#: builtin/describe.c:482 -msgid "--dirty is incompatible with committishes" +#: builtin/clone.c:96 +msgid "clone only one branch, HEAD or --branch" msgstr "" -#: builtin/diff.c:79 -#, c-format -msgid "'%s': not a regular file or symlink" +#: builtin/clone.c:97 builtin/init-db.c:494 +msgid "gitdir" msgstr "" -#: builtin/diff.c:224 -#, c-format -msgid "invalid option: %s" +#: builtin/clone.c:98 builtin/init-db.c:495 +msgid "separate git dir from working tree" msgstr "" -#: builtin/diff.c:301 -msgid "Not a git repository" +#: builtin/clone.c:99 +msgid "key=value" msgstr "" -#: builtin/diff.c:344 -#, c-format -msgid "invalid object '%s' given." +#: builtin/clone.c:100 +msgid "set config inside the new repository" msgstr "" -#: builtin/diff.c:349 +#: builtin/clone.c:243 #, c-format -msgid "more than %d trees given: '%s'" +msgid "reference repository '%s' is not a local directory." msgstr "" -#: builtin/diff.c:359 +#: builtin/clone.c:306 #, c-format -msgid "more than two blobs given: '%s'" +msgid "failed to create directory '%s'" msgstr "" -#: builtin/diff.c:367 +#: builtin/clone.c:308 builtin/diff.c:77 #, c-format -msgid "unhandled object '%s' given." -msgstr "" - -#: builtin/fetch.c:200 -msgid "Couldn't find remote ref HEAD" +msgid "failed to stat '%s'" msgstr "" -#: builtin/fetch.c:253 +#: builtin/clone.c:310 #, c-format -msgid "object %s not found" +msgid "%s exists and is not a directory" msgstr "" -#: builtin/fetch.c:259 -msgid "[up to date]" +#: builtin/clone.c:324 +#, c-format +msgid "failed to stat %s\n" msgstr "" -#: builtin/fetch.c:273 +#: builtin/clone.c:346 #, c-format -msgid "! %-*s %-*s -> %s (can't fetch in current branch)" +msgid "failed to create link '%s'" msgstr "" -#: builtin/fetch.c:274 builtin/fetch.c:360 -msgid "[rejected]" +#: builtin/clone.c:350 +#, c-format +msgid "failed to copy file to '%s'" msgstr "" -#: builtin/fetch.c:285 -msgid "[tag update]" +#: builtin/clone.c:373 +#, c-format +msgid "done.\n" msgstr "" -#: builtin/fetch.c:287 builtin/fetch.c:322 builtin/fetch.c:340 -msgid " (unable to update local ref)" +#: builtin/clone.c:443 +#, c-format +msgid "Could not find remote branch %s to clone." msgstr "" -#: builtin/fetch.c:305 -msgid "[new tag]" +#: builtin/clone.c:552 +msgid "remote HEAD refers to nonexistent ref, unable to checkout.\n" msgstr "" -#: builtin/fetch.c:308 -msgid "[new branch]" +#: builtin/clone.c:690 +msgid "Too many arguments." msgstr "" -#: builtin/fetch.c:311 -msgid "[new ref]" +#: builtin/clone.c:694 +msgid "You must specify a repository to clone." msgstr "" -#: builtin/fetch.c:356 -msgid "unable to update local ref" +#: builtin/clone.c:705 +#, c-format +msgid "--bare and --origin %s options are incompatible." msgstr "" -#: builtin/fetch.c:356 -msgid "forced update" +#: builtin/clone.c:719 +#, c-format +msgid "repository '%s' does not exist" msgstr "" -#: builtin/fetch.c:362 -msgid "(non-fast-forward)" +#: builtin/clone.c:724 +msgid "--depth is ignored in local clones; use file:// instead." msgstr "" -#: builtin/fetch.c:393 builtin/fetch.c:685 +#: builtin/clone.c:734 #, c-format -msgid "cannot open %s: %s\n" +msgid "destination path '%s' already exists and is not an empty directory." msgstr "" -#: builtin/fetch.c:402 +#: builtin/clone.c:744 #, c-format -msgid "%s did not send all necessary objects\n" +msgid "working tree '%s' already exists." msgstr "" -#: builtin/fetch.c:488 +#: builtin/clone.c:757 builtin/clone.c:771 #, c-format -msgid "From %.*s\n" +msgid "could not create leading directories of '%s'" msgstr "" -#: builtin/fetch.c:499 +#: builtin/clone.c:760 #, c-format -msgid "" -"some local refs could not be updated; try running\n" -" 'git remote prune %s' to remove any old, conflicting branches" +msgid "could not create work tree dir '%s'." msgstr "" -#: builtin/fetch.c:549 +#: builtin/clone.c:779 #, c-format -msgid " (%s will become dangling)" +msgid "Cloning into bare repository '%s'...\n" msgstr "" -#: builtin/fetch.c:550 +#: builtin/clone.c:781 #, c-format -msgid " (%s has become dangling)" -msgstr "" - -#: builtin/fetch.c:557 -msgid "[deleted]" -msgstr "" - -#: builtin/fetch.c:558 builtin/remote.c:1055 -msgid "(none)" +msgid "Cloning into '%s'...\n" msgstr "" -#: builtin/fetch.c:675 +#: builtin/clone.c:823 #, c-format -msgid "Refusing to fetch into current branch %s of non-bare repository" +msgid "Don't know how to clone %s" msgstr "" -#: builtin/fetch.c:709 +#: builtin/clone.c:872 #, c-format -msgid "Don't know how to fetch from %s" +msgid "Remote branch %s not found in upstream %s" msgstr "" -#: builtin/fetch.c:786 -#, c-format -msgid "Option \"%s\" value \"%s\" is not valid for %s" +#: builtin/clone.c:879 +msgid "You appear to have cloned an empty repository." msgstr "" -#: builtin/fetch.c:789 -#, c-format -msgid "Option \"%s\" is ignored for %s\n" +#: builtin/column.c:9 +msgid "git column [options]" msgstr "" -#: builtin/fetch.c:888 -#, c-format -msgid "Fetching %s\n" +#: builtin/column.c:26 +msgid "lookup config vars" msgstr "" -#: builtin/fetch.c:890 builtin/remote.c:100 -#, c-format -msgid "Could not fetch %s" +#: builtin/column.c:27 builtin/column.c:28 +msgid "layout to use" msgstr "" -#: builtin/fetch.c:907 -msgid "" -"No remote repository specified. Please, specify either a URL or a\n" -"remote name from which new revisions should be fetched." +#: builtin/column.c:29 +msgid "Maximum width" msgstr "" -#: builtin/fetch.c:927 -msgid "You need to specify a tag name." +#: builtin/column.c:30 +msgid "Padding space on left border" msgstr "" -#: builtin/fetch.c:979 -msgid "fetch --all does not take a repository argument" +#: builtin/column.c:31 +msgid "Padding space on right border" msgstr "" -#: builtin/fetch.c:981 -msgid "fetch --all does not make sense with refspecs" +#: builtin/column.c:32 +msgid "Padding space between columns" msgstr "" -#: builtin/fetch.c:992 -#, c-format -msgid "No such remote or remote group: %s" +#: builtin/column.c:51 +msgid "--command must be the first argument" msgstr "" -#: builtin/fetch.c:1000 -msgid "Fetching a group and specifying refspecs does not make sense" +#: builtin/commit.c:34 +msgid "git commit [options] [--] ..." msgstr "" -#: builtin/gc.c:63 -#, c-format -msgid "Invalid %s: '%s'" +#: builtin/commit.c:39 +msgid "git status [options] [--] ..." msgstr "" -#: builtin/gc.c:90 -#, c-format -msgid "insanely long object directory %.*s" -msgstr "" - -#: builtin/gc.c:221 -#, c-format -msgid "Auto packing the repository for optimum performance.\n" +#: builtin/commit.c:44 +msgid "" +"Your name and email address were configured automatically based\n" +"on your username and hostname. Please check that they are accurate.\n" +"You can suppress this message by setting them explicitly:\n" +"\n" +" git config --global user.name \"Your Name\"\n" +" git config --global user.email you@example.com\n" +"\n" +"After doing this, you may fix the identity used for this commit with:\n" +"\n" +" git commit --amend --reset-author\n" msgstr "" -#: builtin/gc.c:224 -#, c-format +#: builtin/commit.c:56 msgid "" -"Auto packing the repository for optimum performance. You may also\n" -"run \"git gc\" manually. See \"git help gc\" for more information.\n" +"You asked to amend the most recent commit, but doing so would make\n" +"it empty. You can repeat your command with --allow-empty, or you can\n" +"remove the commit entirely with \"git reset HEAD^\".\n" msgstr "" -#: builtin/gc.c:251 +#: builtin/commit.c:61 msgid "" -"There are too many unreachable loose objects; run 'git prune' to remove them." +"The previous cherry-pick is now empty, possibly due to conflict resolution.\n" +"If you wish to commit it anyway, use:\n" +"\n" +" git commit --allow-empty\n" +"\n" +"Otherwise, please use 'git reset'\n" msgstr "" -#: builtin/grep.c:216 -#, c-format -msgid "grep: failed to create thread: %s" +#: builtin/commit.c:257 +msgid "failed to unpack HEAD tree object" msgstr "" -#: builtin/grep.c:454 -#, c-format -msgid "Failed to chdir: %s" +#: builtin/commit.c:299 +msgid "unable to create temporary index" msgstr "" -#: builtin/grep.c:530 builtin/grep.c:564 -#, c-format -msgid "unable to read tree (%s)" +#: builtin/commit.c:305 +msgid "interactive add failed" msgstr "" -#: builtin/grep.c:578 -#, c-format -msgid "unable to grep from object of type %s" +#: builtin/commit.c:338 builtin/commit.c:359 builtin/commit.c:409 +msgid "unable to write new_index file" msgstr "" -#: builtin/grep.c:636 -#, c-format -msgid "switch `%c' expects a numerical value" +#: builtin/commit.c:390 +msgid "cannot do a partial commit during a merge." msgstr "" -#: builtin/grep.c:653 -#, c-format -msgid "cannot open '%s'" +#: builtin/commit.c:392 +msgid "cannot do a partial commit during a cherry-pick." msgstr "" -#: builtin/grep.c:917 -msgid "no pattern given." +#: builtin/commit.c:402 +msgid "cannot read the index" +msgstr "" + +#: builtin/commit.c:422 +msgid "unable to write temporary index file" msgstr "" -#: builtin/grep.c:931 +#: builtin/commit.c:509 builtin/commit.c:515 #, c-format -msgid "bad object %s" +msgid "invalid commit: %s" msgstr "" -#: builtin/grep.c:972 -msgid "--open-files-in-pager only works on the worktree" +#: builtin/commit.c:538 +msgid "malformed --author parameter" msgstr "" -#: builtin/grep.c:995 -msgid "--cached or --untracked cannot be used with --no-index." +#: builtin/commit.c:558 +#, c-format +msgid "Malformed ident string: '%s'" msgstr "" -#: builtin/grep.c:1000 -msgid "--no-index or --untracked cannot be used with revs." +#: builtin/commit.c:596 builtin/commit.c:629 builtin/commit.c:952 +#, c-format +msgid "could not lookup commit %s" msgstr "" -#: builtin/grep.c:1003 -msgid "--[no-]exclude-standard cannot be used for tracked contents." +#: builtin/commit.c:608 builtin/shortlog.c:296 +#, c-format +msgid "(reading log message from standard input)\n" msgstr "" -#: builtin/grep.c:1011 -msgid "both --cached and trees are given." +#: builtin/commit.c:610 +msgid "could not read log from standard input" msgstr "" -#: builtin/help.c:65 +#: builtin/commit.c:614 #, c-format -msgid "unrecognized help format '%s'" +msgid "could not read log file '%s'" msgstr "" -#: builtin/help.c:93 -msgid "Failed to start emacsclient." +#: builtin/commit.c:620 +msgid "commit has empty message" msgstr "" -#: builtin/help.c:106 -msgid "Failed to parse emacsclient version." +#: builtin/commit.c:636 +msgid "could not read MERGE_MSG" msgstr "" -#: builtin/help.c:114 -#, c-format -msgid "emacsclient version '%d' too old (< 22)." +#: builtin/commit.c:640 +msgid "could not read SQUASH_MSG" msgstr "" -#: builtin/help.c:132 builtin/help.c:160 builtin/help.c:169 builtin/help.c:177 +#: builtin/commit.c:644 #, c-format -msgid "failed to exec '%s': %s" +msgid "could not read '%s'" msgstr "" -#: builtin/help.c:217 +#: builtin/commit.c:705 +msgid "could not write commit template" +msgstr "" + +#: builtin/commit.c:716 #, c-format msgid "" -"'%s': path for unsupported man viewer.\n" -"Please consider using 'man..cmd' instead." +"\n" +"It looks like you may be committing a merge.\n" +"If this is not correct, please remove the file\n" +"\t%s\n" +"and try again.\n" msgstr "" -#: builtin/help.c:229 +#: builtin/commit.c:721 #, c-format msgid "" -"'%s': cmd for supported man viewer.\n" -"Please consider using 'man..path' instead." +"\n" +"It looks like you may be committing a cherry-pick.\n" +"If this is not correct, please remove the file\n" +"\t%s\n" +"and try again.\n" msgstr "" -#: builtin/help.c:299 -msgid "The most commonly used git commands are:" +#: builtin/commit.c:733 +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 "" -#: builtin/help.c:367 +#: builtin/commit.c:738 +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 "" + +#: builtin/commit.c:751 #, c-format -msgid "'%s': unknown man viewer." +msgid "%sAuthor: %s" msgstr "" -#: builtin/help.c:384 -msgid "no man viewer handled the request" +#: builtin/commit.c:758 +#, c-format +msgid "%sCommitter: %s" msgstr "" -#: builtin/help.c:392 -msgid "no info viewer handled the request" +#: builtin/commit.c:778 +msgid "Cannot read index" msgstr "" -#: builtin/help.c:447 builtin/help.c:454 -#, c-format -msgid "usage: %s%s" +#: builtin/commit.c:815 +msgid "Error building trees" msgstr "" -#: builtin/help.c:470 +#: builtin/commit.c:830 builtin/tag.c:361 #, c-format -msgid "`git %s' is aliased to `%s'" +msgid "Please supply the message using either -m or -F option.\n" msgstr "" -#: builtin/index-pack.c:170 +#: builtin/commit.c:927 #, c-format -msgid "object type mismatch at %s" +msgid "No existing author found with '%s'" msgstr "" -#: builtin/index-pack.c:190 -msgid "object of unexpected type" +#: builtin/commit.c:942 builtin/commit.c:1142 +#, c-format +msgid "Invalid untracked files mode '%s'" msgstr "" -#: builtin/index-pack.c:227 -#, c-format -msgid "cannot fill %d byte" -msgid_plural "cannot fill %d bytes" -msgstr[0] "" -msgstr[1] "" +#: builtin/commit.c:982 +msgid "Using both --reset-author and --author does not make sense" +msgstr "" -#: builtin/index-pack.c:237 -msgid "early EOF" +#: builtin/commit.c:993 +msgid "You have nothing to amend." msgstr "" -#: builtin/index-pack.c:238 -msgid "read error on input" +#: builtin/commit.c:996 +msgid "You are in the middle of a merge -- cannot amend." msgstr "" -#: builtin/index-pack.c:250 -msgid "used more bytes than were available" +#: builtin/commit.c:998 +msgid "You are in the middle of a cherry-pick -- cannot amend." msgstr "" -#: builtin/index-pack.c:257 -msgid "pack too large for current definition of off_t" +#: builtin/commit.c:1001 +msgid "Options --squash and --fixup cannot be used together" msgstr "" -#: builtin/index-pack.c:273 -#, c-format -msgid "unable to create '%s'" +#: builtin/commit.c:1011 +msgid "Only one of -c/-C/-F/--fixup can be used." msgstr "" -#: builtin/index-pack.c:278 -#, c-format -msgid "cannot open packfile '%s'" +#: builtin/commit.c:1013 +msgid "Option -m cannot be combined with -c/-C/-F/--fixup." msgstr "" -#: builtin/index-pack.c:292 -msgid "pack signature mismatch" +#: builtin/commit.c:1021 +msgid "--reset-author can be used only with -C, -c or --amend." msgstr "" -#: builtin/index-pack.c:312 -#, c-format -msgid "pack has bad object at offset %lu: %s" +#: builtin/commit.c:1038 +msgid "Only one of --include/--only/--all/--interactive/--patch can be used." msgstr "" -#: builtin/index-pack.c:434 -#, c-format -msgid "inflate returned %d" +#: builtin/commit.c:1040 +msgid "No paths with --include/--only does not make sense." msgstr "" -#: builtin/index-pack.c:483 -msgid "offset value overflow for delta base object" +#: builtin/commit.c:1042 +msgid "Clever... amending the last one with dirty index." msgstr "" -#: builtin/index-pack.c:491 -msgid "delta base offset is out of bound" +#: builtin/commit.c:1044 +msgid "Explicit paths specified without -i nor -o; assuming --only paths..." msgstr "" -#: builtin/index-pack.c:499 +#: builtin/commit.c:1054 builtin/tag.c:577 #, c-format -msgid "unknown object type %d" +msgid "Invalid cleanup mode %s" msgstr "" -#: builtin/index-pack.c:530 -msgid "cannot pread pack file" +#: builtin/commit.c:1059 +msgid "Paths with -a does not make sense." msgstr "" -#: builtin/index-pack.c:532 -#, c-format -msgid "premature end of pack file, %lu byte missing" -msgid_plural "premature end of pack file, %lu bytes missing" -msgstr[0] "" -msgstr[1] "" +#: builtin/commit.c:1156 builtin/commit.c:1384 +msgid "show status concisely" +msgstr "" -#: builtin/index-pack.c:558 -msgid "serious inflate inconsistency" +#: builtin/commit.c:1158 builtin/commit.c:1386 +msgid "show branch information" msgstr "" -#: builtin/index-pack.c:649 builtin/index-pack.c:655 builtin/index-pack.c:678 -#: builtin/index-pack.c:712 builtin/index-pack.c:721 -#, c-format -msgid "SHA1 COLLISION FOUND WITH %s !" +#: builtin/commit.c:1160 builtin/commit.c:1388 builtin/push.c:389 +msgid "machine-readable output" msgstr "" -#: builtin/index-pack.c:652 builtin/pack-objects.c:170 -#: builtin/pack-objects.c:262 -#, c-format -msgid "unable to read %s" +#: builtin/commit.c:1163 builtin/commit.c:1390 +msgid "terminate entries with NUL" msgstr "" -#: builtin/index-pack.c:718 -#, c-format -msgid "cannot read existing object %s" +#: builtin/commit.c:1165 builtin/commit.c:1393 builtin/fast-export.c:636 +#: builtin/fast-export.c:639 builtin/tag.c:461 +msgid "mode" msgstr "" -#: builtin/index-pack.c:732 -#, c-format -msgid "invalid blob object %s" +#: builtin/commit.c:1166 builtin/commit.c:1393 +msgid "show untracked files, optional modes: all, normal, no. (Default: all)" msgstr "" -#: builtin/index-pack.c:747 -#, c-format -msgid "invalid %s" +#: builtin/commit.c:1169 +msgid "show ignored files" msgstr "" -#: builtin/index-pack.c:749 -msgid "Error in object" +#: builtin/commit.c:1170 parse-options.h:151 +msgid "when" msgstr "" -#: builtin/index-pack.c:751 -#, c-format -msgid "Not all child objects of %s are reachable" +#: builtin/commit.c:1171 +msgid "" +"ignore changes to submodules, optional when: all, dirty, untracked. " +"(Default: all)" msgstr "" -#: builtin/index-pack.c:821 builtin/index-pack.c:847 -msgid "failed to apply delta" +#: builtin/commit.c:1173 +msgid "list untracked files in columns" msgstr "" -#: builtin/index-pack.c:986 -msgid "Receiving objects" +#: builtin/commit.c:1242 +msgid "couldn't look up newly created commit" msgstr "" -#: builtin/index-pack.c:986 -msgid "Indexing objects" +#: builtin/commit.c:1244 +msgid "could not parse newly created commit" msgstr "" -#: builtin/index-pack.c:1012 -msgid "pack is corrupted (SHA1 mismatch)" +#: builtin/commit.c:1285 +msgid "detached HEAD" msgstr "" -#: builtin/index-pack.c:1017 -msgid "cannot fstat packfile" +#: builtin/commit.c:1287 +msgid " (root-commit)" msgstr "" -#: builtin/index-pack.c:1020 -msgid "pack has junk at the end" +#: builtin/commit.c:1354 +msgid "suppress summary after successful commit" msgstr "" -#: builtin/index-pack.c:1031 -msgid "confusion beyond insanity in parse_pack_objects()" +#: builtin/commit.c:1355 +msgid "show diff in commit message template" msgstr "" -#: builtin/index-pack.c:1054 -msgid "Resolving deltas" +#: builtin/commit.c:1357 +msgid "Commit message options" msgstr "" -#: builtin/index-pack.c:1105 -msgid "confusion beyond insanity" +#: builtin/commit.c:1358 builtin/tag.c:459 +msgid "read message from file" msgstr "" -#: builtin/index-pack.c:1124 -#, c-format -msgid "pack has %d unresolved delta" -msgid_plural "pack has %d unresolved deltas" -msgstr[0] "" -msgstr[1] "" +#: builtin/commit.c:1359 +msgid "author" +msgstr "" -#: builtin/index-pack.c:1149 -#, c-format -msgid "unable to deflate appended object (%d)" +#: builtin/commit.c:1359 +msgid "override author for commit" msgstr "" -#: builtin/index-pack.c:1228 -#, c-format -msgid "local object %s is corrupt" +#: builtin/commit.c:1360 builtin/gc.c:178 +msgid "date" msgstr "" -#: builtin/index-pack.c:1252 -msgid "error while closing pack file" +#: builtin/commit.c:1360 +msgid "override date for commit" msgstr "" -#: builtin/index-pack.c:1265 -#, c-format -msgid "cannot write keep file '%s'" +#: builtin/commit.c:1361 builtin/merge.c:206 builtin/notes.c:537 +#: builtin/notes.c:694 builtin/tag.c:457 +msgid "message" msgstr "" -#: builtin/index-pack.c:1273 -#, c-format -msgid "cannot close written keep file '%s'" +#: builtin/commit.c:1361 +msgid "commit message" msgstr "" -#: builtin/index-pack.c:1286 -msgid "cannot store pack file" +#: builtin/commit.c:1362 +msgid "reuse and edit message from specified commit" msgstr "" -#: builtin/index-pack.c:1297 -msgid "cannot store index file" +#: builtin/commit.c:1363 +msgid "reuse message from specified commit" msgstr "" -#: builtin/index-pack.c:1398 -#, c-format -msgid "Cannot open existing pack file '%s'" +#: builtin/commit.c:1364 +msgid "use autosquash formatted message to fixup specified commit" msgstr "" -#: builtin/index-pack.c:1400 -#, c-format -msgid "Cannot open existing pack idx file for '%s'" +#: builtin/commit.c:1365 +msgid "use autosquash formatted message to squash specified commit" msgstr "" -#: builtin/index-pack.c:1447 -#, c-format -msgid "non delta: %d object" -msgid_plural "non delta: %d objects" -msgstr[0] "" -msgstr[1] "" - -#: builtin/index-pack.c:1454 -#, c-format -msgid "chain length = %d: %lu object" -msgid_plural "chain length = %d: %lu objects" -msgstr[0] "" -msgstr[1] "" - -#: builtin/index-pack.c:1481 -msgid "Cannot come back to cwd" +#: builtin/commit.c:1366 +msgid "the commit is authored by me now (used with -C/-c/--amend)" msgstr "" -#: builtin/index-pack.c:1525 builtin/index-pack.c:1528 -#: builtin/index-pack.c:1540 builtin/index-pack.c:1544 -#, c-format -msgid "bad %s" +#: builtin/commit.c:1367 builtin/log.c:1068 builtin/revert.c:109 +msgid "add Signed-off-by:" msgstr "" -#: builtin/index-pack.c:1558 -msgid "--fix-thin cannot be used without --stdin" +#: builtin/commit.c:1368 +msgid "use specified template file" msgstr "" -#: builtin/index-pack.c:1562 builtin/index-pack.c:1572 -#, c-format -msgid "packfile name '%s' does not end with '.pack'" +#: builtin/commit.c:1369 +msgid "force edit of commit" msgstr "" -#: builtin/index-pack.c:1581 -msgid "--verify with no packfile name given" +#: builtin/commit.c:1370 +msgid "default" msgstr "" -#: builtin/init-db.c:35 -#, c-format -msgid "Could not make %s writable by group" +#: builtin/commit.c:1370 builtin/tag.c:462 +msgid "how to strip spaces and #comments from message" msgstr "" -#: builtin/init-db.c:62 -#, c-format -msgid "insanely long template name %s" +#: builtin/commit.c:1371 +msgid "include status in commit message template" msgstr "" -#: builtin/init-db.c:67 -#, c-format -msgid "cannot stat '%s'" +#: builtin/commit.c:1372 builtin/merge.c:213 builtin/tag.c:463 +msgid "key id" msgstr "" -#: builtin/init-db.c:73 -#, c-format -msgid "cannot stat template '%s'" +#: builtin/commit.c:1373 builtin/merge.c:214 +msgid "GPG sign commit" msgstr "" -#: builtin/init-db.c:80 -#, c-format -msgid "cannot opendir '%s'" +#. end commit message options +#: builtin/commit.c:1376 +msgid "Commit contents options" msgstr "" -#: builtin/init-db.c:97 -#, c-format -msgid "cannot readlink '%s'" +#: builtin/commit.c:1377 +msgid "commit all changed files" msgstr "" -#: builtin/init-db.c:99 -#, c-format -msgid "insanely long symlink %s" +#: builtin/commit.c:1378 +msgid "add specified files to index for commit" msgstr "" -#: builtin/init-db.c:102 -#, c-format -msgid "cannot symlink '%s' '%s'" +#: builtin/commit.c:1379 +msgid "interactively add files" msgstr "" -#: builtin/init-db.c:106 -#, c-format -msgid "cannot copy '%s' to '%s'" +#: builtin/commit.c:1380 +msgid "interactively add changes" msgstr "" -#: builtin/init-db.c:110 -#, c-format -msgid "ignoring template %s" +#: builtin/commit.c:1381 +msgid "commit only specified files" msgstr "" -#: builtin/init-db.c:133 -#, c-format -msgid "insanely long template path %s" +#: builtin/commit.c:1382 +msgid "bypass pre-commit hook" msgstr "" -#: builtin/init-db.c:141 -#, c-format -msgid "templates not found %s" +#: builtin/commit.c:1383 +msgid "show what would be committed" msgstr "" -#: builtin/init-db.c:154 -#, c-format -msgid "not copying templates of a wrong format version %d from '%s'" +#: builtin/commit.c:1391 +msgid "amend previous commit" msgstr "" -#: builtin/init-db.c:192 -#, c-format -msgid "insane git directory %s" +#: builtin/commit.c:1392 +msgid "bypass post-rewrite hook" msgstr "" -#: builtin/init-db.c:323 builtin/init-db.c:326 -#, c-format -msgid "%s already exists" +#: builtin/commit.c:1397 +msgid "ok to record an empty change" msgstr "" -#: builtin/init-db.c:355 -#, c-format -msgid "unable to handle file type %d" +#: builtin/commit.c:1400 +msgid "ok to record a change with an empty message" msgstr "" -#: builtin/init-db.c:358 -#, c-format -msgid "unable to move %s to %s" +#: builtin/commit.c:1432 +msgid "could not parse HEAD commit" msgstr "" -#: builtin/init-db.c:363 +#: builtin/commit.c:1470 builtin/merge.c:508 #, c-format -msgid "Could not create git link %s" +msgid "could not open '%s' for reading" msgstr "" -#. -#. * TRANSLATORS: The first '%s' is either "Reinitialized -#. * existing" or "Initialized empty", the second " shared" or -#. * "", and the last '%s%s' is the verbatim directory name. -#. -#: builtin/init-db.c:420 +#: builtin/commit.c:1477 #, c-format -msgid "%s%s Git repository in %s%s\n" -msgstr "" - -#: builtin/init-db.c:421 -msgid "Reinitialized existing" -msgstr "" - -#: builtin/init-db.c:421 -msgid "Initialized empty" -msgstr "" - -#: builtin/init-db.c:422 -msgid " shared" +msgid "Corrupt MERGE_HEAD file (%s)" msgstr "" -#: builtin/init-db.c:441 -msgid "cannot tell cwd" +#: builtin/commit.c:1484 +msgid "could not read MERGE_MODE" msgstr "" -#: builtin/init-db.c:522 builtin/init-db.c:529 +#: builtin/commit.c:1503 #, c-format -msgid "cannot mkdir %s" +msgid "could not read commit message: %s" msgstr "" -#: builtin/init-db.c:533 +#: builtin/commit.c:1517 #, c-format -msgid "cannot chdir to %s" +msgid "Aborting commit; you did not edit the message.\n" msgstr "" -#: builtin/init-db.c:555 +#: builtin/commit.c:1522 #, c-format -msgid "" -"%s (or --work-tree=) not allowed without specifying %s (or --git-" -"dir=)" +msgid "Aborting commit due to empty commit message.\n" msgstr "" -#: builtin/init-db.c:579 -msgid "Cannot access current working directory" +#: builtin/commit.c:1537 builtin/merge.c:935 builtin/merge.c:960 +msgid "failed to write commit object" msgstr "" -#: builtin/init-db.c:586 -#, c-format -msgid "Cannot access work tree '%s'" +#: builtin/commit.c:1558 +msgid "cannot lock HEAD ref" msgstr "" -#: builtin/log.c:189 -#, c-format -msgid "Final output: %d %s\n" +#: builtin/commit.c:1562 +msgid "cannot update HEAD ref" msgstr "" -#: builtin/log.c:403 builtin/log.c:494 -#, c-format -msgid "Could not read object %s" +#: builtin/commit.c:1573 +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 "" -#: builtin/log.c:518 -#, c-format -msgid "Unknown type: %d" +#: builtin/config.c:7 +msgid "git config [options]" msgstr "" -#: builtin/log.c:608 -msgid "format.headers without value" +#: builtin/config.c:52 +msgid "Config file location" msgstr "" -#: builtin/log.c:682 -msgid "name of output directory is too long" +#: builtin/config.c:53 +msgid "use global config file" msgstr "" -#: builtin/log.c:693 -#, c-format -msgid "Cannot open patch file %s" +#: builtin/config.c:54 +msgid "use system config file" msgstr "" -#: builtin/log.c:707 -msgid "Need exactly one range." +#: builtin/config.c:55 +msgid "use repository config file" msgstr "" -#: builtin/log.c:715 -msgid "Not a range." +#: builtin/config.c:56 +msgid "use given config file" msgstr "" -#: builtin/log.c:789 -msgid "Cover letter needs email format" +#: builtin/config.c:57 +msgid "Action" msgstr "" -#: builtin/log.c:862 -#, c-format -msgid "insane in-reply-to: %s" +#: builtin/config.c:58 +msgid "get value: name [value-regex]" msgstr "" -#: builtin/log.c:935 -msgid "Two output directories?" +#: builtin/config.c:59 +msgid "get all values: key [value-regex]" msgstr "" -#: builtin/log.c:1157 -#, c-format -msgid "bogus committer info %s" +#: builtin/config.c:60 +msgid "get values for regexp: name-regex [value-regex]" msgstr "" -#: builtin/log.c:1202 -msgid "-n and -k are mutually exclusive." +#: builtin/config.c:61 +msgid "replace all matching variables: name value [value_regex]" msgstr "" -#: builtin/log.c:1204 -msgid "--subject-prefix and -k are mutually exclusive." +#: builtin/config.c:62 +msgid "add a new variable: name value" msgstr "" -#: builtin/log.c:1212 -msgid "--name-only does not make sense" +#: builtin/config.c:63 +msgid "remove a variable: name [value-regex]" msgstr "" -#: builtin/log.c:1214 -msgid "--name-status does not make sense" +#: builtin/config.c:64 +msgid "remove all matches: name [value-regex]" msgstr "" -#: builtin/log.c:1216 -msgid "--check does not make sense" +#: builtin/config.c:65 +msgid "rename section: old-name new-name" msgstr "" -#: builtin/log.c:1239 -msgid "standard output, or directory, which one?" +#: builtin/config.c:66 +msgid "remove a section: name" msgstr "" -#: builtin/log.c:1241 -#, c-format -msgid "Could not create directory '%s'" +#: builtin/config.c:67 +msgid "list all" msgstr "" -#: builtin/log.c:1394 -msgid "Failed to create output files" +#: builtin/config.c:68 +msgid "open an editor" msgstr "" -#: builtin/log.c:1498 -#, c-format -msgid "" -"Could not find a tracked remote branch, please specify manually.\n" +#: builtin/config.c:69 builtin/config.c:70 +msgid "slot" msgstr "" -#: builtin/log.c:1511 builtin/log.c:1513 builtin/log.c:1525 -#, c-format -msgid "Unknown commit %s" +#: builtin/config.c:69 +msgid "find the color configured: [default]" msgstr "" -#: builtin/merge.c:90 -msgid "switch `m' requires a value" +#: builtin/config.c:70 +msgid "find the color setting: [stdout-is-tty]" msgstr "" -#: builtin/merge.c:127 -#, c-format -msgid "Could not find merge strategy '%s'.\n" +#: builtin/config.c:71 +msgid "Type" msgstr "" -#: builtin/merge.c:128 -#, c-format -msgid "Available strategies are:" +#: builtin/config.c:72 +msgid "value is \"true\" or \"false\"" msgstr "" -#: builtin/merge.c:133 -#, c-format -msgid "Available custom strategies are:" +#: builtin/config.c:73 +msgid "value is decimal number" msgstr "" -#: builtin/merge.c:240 -msgid "could not run stash." +#: builtin/config.c:74 +msgid "value is --bool or --int" msgstr "" -#: builtin/merge.c:245 -msgid "stash failed" +#: builtin/config.c:75 +msgid "value is a path (file or directory name)" msgstr "" -#: builtin/merge.c:250 -#, c-format -msgid "not a valid object: %s" +#: builtin/config.c:76 +msgid "Other" msgstr "" -#: builtin/merge.c:269 builtin/merge.c:286 -msgid "read-tree failed" +#: builtin/config.c:77 +msgid "terminate values with NUL byte" msgstr "" -#: builtin/merge.c:316 -msgid " (nothing to squash)" +#: builtin/config.c:78 +msgid "respect include directives on lookup" msgstr "" -#: builtin/merge.c:329 -#, c-format -msgid "Squash commit -- not updating HEAD\n" +#: builtin/count-objects.c:69 +msgid "git count-objects [-v]" msgstr "" -#: builtin/merge.c:361 -msgid "Writing SQUASH_MSG" +#: builtin/describe.c:15 +msgid "git describe [options] *" msgstr "" -#: builtin/merge.c:363 -msgid "Finishing SQUASH_MSG" +#: builtin/describe.c:16 +msgid "git describe [options] --dirty" msgstr "" -#: builtin/merge.c:386 +#: builtin/describe.c:234 #, c-format -msgid "No merge message -- not updating HEAD\n" +msgid "annotated tag %s not available" msgstr "" -#: builtin/merge.c:436 +#: builtin/describe.c:238 #, c-format -msgid "'%s' does not point to a commit" +msgid "annotated tag %s has no embedded name" msgstr "" -#: builtin/merge.c:535 +#: builtin/describe.c:240 #, c-format -msgid "Bad branch.%s.mergeoptions string: %s" +msgid "tag '%s' is really '%s' here" msgstr "" -#: builtin/merge.c:628 -msgid "git write-tree failed to write a tree" +#: builtin/describe.c:267 +#, c-format +msgid "Not a valid object name %s" msgstr "" -#: builtin/merge.c:678 -msgid "failed to read the cache" +#: builtin/describe.c:270 +#, c-format +msgid "%s is not a valid '%s' object" msgstr "" -#: builtin/merge.c:709 -msgid "Not handling anything other than two heads merge." +#: builtin/describe.c:287 +#, c-format +msgid "no tag exactly matches '%s'" msgstr "" -#: builtin/merge.c:723 +#: builtin/describe.c:289 #, c-format -msgid "Unknown option for merge-recursive: -X%s" +msgid "searching to describe %s\n" msgstr "" -#: builtin/merge.c:737 +#: builtin/describe.c:329 #, c-format -msgid "unable to write %s" +msgid "finished search at %s\n" msgstr "" -#: builtin/merge.c:876 +#: builtin/describe.c:353 #, c-format -msgid "Could not read from '%s'" +msgid "" +"No annotated tags can describe '%s'.\n" +"However, there were unannotated tags: try --tags." msgstr "" -#: builtin/merge.c:885 +#: builtin/describe.c:357 #, c-format -msgid "Not committing merge; use 'git commit' to complete the merge.\n" +msgid "" +"No tags can describe '%s'.\n" +"Try --always, or create some tags." msgstr "" -#: builtin/merge.c:891 -msgid "" -"Please enter a commit message to explain why this merge is necessary,\n" -"especially if it merges an updated upstream into a topic branch.\n" -"\n" -"Lines starting with '#' will be ignored, and an empty message aborts\n" -"the commit.\n" -msgstr "" - -#: builtin/merge.c:915 -msgid "Empty commit message." +#: builtin/describe.c:378 +#, c-format +msgid "traversed %lu commits\n" msgstr "" -#: builtin/merge.c:927 +#: builtin/describe.c:381 #, c-format -msgid "Wonderful.\n" +msgid "" +"more than %i tags found; listed %i most recent\n" +"gave up search at %s\n" msgstr "" -#: builtin/merge.c:992 -#, c-format -msgid "Automatic merge failed; fix conflicts and then commit the result.\n" +#: builtin/describe.c:403 +msgid "find the tag that comes after the commit" msgstr "" -#: builtin/merge.c:1008 -#, c-format -msgid "'%s' is not a commit" +#: builtin/describe.c:404 +msgid "debug search strategy on stderr" msgstr "" -#: builtin/merge.c:1049 -msgid "No current branch." +#: builtin/describe.c:405 +msgid "use any ref in .git/refs" msgstr "" -#: builtin/merge.c:1051 -msgid "No remote for the current branch." +#: builtin/describe.c:406 +msgid "use any tag in .git/refs/tags" msgstr "" -#: builtin/merge.c:1053 -msgid "No default upstream defined for the current branch." +#: builtin/describe.c:407 +msgid "always use long format" msgstr "" -#: builtin/merge.c:1058 -#, c-format -msgid "No remote tracking branch for %s from %s" +#: builtin/describe.c:410 +msgid "only output exact matches" msgstr "" -#: builtin/merge.c:1145 builtin/merge.c:1302 -#, c-format -msgid "%s - not something we can merge" +#: builtin/describe.c:412 +msgid "consider most recent tags (default: 10)" msgstr "" -#: builtin/merge.c:1213 -msgid "There is no merge to abort (MERGE_HEAD missing)." +#: builtin/describe.c:414 +msgid "only consider tags matching " msgstr "" -#: builtin/merge.c:1229 git-pull.sh:31 -msgid "" -"You have not concluded your merge (MERGE_HEAD exists).\n" -"Please, commit your changes before you can merge." +#: builtin/describe.c:416 builtin/name-rev.c:238 +msgid "show abbreviated commit object as fallback" msgstr "" -#: builtin/merge.c:1232 git-pull.sh:34 -msgid "You have not concluded your merge (MERGE_HEAD exists)." +#: builtin/describe.c:417 +msgid "mark" msgstr "" -#: builtin/merge.c:1236 -msgid "" -"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n" -"Please, commit your changes before you can merge." +#: builtin/describe.c:418 +msgid "append on dirty working tree (default: \"-dirty\")" msgstr "" -#: builtin/merge.c:1239 -msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)." +#: builtin/describe.c:436 +msgid "--long is incompatible with --abbrev=0" msgstr "" -#: builtin/merge.c:1248 -msgid "You cannot combine --squash with --no-ff." +#: builtin/describe.c:462 +msgid "No names found, cannot describe anything." msgstr "" -#: builtin/merge.c:1253 -msgid "You cannot combine --no-ff with --ff-only." +#: builtin/describe.c:482 +msgid "--dirty is incompatible with committishes" msgstr "" -#: builtin/merge.c:1260 -msgid "No commit specified and merge.defaultToUpstream not set." +#: builtin/diff.c:79 +#, c-format +msgid "'%s': not a regular file or symlink" msgstr "" -#: builtin/merge.c:1292 -msgid "Can merge only exactly one commit into empty head" +#: builtin/diff.c:224 +#, c-format +msgid "invalid option: %s" msgstr "" -#: builtin/merge.c:1295 -msgid "Squash commit into empty head not supported yet" +#: builtin/diff.c:301 +msgid "Not a git repository" msgstr "" -#: builtin/merge.c:1297 -msgid "Non-fast-forward commit does not make sense into an empty head" +#: builtin/diff.c:344 +#, c-format +msgid "invalid object '%s' given." msgstr "" -#: builtin/merge.c:1412 +#: builtin/diff.c:349 #, c-format -msgid "Updating %s..%s\n" +msgid "more than %d trees given: '%s'" msgstr "" -#: builtin/merge.c:1450 +#: builtin/diff.c:359 #, c-format -msgid "Trying really trivial in-index merge...\n" +msgid "more than two blobs given: '%s'" msgstr "" -#: builtin/merge.c:1457 +#: builtin/diff.c:367 #, c-format -msgid "Nope.\n" +msgid "unhandled object '%s' given." msgstr "" -#: builtin/merge.c:1489 -msgid "Not possible to fast-forward, aborting." +#: builtin/fast-export.c:22 +msgid "git fast-export [rev-list-opts]" msgstr "" -#: builtin/merge.c:1512 builtin/merge.c:1591 -#, c-format -msgid "Rewinding the tree to pristine...\n" +#: builtin/fast-export.c:635 +msgid "show progress after objects" msgstr "" -#: builtin/merge.c:1516 -#, c-format -msgid "Trying merge strategy %s...\n" +#: builtin/fast-export.c:637 +msgid "select handling of signed tags" msgstr "" -#: builtin/merge.c:1582 -#, c-format -msgid "No merge strategy handled the merge.\n" +#: builtin/fast-export.c:640 +msgid "select handling of tags that tag filtered objects" msgstr "" -#: builtin/merge.c:1584 -#, c-format -msgid "Merge with strategy %s failed.\n" +#: builtin/fast-export.c:643 +msgid "Dump marks to this file" msgstr "" -#: builtin/merge.c:1593 -#, c-format -msgid "Using the %s to prepare resolving by hand.\n" +#: builtin/fast-export.c:645 +msgid "Import marks from this file" msgstr "" -#: builtin/merge.c:1605 -#, c-format -msgid "Automatic merge went well; stopped before committing as requested\n" +#: builtin/fast-export.c:647 +msgid "Fake a tagger when tags lack one" msgstr "" -#: builtin/mv.c:108 -#, c-format -msgid "Checking rename of '%s' to '%s'\n" +#: builtin/fast-export.c:649 +msgid "Output full tree for each commit" msgstr "" -#: builtin/mv.c:112 -msgid "bad source" +#: builtin/fast-export.c:651 +msgid "Use the done feature to terminate the stream" msgstr "" -#: builtin/mv.c:115 -msgid "can not move directory into itself" +#: builtin/fast-export.c:652 +msgid "Skip output of blob data" msgstr "" -#: builtin/mv.c:118 -msgid "cannot move directory over file" +#: builtin/fetch.c:20 +msgid "git fetch [] [ [...]]" msgstr "" -#: builtin/mv.c:128 -#, c-format -msgid "Huh? %.*s is in index?" +#: builtin/fetch.c:21 +msgid "git fetch [] " msgstr "" -#: builtin/mv.c:140 -msgid "source directory is empty" +#: builtin/fetch.c:22 +msgid "git fetch --multiple [] [( | )...]" msgstr "" -#: builtin/mv.c:171 -msgid "not under version control" +#: builtin/fetch.c:23 +msgid "git fetch --all []" msgstr "" -#: builtin/mv.c:173 -msgid "destination exists" +#: builtin/fetch.c:60 +msgid "fetch from all remotes" msgstr "" -#: builtin/mv.c:181 -#, c-format -msgid "overwriting '%s'" +#: builtin/fetch.c:62 +msgid "append to .git/FETCH_HEAD instead of overwriting" msgstr "" -#: builtin/mv.c:184 -msgid "Cannot overwrite" +#: builtin/fetch.c:64 +msgid "path to upload pack on remote end" msgstr "" -#: builtin/mv.c:187 -msgid "multiple sources for the same target" +#: builtin/fetch.c:65 +msgid "force overwrite of local branch" msgstr "" -#: builtin/mv.c:202 -#, c-format -msgid "%s, source=%s, destination=%s" +#: builtin/fetch.c:67 +msgid "fetch from multiple remotes" msgstr "" -#: builtin/mv.c:212 -#, c-format -msgid "Renaming %s to %s\n" +#: builtin/fetch.c:69 +msgid "fetch all tags and associated objects" msgstr "" -#: builtin/mv.c:215 builtin/remote.c:731 -#, c-format -msgid "renaming '%s' failed" +#: builtin/fetch.c:71 +msgid "do not fetch all tags (--no-tags)" msgstr "" -#: builtin/notes.c:139 -#, c-format -msgid "unable to start 'show' for object '%s'" +#: builtin/fetch.c:73 +msgid "prune remote-tracking branches no longer on remote" msgstr "" -#: builtin/notes.c:145 -msgid "can't fdopen 'show' output fd" +#: builtin/fetch.c:74 +msgid "on-demand" msgstr "" -#: builtin/notes.c:155 -#, c-format -msgid "failed to close pipe to 'show' for object '%s'" +#: builtin/fetch.c:75 +msgid "control recursive fetching of submodules" msgstr "" -#: builtin/notes.c:158 -#, c-format -msgid "failed to finish 'show' for object '%s'" +#: builtin/fetch.c:79 +msgid "keep downloaded pack" msgstr "" -#: builtin/notes.c:175 builtin/tag.c:347 -#, c-format -msgid "could not create file '%s'" +#: builtin/fetch.c:81 +msgid "allow updating of HEAD ref" msgstr "" -#: builtin/notes.c:189 -msgid "Please supply the note contents using either -m or -F option" +#: builtin/fetch.c:84 +msgid "deepen history of shallow clone" msgstr "" -#: builtin/notes.c:210 builtin/notes.c:973 -#, c-format -msgid "Removing note for object %s\n" +#: builtin/fetch.c:85 builtin/log.c:1083 +msgid "dir" msgstr "" -#: builtin/notes.c:215 -msgid "unable to write note object" +#: builtin/fetch.c:86 +msgid "prepend this to submodule path output" msgstr "" -#: builtin/notes.c:217 -#, c-format -msgid "The note contents has been left in %s" +#: builtin/fetch.c:89 +msgid "default mode for recursion" msgstr "" -#: builtin/notes.c:251 builtin/tag.c:542 -#, c-format -msgid "cannot read '%s'" +#: builtin/fetch.c:201 +msgid "Couldn't find remote ref HEAD" msgstr "" -#: builtin/notes.c:253 builtin/tag.c:545 +#: builtin/fetch.c:254 #, c-format -msgid "could not open or read '%s'" +msgid "object %s not found" msgstr "" -#: builtin/notes.c:272 builtin/notes.c:445 builtin/notes.c:447 -#: builtin/notes.c:507 builtin/notes.c:561 builtin/notes.c:644 -#: builtin/notes.c:649 builtin/notes.c:724 builtin/notes.c:766 -#: builtin/notes.c:968 builtin/reset.c:293 builtin/tag.c:558 -#, c-format -msgid "Failed to resolve '%s' as a valid ref." +#: builtin/fetch.c:259 +msgid "[up to date]" msgstr "" -#: builtin/notes.c:275 +#: builtin/fetch.c:273 #, c-format -msgid "Failed to read object '%s'." +msgid "! %-*s %-*s -> %s (can't fetch in current branch)" msgstr "" -#: builtin/notes.c:299 -msgid "Cannot commit uninitialized/unreferenced notes tree" +#: builtin/fetch.c:274 builtin/fetch.c:360 +msgid "[rejected]" msgstr "" -#: builtin/notes.c:340 -#, c-format -msgid "Bad notes.rewriteMode value: '%s'" +#: builtin/fetch.c:285 +msgid "[tag update]" msgstr "" -#: builtin/notes.c:350 -#, c-format -msgid "Refusing to rewrite notes in %s (outside of refs/notes/)" +#: builtin/fetch.c:287 builtin/fetch.c:322 builtin/fetch.c:340 +msgid " (unable to update local ref)" msgstr "" -#. TRANSLATORS: The first %s is the name of the -#. environment variable, the second %s is its value -#: builtin/notes.c:377 -#, c-format -msgid "Bad %s value: '%s'" +#: builtin/fetch.c:305 +msgid "[new tag]" msgstr "" -#: builtin/notes.c:441 -#, c-format -msgid "Malformed input line: '%s'." +#: builtin/fetch.c:308 +msgid "[new branch]" msgstr "" -#: builtin/notes.c:456 -#, c-format -msgid "Failed to copy notes from '%s' to '%s'" +#: builtin/fetch.c:311 +msgid "[new ref]" msgstr "" -#: builtin/notes.c:500 builtin/notes.c:554 builtin/notes.c:627 -#: builtin/notes.c:639 builtin/notes.c:712 builtin/notes.c:759 -#: builtin/notes.c:1033 -msgid "too many parameters" +#: builtin/fetch.c:356 +msgid "unable to update local ref" msgstr "" -#: builtin/notes.c:513 builtin/notes.c:772 -#, c-format -msgid "No note found for object %s." +#: builtin/fetch.c:356 +msgid "forced update" msgstr "" -#: builtin/notes.c:580 -#, c-format -msgid "" -"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite " -"existing notes" +#: builtin/fetch.c:362 +msgid "(non-fast-forward)" msgstr "" -#: builtin/notes.c:585 builtin/notes.c:662 +#: builtin/fetch.c:393 builtin/fetch.c:685 #, c-format -msgid "Overwriting existing notes for object %s\n" -msgstr "" - -#: builtin/notes.c:635 -msgid "too few parameters" +msgid "cannot open %s: %s\n" msgstr "" -#: builtin/notes.c:656 +#: builtin/fetch.c:402 #, c-format -msgid "" -"Cannot copy notes. Found existing notes for object %s. Use '-f' to overwrite " -"existing notes" +msgid "%s did not send all necessary objects\n" msgstr "" -#: builtin/notes.c:668 +#: builtin/fetch.c:488 #, c-format -msgid "Missing notes on source object %s. Cannot copy." +msgid "From %.*s\n" msgstr "" -#: builtin/notes.c:717 +#: builtin/fetch.c:499 #, c-format 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" +"some local refs could not be updated; try running\n" +" 'git remote prune %s' to remove any old, conflicting branches" msgstr "" -#: builtin/notes.c:971 +#: builtin/fetch.c:549 #, c-format -msgid "Object %s has no note\n" +msgid " (%s will become dangling)" msgstr "" -#: builtin/notes.c:1103 builtin/remote.c:1598 +#: builtin/fetch.c:550 #, c-format -msgid "Unknown subcommand: %s" +msgid " (%s has become dangling)" msgstr "" -#: builtin/pack-objects.c:183 builtin/pack-objects.c:186 -#, c-format -msgid "deflate error (%d)" +#: builtin/fetch.c:557 +msgid "[deleted]" msgstr "" -#: builtin/pack-objects.c:2398 -#, c-format -msgid "unsupported index version %s" +#: builtin/fetch.c:558 builtin/remote.c:1055 +msgid "(none)" msgstr "" -#: builtin/pack-objects.c:2402 +#: builtin/fetch.c:675 #, c-format -msgid "bad index version '%s'" +msgid "Refusing to fetch into current branch %s of non-bare repository" msgstr "" -#: builtin/pack-objects.c:2425 +#: builtin/fetch.c:709 #, c-format -msgid "option %s does not accept negative form" +msgid "Don't know how to fetch from %s" msgstr "" -#: builtin/pack-objects.c:2429 +#: builtin/fetch.c:786 #, c-format -msgid "unable to parse value '%s' for option %s" +msgid "Option \"%s\" value \"%s\" is not valid for %s" msgstr "" -#: builtin/push.c:45 -msgid "tag shorthand without " +#: builtin/fetch.c:789 +#, c-format +msgid "Option \"%s\" is ignored for %s\n" msgstr "" -#: builtin/push.c:64 -msgid "--delete only accepts plain target ref names" +#: builtin/fetch.c:891 +#, c-format +msgid "Fetching %s\n" msgstr "" -#: builtin/push.c:99 -msgid "" -"\n" -"To choose either option permanently, see push.default in 'git help config'." +#: builtin/fetch.c:893 builtin/remote.c:100 +#, c-format +msgid "Could not fetch %s" msgstr "" -#: builtin/push.c:102 -#, c-format +#: builtin/fetch.c:912 msgid "" -"The upstream branch of your current branch does not match\n" -"the name of your current branch. To push to the upstream branch\n" -"on the remote, use\n" -"\n" -" git push %s HEAD:%s\n" -"\n" -"To push to the branch of the same name on the remote, use\n" -"\n" -" git push %s %s\n" -"%s" +"No remote repository specified. Please, specify either a URL or a\n" +"remote name from which new revisions should be fetched." msgstr "" -#: builtin/push.c:121 +#: builtin/fetch.c:932 +msgid "You need to specify a tag name." +msgstr "" + +#: builtin/fetch.c:984 +msgid "fetch --all does not take a repository argument" +msgstr "" + +#: builtin/fetch.c:986 +msgid "fetch --all does not make sense with refspecs" +msgstr "" + +#: builtin/fetch.c:997 #, c-format -msgid "" -"You are not currently on a branch.\n" -"To push the history leading to the current (detached HEAD)\n" -"state now, use\n" -"\n" -" git push %s HEAD:\n" +msgid "No such remote or remote group: %s" msgstr "" -#: builtin/push.c:128 +#: builtin/fetch.c:1005 +msgid "Fetching a group and specifying refspecs does not make sense" +msgstr "" + +#: builtin/fmt-merge-msg.c:13 +msgid "git fmt-merge-msg [-m ] [--log[=]|--no-log] [--file ]" +msgstr "" + +#: builtin/fmt-merge-msg.c:653 builtin/fmt-merge-msg.c:656 builtin/grep.c:787 +#: builtin/merge.c:188 builtin/show-branch.c:656 builtin/show-ref.c:192 +#: builtin/tag.c:448 parse-options.h:133 parse-options.h:235 +msgid "n" +msgstr "" + +#: builtin/fmt-merge-msg.c:654 +msgid "populate log with at most entries from shortlog" +msgstr "" + +#: builtin/fmt-merge-msg.c:657 +msgid "alias for --log (deprecated)" +msgstr "" + +#: builtin/fmt-merge-msg.c:660 +msgid "text" +msgstr "" + +#: builtin/fmt-merge-msg.c:661 +msgid "use as start of message" +msgstr "" + +#: builtin/fmt-merge-msg.c:662 +msgid "file to read from" +msgstr "" + +#: builtin/for-each-ref.c:979 +msgid "git for-each-ref [options] []" +msgstr "" + +#: builtin/for-each-ref.c:994 +msgid "quote placeholders suitably for shells" +msgstr "" + +#: builtin/for-each-ref.c:996 +msgid "quote placeholders suitably for perl" +msgstr "" + +#: builtin/for-each-ref.c:998 +msgid "quote placeholders suitably for python" +msgstr "" + +#: builtin/for-each-ref.c:1000 +msgid "quote placeholders suitably for tcl" +msgstr "" + +#: builtin/for-each-ref.c:1003 +msgid "show only matched refs" +msgstr "" + +#: builtin/for-each-ref.c:1004 +msgid "format" +msgstr "" + +#: builtin/for-each-ref.c:1004 +msgid "format to use for the output" +msgstr "" + +#: builtin/for-each-ref.c:1005 +msgid "key" +msgstr "" + +#: builtin/for-each-ref.c:1006 +msgid "field name to sort on" +msgstr "" + +#: builtin/fsck.c:608 +msgid "git fsck [options] [...]" +msgstr "" + +#: builtin/fsck.c:614 +msgid "show unreachable objects" +msgstr "" + +#: builtin/fsck.c:615 +msgid "show dangling objects" +msgstr "" + +#: builtin/fsck.c:616 +msgid "report tags" +msgstr "" + +#: builtin/fsck.c:617 +msgid "report root nodes" +msgstr "" + +#: builtin/fsck.c:618 +msgid "make index objects head nodes" +msgstr "" + +#: builtin/fsck.c:619 +msgid "make reflogs head nodes (default)" +msgstr "" + +#: builtin/fsck.c:620 +msgid "also consider packs and alternate objects" +msgstr "" + +#: builtin/fsck.c:621 +msgid "enable more strict checking" +msgstr "" + +#: builtin/fsck.c:623 +msgid "write dangling objects in .git/lost-found" +msgstr "" + +#: builtin/fsck.c:624 builtin/prune.c:134 +msgid "show progress" +msgstr "" + +#: builtin/gc.c:22 +msgid "git gc [options]" +msgstr "" + +#: builtin/gc.c:63 #, c-format -msgid "" -"The current branch %s has no upstream branch.\n" -"To push the current branch and set the remote as upstream, use\n" -"\n" -" git push --set-upstream %s %s\n" +msgid "Invalid %s: '%s'" msgstr "" -#: builtin/push.c:136 +#: builtin/gc.c:90 #, c-format -msgid "The current branch %s has multiple upstream branches, refusing to push." +msgid "insanely long object directory %.*s" msgstr "" -#: builtin/push.c:139 +#: builtin/gc.c:179 +msgid "prune unreferenced objects" +msgstr "" + +#: builtin/gc.c:181 +msgid "be more thorough (increased runtime)" +msgstr "" + +#: builtin/gc.c:182 +msgid "enable auto-gc mode" +msgstr "" + +#: builtin/gc.c:222 #, c-format msgid "" -"You are pushing to remote '%s', which is not the upstream of\n" -"your current branch '%s', without telling me what to push\n" -"to update which remote branch." +"Auto packing the repository for optimum performance. You may also\n" +"run \"git gc\" manually. See \"git help gc\" for more information.\n" msgstr "" -#: builtin/push.c:151 +#: builtin/gc.c:249 msgid "" -"push.default is unset; its implicit value is changing in\n" -"Git 2.0 from 'matching' to 'simple'. To squelch this message\n" -"and maintain the current behavior after the default changes, use:\n" -"\n" -" git config --global push.default matching\n" -"\n" -"To squelch this message and adopt the new behavior now, use:\n" -"\n" -" git config --global push.default simple\n" -"\n" -"See 'git help config' and search for 'push.default' for further " -"information.\n" -"(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode\n" -"'current' instead of 'simple' if you sometimes use older versions of Git)" +"There are too many unreachable loose objects; run 'git prune' to remove them." msgstr "" -#: builtin/push.c:199 -msgid "" -"You didn't specify any refspecs to push, and push.default is \"nothing\"." +#: builtin/grep.c:22 +msgid "git grep [options] [-e] [...] [[--] ...]" msgstr "" -#: builtin/push.c:206 -msgid "" -"Updates were rejected because the tip of your current branch is behind\n" -"its remote counterpart. Merge the remote changes (e.g. 'git pull')\n" -"before pushing again.\n" -"See the 'Note about fast-forwards' in 'git push --help' for details." +#: builtin/grep.c:217 +#, c-format +msgid "grep: failed to create thread: %s" +msgstr "" + +#: builtin/grep.c:455 +#, c-format +msgid "Failed to chdir: %s" +msgstr "" + +#: builtin/grep.c:531 builtin/grep.c:565 +#, c-format +msgid "unable to read tree (%s)" +msgstr "" + +#: builtin/grep.c:579 +#, c-format +msgid "unable to grep from object of type %s" +msgstr "" + +#: builtin/grep.c:637 +#, c-format +msgid "switch `%c' expects a numerical value" +msgstr "" + +#: builtin/grep.c:654 +#, c-format +msgid "cannot open '%s'" +msgstr "" + +#: builtin/grep.c:729 +msgid "search in index instead of in the work tree" +msgstr "" + +#: builtin/grep.c:731 +msgid "find in contents not managed by git" +msgstr "" + +#: builtin/grep.c:733 +msgid "search in both tracked and untracked files" +msgstr "" + +#: builtin/grep.c:735 +msgid "search also in ignored files" +msgstr "" + +#: builtin/grep.c:738 +msgid "show non-matching lines" +msgstr "" + +#: builtin/grep.c:740 +msgid "case insensitive matching" +msgstr "" + +#: builtin/grep.c:742 +msgid "match patterns only at word boundaries" +msgstr "" + +#: builtin/grep.c:744 +msgid "process binary files as text" +msgstr "" + +#: builtin/grep.c:746 +msgid "don't match patterns in binary files" +msgstr "" + +#: builtin/grep.c:749 +msgid "descend at most levels" +msgstr "" + +#: builtin/grep.c:753 +msgid "use extended POSIX regular expressions" +msgstr "" + +#: builtin/grep.c:756 +msgid "use basic POSIX regular expressions (default)" +msgstr "" + +#: builtin/grep.c:759 +msgid "interpret patterns as fixed strings" +msgstr "" + +#: builtin/grep.c:762 +msgid "use Perl-compatible regular expressions" +msgstr "" + +#: builtin/grep.c:765 +msgid "show line numbers" +msgstr "" + +#: builtin/grep.c:766 +msgid "don't show filenames" +msgstr "" + +#: builtin/grep.c:767 +msgid "show filenames" +msgstr "" + +#: builtin/grep.c:769 +msgid "show filenames relative to top directory" +msgstr "" + +#: builtin/grep.c:771 +msgid "show only filenames instead of matching lines" +msgstr "" + +#: builtin/grep.c:773 +msgid "synonym for --files-with-matches" +msgstr "" + +#: builtin/grep.c:776 +msgid "show only the names of files without match" +msgstr "" + +#: builtin/grep.c:778 +msgid "print NUL after filenames" +msgstr "" + +#: builtin/grep.c:780 +msgid "show the number of matches instead of matching lines" +msgstr "" + +#: builtin/grep.c:781 +msgid "highlight matches" +msgstr "" + +#: builtin/grep.c:783 +msgid "print empty line between matches from different files" +msgstr "" + +#: builtin/grep.c:785 +msgid "show filename only once above matches from same file" +msgstr "" + +#: builtin/grep.c:788 +msgid "show context lines before and after matches" +msgstr "" + +#: builtin/grep.c:791 +msgid "show context lines before matches" +msgstr "" + +#: builtin/grep.c:793 +msgid "show context lines after matches" +msgstr "" + +#: builtin/grep.c:794 +msgid "shortcut for -C NUM" +msgstr "" + +#: builtin/grep.c:797 +msgid "show a line with the function name before matches" +msgstr "" + +#: builtin/grep.c:799 +msgid "show the surrounding function" +msgstr "" + +#: builtin/grep.c:802 +msgid "read patterns from file" +msgstr "" + +#: builtin/grep.c:804 +msgid "match " +msgstr "" + +#: builtin/grep.c:806 +msgid "combine patterns specified with -e" +msgstr "" + +#: builtin/grep.c:818 +msgid "indicate hit with exit status without output" +msgstr "" + +#: builtin/grep.c:820 +msgid "show only matches from files that match all patterns" +msgstr "" + +#: builtin/grep.c:822 +msgid "show parse tree for grep expression" +msgstr "" + +#: builtin/grep.c:826 +msgid "pager" +msgstr "" + +#: builtin/grep.c:826 +msgid "show matching files in the pager" +msgstr "" + +#: builtin/grep.c:829 +msgid "allow calling of grep(1) (ignored by this build)" +msgstr "" + +#: builtin/grep.c:830 builtin/show-ref.c:201 +msgid "show usage" +msgstr "" + +#: builtin/grep.c:921 +msgid "no pattern given." +msgstr "" + +#: builtin/grep.c:935 +#, c-format +msgid "bad object %s" +msgstr "" + +#: builtin/grep.c:976 +msgid "--open-files-in-pager only works on the worktree" +msgstr "" + +#: builtin/grep.c:999 +msgid "--cached or --untracked cannot be used with --no-index." +msgstr "" + +#: builtin/grep.c:1004 +msgid "--no-index or --untracked cannot be used with revs." +msgstr "" + +#: builtin/grep.c:1007 +msgid "--[no-]exclude-standard cannot be used for tracked contents." +msgstr "" + +#: builtin/grep.c:1015 +msgid "both --cached and trees are given." +msgstr "" + +#: builtin/hash-object.c:60 +msgid "" +"git hash-object [-t ] [-w] [--path=|--no-filters] [--stdin] [--] " +"..." +msgstr "" + +#: builtin/hash-object.c:61 +msgid "git hash-object --stdin-paths < " +msgstr "" + +#: builtin/hash-object.c:72 +msgid "type" +msgstr "" + +#: builtin/hash-object.c:72 +msgid "object type" +msgstr "" + +#: builtin/hash-object.c:73 +msgid "write the object into the object database" +msgstr "" + +#: builtin/hash-object.c:74 +msgid "read the object from stdin" +msgstr "" + +#: builtin/hash-object.c:76 +msgid "store file as is without filters" +msgstr "" + +#: builtin/hash-object.c:77 +msgid "process file as it were from this path" +msgstr "" + +#: builtin/help.c:43 +msgid "print all available commands" +msgstr "" + +#: builtin/help.c:44 +msgid "show man page" +msgstr "" + +#: builtin/help.c:45 +msgid "show manual in web browser" +msgstr "" + +#: builtin/help.c:47 +msgid "show info page" +msgstr "" + +#: builtin/help.c:53 +msgid "git help [--all] [--man|--web|--info] [command]" +msgstr "" + +#: builtin/help.c:65 +#, c-format +msgid "unrecognized help format '%s'" +msgstr "" + +#: builtin/help.c:93 +msgid "Failed to start emacsclient." +msgstr "" + +#: builtin/help.c:106 +msgid "Failed to parse emacsclient version." +msgstr "" + +#: builtin/help.c:114 +#, c-format +msgid "emacsclient version '%d' too old (< 22)." +msgstr "" + +#: builtin/help.c:132 builtin/help.c:160 builtin/help.c:169 builtin/help.c:177 +#, c-format +msgid "failed to exec '%s': %s" +msgstr "" + +#: builtin/help.c:217 +#, c-format +msgid "" +"'%s': path for unsupported man viewer.\n" +"Please consider using 'man..cmd' instead." +msgstr "" + +#: builtin/help.c:229 +#, c-format +msgid "" +"'%s': cmd for supported man viewer.\n" +"Please consider using 'man..path' instead." +msgstr "" + +#: builtin/help.c:299 +msgid "The most commonly used git commands are:" +msgstr "" + +#: builtin/help.c:367 +#, c-format +msgid "'%s': unknown man viewer." +msgstr "" + +#: builtin/help.c:384 +msgid "no man viewer handled the request" +msgstr "" + +#: builtin/help.c:392 +msgid "no info viewer handled the request" +msgstr "" + +#: builtin/help.c:447 builtin/help.c:454 +#, c-format +msgid "usage: %s%s" +msgstr "" + +#: builtin/help.c:470 +#, c-format +msgid "`git %s' is aliased to `%s'" +msgstr "" + +#: builtin/index-pack.c:170 +#, c-format +msgid "object type mismatch at %s" +msgstr "" + +#: builtin/index-pack.c:190 +msgid "object of unexpected type" +msgstr "" + +#: builtin/index-pack.c:227 +#, c-format +msgid "cannot fill %d byte" +msgid_plural "cannot fill %d bytes" +msgstr[0] "" +msgstr[1] "" + +#: builtin/index-pack.c:237 +msgid "early EOF" +msgstr "" + +#: builtin/index-pack.c:238 +msgid "read error on input" +msgstr "" + +#: builtin/index-pack.c:250 +msgid "used more bytes than were available" +msgstr "" + +#: builtin/index-pack.c:257 +msgid "pack too large for current definition of off_t" +msgstr "" + +#: builtin/index-pack.c:273 +#, c-format +msgid "unable to create '%s'" +msgstr "" + +#: builtin/index-pack.c:278 +#, c-format +msgid "cannot open packfile '%s'" +msgstr "" + +#: builtin/index-pack.c:292 +msgid "pack signature mismatch" +msgstr "" + +#: builtin/index-pack.c:294 +#, c-format +msgid "pack version % unsupported" +msgstr "" + +#: builtin/index-pack.c:312 +#, c-format +msgid "pack has bad object at offset %lu: %s" +msgstr "" + +#: builtin/index-pack.c:434 +#, c-format +msgid "inflate returned %d" +msgstr "" + +#: builtin/index-pack.c:483 +msgid "offset value overflow for delta base object" +msgstr "" + +#: builtin/index-pack.c:491 +msgid "delta base offset is out of bound" +msgstr "" + +#: builtin/index-pack.c:499 +#, c-format +msgid "unknown object type %d" +msgstr "" + +#: builtin/index-pack.c:530 +msgid "cannot pread pack file" +msgstr "" + +#: builtin/index-pack.c:532 +#, c-format +msgid "premature end of pack file, %lu byte missing" +msgid_plural "premature end of pack file, %lu bytes missing" +msgstr[0] "" +msgstr[1] "" + +#: builtin/index-pack.c:558 +msgid "serious inflate inconsistency" +msgstr "" + +#: builtin/index-pack.c:649 builtin/index-pack.c:655 builtin/index-pack.c:678 +#: builtin/index-pack.c:712 builtin/index-pack.c:721 +#, c-format +msgid "SHA1 COLLISION FOUND WITH %s !" +msgstr "" + +#: builtin/index-pack.c:652 builtin/pack-objects.c:170 +#: builtin/pack-objects.c:262 +#, c-format +msgid "unable to read %s" +msgstr "" + +#: builtin/index-pack.c:718 +#, c-format +msgid "cannot read existing object %s" +msgstr "" + +#: builtin/index-pack.c:732 +#, c-format +msgid "invalid blob object %s" +msgstr "" + +#: builtin/index-pack.c:747 +#, c-format +msgid "invalid %s" +msgstr "" + +#: builtin/index-pack.c:749 +msgid "Error in object" +msgstr "" + +#: builtin/index-pack.c:751 +#, c-format +msgid "Not all child objects of %s are reachable" +msgstr "" + +#: builtin/index-pack.c:821 builtin/index-pack.c:847 +msgid "failed to apply delta" +msgstr "" + +#: builtin/index-pack.c:986 +msgid "Receiving objects" +msgstr "" + +#: builtin/index-pack.c:986 +msgid "Indexing objects" +msgstr "" + +#: builtin/index-pack.c:1012 +msgid "pack is corrupted (SHA1 mismatch)" +msgstr "" + +#: builtin/index-pack.c:1017 +msgid "cannot fstat packfile" +msgstr "" + +#: builtin/index-pack.c:1020 +msgid "pack has junk at the end" +msgstr "" + +#: builtin/index-pack.c:1031 +msgid "confusion beyond insanity in parse_pack_objects()" +msgstr "" + +#: builtin/index-pack.c:1054 +msgid "Resolving deltas" +msgstr "" + +#: builtin/index-pack.c:1064 +#, c-format +msgid "unable to create thread: %s" +msgstr "" + +#: builtin/index-pack.c:1106 +msgid "confusion beyond insanity" +msgstr "" + +#: builtin/index-pack.c:1112 +#, c-format +msgid "completed with %d local objects" +msgstr "" + +#: builtin/index-pack.c:1121 +#, c-format +msgid "Unexpected tail checksum for %s (disk corruption?)" +msgstr "" + +#: builtin/index-pack.c:1125 +#, c-format +msgid "pack has %d unresolved delta" +msgid_plural "pack has %d unresolved deltas" +msgstr[0] "" +msgstr[1] "" + +#: builtin/index-pack.c:1150 +#, c-format +msgid "unable to deflate appended object (%d)" +msgstr "" + +#: builtin/index-pack.c:1229 +#, c-format +msgid "local object %s is corrupt" +msgstr "" + +#: builtin/index-pack.c:1253 +msgid "error while closing pack file" +msgstr "" + +#: builtin/index-pack.c:1266 +#, c-format +msgid "cannot write keep file '%s'" +msgstr "" + +#: builtin/index-pack.c:1274 +#, c-format +msgid "cannot close written keep file '%s'" +msgstr "" + +#: builtin/index-pack.c:1287 +msgid "cannot store pack file" +msgstr "" + +#: builtin/index-pack.c:1298 +msgid "cannot store index file" +msgstr "" + +#: builtin/index-pack.c:1331 +#, c-format +msgid "bad pack.indexversion=%" +msgstr "" + +#: builtin/index-pack.c:1337 +#, c-format +msgid "invalid number of threads specified (%d)" +msgstr "" + +#: builtin/index-pack.c:1341 builtin/index-pack.c:1514 +#, c-format +msgid "no threads support, ignoring %s" +msgstr "" + +#: builtin/index-pack.c:1399 +#, c-format +msgid "Cannot open existing pack file '%s'" +msgstr "" + +#: builtin/index-pack.c:1401 +#, c-format +msgid "Cannot open existing pack idx file for '%s'" +msgstr "" + +#: builtin/index-pack.c:1448 +#, c-format +msgid "non delta: %d object" +msgid_plural "non delta: %d objects" +msgstr[0] "" +msgstr[1] "" + +#: builtin/index-pack.c:1455 +#, c-format +msgid "chain length = %d: %lu object" +msgid_plural "chain length = %d: %lu objects" +msgstr[0] "" +msgstr[1] "" + +#: builtin/index-pack.c:1482 +msgid "Cannot come back to cwd" +msgstr "" + +#: builtin/index-pack.c:1526 builtin/index-pack.c:1529 +#: builtin/index-pack.c:1541 builtin/index-pack.c:1545 +#, c-format +msgid "bad %s" +msgstr "" + +#: builtin/index-pack.c:1559 +msgid "--fix-thin cannot be used without --stdin" +msgstr "" + +#: builtin/index-pack.c:1563 builtin/index-pack.c:1573 +#, c-format +msgid "packfile name '%s' does not end with '.pack'" +msgstr "" + +#: builtin/index-pack.c:1582 +msgid "--verify with no packfile name given" +msgstr "" + +#: builtin/init-db.c:35 +#, c-format +msgid "Could not make %s writable by group" +msgstr "" + +#: builtin/init-db.c:62 +#, c-format +msgid "insanely long template name %s" +msgstr "" + +#: builtin/init-db.c:67 +#, c-format +msgid "cannot stat '%s'" +msgstr "" + +#: builtin/init-db.c:73 +#, c-format +msgid "cannot stat template '%s'" +msgstr "" + +#: builtin/init-db.c:80 +#, c-format +msgid "cannot opendir '%s'" +msgstr "" + +#: builtin/init-db.c:97 +#, c-format +msgid "cannot readlink '%s'" +msgstr "" + +#: builtin/init-db.c:99 +#, c-format +msgid "insanely long symlink %s" +msgstr "" + +#: builtin/init-db.c:102 +#, c-format +msgid "cannot symlink '%s' '%s'" +msgstr "" + +#: builtin/init-db.c:106 +#, c-format +msgid "cannot copy '%s' to '%s'" +msgstr "" + +#: builtin/init-db.c:110 +#, c-format +msgid "ignoring template %s" +msgstr "" + +#: builtin/init-db.c:133 +#, c-format +msgid "insanely long template path %s" +msgstr "" + +#: builtin/init-db.c:141 +#, c-format +msgid "templates not found %s" +msgstr "" + +#: builtin/init-db.c:154 +#, c-format +msgid "not copying templates of a wrong format version %d from '%s'" +msgstr "" + +#: builtin/init-db.c:192 +#, c-format +msgid "insane git directory %s" +msgstr "" + +#: builtin/init-db.c:323 builtin/init-db.c:326 +#, c-format +msgid "%s already exists" +msgstr "" + +#: builtin/init-db.c:355 +#, c-format +msgid "unable to handle file type %d" +msgstr "" + +#: builtin/init-db.c:358 +#, c-format +msgid "unable to move %s to %s" +msgstr "" + +#: builtin/init-db.c:363 +#, c-format +msgid "Could not create git link %s" +msgstr "" + +#. +#. * TRANSLATORS: The first '%s' is either "Reinitialized +#. * existing" or "Initialized empty", the second " shared" or +#. * "", and the last '%s%s' is the verbatim directory name. +#. +#: builtin/init-db.c:420 +#, c-format +msgid "%s%s Git repository in %s%s\n" +msgstr "" + +#: builtin/init-db.c:421 +msgid "Reinitialized existing" +msgstr "" + +#: builtin/init-db.c:421 +msgid "Initialized empty" +msgstr "" + +#: builtin/init-db.c:422 +msgid " shared" +msgstr "" + +#: builtin/init-db.c:441 +msgid "cannot tell cwd" +msgstr "" + +#: builtin/init-db.c:467 +msgid "" +"git init [-q | --quiet] [--bare] [--template=] [--shared" +"[=]] [directory]" +msgstr "" + +#: builtin/init-db.c:490 +msgid "permissions" +msgstr "" + +#: builtin/init-db.c:491 +msgid "specify that the git repository is to be shared amongst several users" +msgstr "" + +#: builtin/init-db.c:493 builtin/prune-packed.c:77 +msgid "be quiet" +msgstr "" + +#: builtin/init-db.c:522 builtin/init-db.c:529 +#, c-format +msgid "cannot mkdir %s" +msgstr "" + +#: builtin/init-db.c:533 +#, c-format +msgid "cannot chdir to %s" +msgstr "" + +#: builtin/init-db.c:555 +#, c-format +msgid "" +"%s (or --work-tree=) not allowed without specifying %s (or --git-" +"dir=)" +msgstr "" + +#: builtin/init-db.c:579 +msgid "Cannot access current working directory" +msgstr "" + +#: builtin/init-db.c:586 +#, c-format +msgid "Cannot access work tree '%s'" +msgstr "" + +#: builtin/log.c:37 +msgid "git log [] [..] [[--] ...]\n" +msgstr "" + +#: builtin/log.c:38 +msgid " or: git show [options] ..." +msgstr "" + +#: builtin/log.c:100 +msgid "suppress diff output" +msgstr "" + +#: builtin/log.c:101 +msgid "show source" +msgstr "" + +#: builtin/log.c:102 +msgid "decorate options" +msgstr "" + +#: builtin/log.c:189 +#, c-format +msgid "Final output: %d %s\n" +msgstr "" + +#: builtin/log.c:403 builtin/log.c:494 +#, c-format +msgid "Could not read object %s" +msgstr "" + +#: builtin/log.c:518 +#, c-format +msgid "Unknown type: %d" +msgstr "" + +#: builtin/log.c:608 +msgid "format.headers without value" +msgstr "" + +#: builtin/log.c:682 +msgid "name of output directory is too long" +msgstr "" + +#: builtin/log.c:693 +#, c-format +msgid "Cannot open patch file %s" +msgstr "" + +#: builtin/log.c:707 +msgid "Need exactly one range." +msgstr "" + +#: builtin/log.c:715 +msgid "Not a range." +msgstr "" + +#: builtin/log.c:789 +msgid "Cover letter needs email format" +msgstr "" + +#: builtin/log.c:862 +#, c-format +msgid "insane in-reply-to: %s" +msgstr "" + +#: builtin/log.c:890 +msgid "git format-patch [options] [ | ]" +msgstr "" + +#: builtin/log.c:935 +msgid "Two output directories?" +msgstr "" + +#: builtin/log.c:1063 +msgid "use [PATCH n/m] even with a single patch" +msgstr "" + +#: builtin/log.c:1066 +msgid "use [PATCH] even with multiple patches" +msgstr "" + +#: builtin/log.c:1070 +msgid "print patches to standard out" +msgstr "" + +#: builtin/log.c:1072 +msgid "generate a cover letter" +msgstr "" + +#: builtin/log.c:1074 +msgid "use simple number sequence for output file names" +msgstr "" + +#: builtin/log.c:1075 +msgid "sfx" +msgstr "" + +#: builtin/log.c:1076 +msgid "use instead of '.patch'" +msgstr "" + +#: builtin/log.c:1078 +msgid "start numbering patches at instead of 1" +msgstr "" + +#: builtin/log.c:1080 +msgid "Use [] instead of [PATCH]" +msgstr "" + +#: builtin/log.c:1083 +msgid "store resulting files in " +msgstr "" + +#: builtin/log.c:1086 +msgid "don't strip/add [PATCH]" +msgstr "" + +#: builtin/log.c:1089 +msgid "don't output binary diffs" +msgstr "" + +#: builtin/log.c:1091 +msgid "don't include a patch matching a commit upstream" +msgstr "" + +#: builtin/log.c:1093 +msgid "show patch format instead of default (patch + stat)" +msgstr "" + +#: builtin/log.c:1095 +msgid "Messaging" +msgstr "" + +#: builtin/log.c:1096 +msgid "header" +msgstr "" + +#: builtin/log.c:1097 +msgid "add email header" +msgstr "" + +#: builtin/log.c:1098 builtin/log.c:1100 +msgid "email" +msgstr "" + +#: builtin/log.c:1098 +msgid "add To: header" +msgstr "" + +#: builtin/log.c:1100 +msgid "add Cc: header" +msgstr "" + +#: builtin/log.c:1102 +msgid "message-id" +msgstr "" + +#: builtin/log.c:1103 +msgid "make first mail a reply to " +msgstr "" + +#: builtin/log.c:1104 builtin/log.c:1107 +msgid "boundary" +msgstr "" + +#: builtin/log.c:1105 +msgid "attach the patch" +msgstr "" + +#: builtin/log.c:1108 +msgid "inline the patch" +msgstr "" + +#: builtin/log.c:1112 +msgid "enable message threading, styles: shallow, deep" +msgstr "" + +#: builtin/log.c:1114 +msgid "signature" +msgstr "" + +#: builtin/log.c:1115 +msgid "add a signature" +msgstr "" + +#: builtin/log.c:1117 +msgid "don't print the patch filenames" +msgstr "" + +#: builtin/log.c:1157 +#, c-format +msgid "bogus committer info %s" +msgstr "" + +#: builtin/log.c:1202 +msgid "-n and -k are mutually exclusive." +msgstr "" + +#: builtin/log.c:1204 +msgid "--subject-prefix and -k are mutually exclusive." +msgstr "" + +#: builtin/log.c:1212 +msgid "--name-only does not make sense" +msgstr "" + +#: builtin/log.c:1214 +msgid "--name-status does not make sense" +msgstr "" + +#: builtin/log.c:1216 +msgid "--check does not make sense" +msgstr "" + +#: builtin/log.c:1239 +msgid "standard output, or directory, which one?" +msgstr "" + +#: builtin/log.c:1241 +#, c-format +msgid "Could not create directory '%s'" +msgstr "" + +#: builtin/log.c:1394 +msgid "Failed to create output files" +msgstr "" + +#: builtin/log.c:1443 +msgid "git cherry [-v] [ [ []]]" +msgstr "" + +#: builtin/log.c:1498 +#, c-format +msgid "" +"Could not find a tracked remote branch, please specify manually.\n" +msgstr "" + +#: builtin/log.c:1511 builtin/log.c:1513 builtin/log.c:1525 +#, c-format +msgid "Unknown commit %s" +msgstr "" + +#: builtin/ls-files.c:408 +msgid "git ls-files [options] [...]" +msgstr "" + +#: builtin/ls-files.c:463 +msgid "identify the file status with tags" +msgstr "" + +#: builtin/ls-files.c:465 +msgid "use lowercase letters for 'assume unchanged' files" +msgstr "" + +#: builtin/ls-files.c:467 +msgid "show cached files in the output (default)" +msgstr "" + +#: builtin/ls-files.c:469 +msgid "show deleted files in the output" +msgstr "" + +#: builtin/ls-files.c:471 +msgid "show modified files in the output" +msgstr "" + +#: builtin/ls-files.c:473 +msgid "show other files in the output" +msgstr "" + +#: builtin/ls-files.c:475 +msgid "show ignored files in the output" +msgstr "" + +#: builtin/ls-files.c:478 +msgid "show staged contents' object name in the output" +msgstr "" + +#: builtin/ls-files.c:480 +msgid "show files on the filesystem that need to be removed" +msgstr "" + +#: builtin/ls-files.c:482 +msgid "show 'other' directories' name only" +msgstr "" + +#: builtin/ls-files.c:485 +msgid "don't show empty directories" +msgstr "" + +#: builtin/ls-files.c:488 +msgid "show unmerged files in the output" +msgstr "" + +#: builtin/ls-files.c:490 +msgid "show resolve-undo information" +msgstr "" + +#: builtin/ls-files.c:492 +msgid "skip files matching pattern" +msgstr "" + +#: builtin/ls-files.c:495 +msgid "exclude patterns are read from " +msgstr "" + +#: builtin/ls-files.c:498 +msgid "read additional per-directory exclude patterns in " +msgstr "" + +#: builtin/ls-files.c:500 +msgid "add the standard git exclusions" +msgstr "" + +#: builtin/ls-files.c:503 +msgid "make the output relative to the project top directory" +msgstr "" + +#: builtin/ls-files.c:506 +msgid "if any is not in the index, treat this as an error" +msgstr "" + +#: builtin/ls-files.c:507 +msgid "tree-ish" +msgstr "" + +#: builtin/ls-files.c:508 +msgid "pretend that paths removed since are still present" +msgstr "" + +#: builtin/ls-files.c:510 +msgid "show debugging data" +msgstr "" + +#: builtin/ls-tree.c:27 +msgid "git ls-tree [] [...]" +msgstr "" + +#: builtin/ls-tree.c:125 +msgid "only show trees" +msgstr "" + +#: builtin/ls-tree.c:127 +msgid "recurse into subtrees" +msgstr "" + +#: builtin/ls-tree.c:129 +msgid "show trees when recursing" +msgstr "" + +#: builtin/ls-tree.c:132 +msgid "terminate entries with NUL byte" +msgstr "" + +#: builtin/ls-tree.c:133 +msgid "include object size" +msgstr "" + +#: builtin/ls-tree.c:135 builtin/ls-tree.c:137 +msgid "list only filenames" +msgstr "" + +#: builtin/ls-tree.c:140 +msgid "use full path names" +msgstr "" + +#: builtin/ls-tree.c:142 +msgid "list entire tree; not just current directory (implies --full-name)" +msgstr "" + +#: builtin/merge.c:43 +msgid "git merge [options] [...]" +msgstr "" + +#: builtin/merge.c:44 +msgid "git merge [options] HEAD " +msgstr "" + +#: builtin/merge.c:45 +msgid "git merge --abort" +msgstr "" + +#: builtin/merge.c:90 +msgid "switch `m' requires a value" +msgstr "" + +#: builtin/merge.c:127 +#, c-format +msgid "Could not find merge strategy '%s'.\n" +msgstr "" + +#: builtin/merge.c:128 +#, c-format +msgid "Available strategies are:" +msgstr "" + +#: builtin/merge.c:133 +#, c-format +msgid "Available custom strategies are:" +msgstr "" + +#: builtin/merge.c:183 +msgid "do not show a diffstat at the end of the merge" +msgstr "" + +#: builtin/merge.c:186 +msgid "show a diffstat at the end of the merge" +msgstr "" + +#: builtin/merge.c:187 +msgid "(synonym to --stat)" +msgstr "" + +#: builtin/merge.c:189 +msgid "add (at most ) entries from shortlog to merge commit message" +msgstr "" + +#: builtin/merge.c:192 +msgid "create a single commit instead of doing a merge" +msgstr "" + +#: builtin/merge.c:194 +msgid "perform a commit if the merge succeeds (default)" +msgstr "" + +#: builtin/merge.c:196 +msgid "edit message before committing" +msgstr "" + +#: builtin/merge.c:198 +msgid "allow fast-forward (default)" +msgstr "" + +#: builtin/merge.c:200 +msgid "abort if fast-forward is not possible" +msgstr "" + +#: builtin/merge.c:202 builtin/notes.c:870 builtin/revert.c:112 +msgid "strategy" +msgstr "" + +#: builtin/merge.c:203 +msgid "merge strategy to use" +msgstr "" + +#: builtin/merge.c:204 +msgid "option=value" +msgstr "" + +#: builtin/merge.c:205 +msgid "option for selected merge strategy" +msgstr "" + +#: builtin/merge.c:207 +msgid "merge commit message (for a non-fast-forward merge)" +msgstr "" + +#: builtin/merge.c:211 +msgid "abort the current in-progress merge" +msgstr "" + +#: builtin/merge.c:240 +msgid "could not run stash." +msgstr "" + +#: builtin/merge.c:245 +msgid "stash failed" +msgstr "" + +#: builtin/merge.c:250 +#, c-format +msgid "not a valid object: %s" +msgstr "" + +#: builtin/merge.c:269 builtin/merge.c:286 +msgid "read-tree failed" +msgstr "" + +#: builtin/merge.c:316 +msgid " (nothing to squash)" +msgstr "" + +#: builtin/merge.c:329 +#, c-format +msgid "Squash commit -- not updating HEAD\n" +msgstr "" + +#: builtin/merge.c:361 +msgid "Writing SQUASH_MSG" +msgstr "" + +#: builtin/merge.c:363 +msgid "Finishing SQUASH_MSG" +msgstr "" + +#: builtin/merge.c:386 +#, c-format +msgid "No merge message -- not updating HEAD\n" +msgstr "" + +#: builtin/merge.c:436 +#, c-format +msgid "'%s' does not point to a commit" +msgstr "" + +#: builtin/merge.c:535 +#, c-format +msgid "Bad branch.%s.mergeoptions string: %s" +msgstr "" + +#: builtin/merge.c:628 +msgid "git write-tree failed to write a tree" +msgstr "" + +#: builtin/merge.c:678 +msgid "failed to read the cache" +msgstr "" + +#: builtin/merge.c:709 +msgid "Not handling anything other than two heads merge." +msgstr "" + +#: builtin/merge.c:723 +#, c-format +msgid "Unknown option for merge-recursive: -X%s" +msgstr "" + +#: builtin/merge.c:737 +#, c-format +msgid "unable to write %s" +msgstr "" + +#: builtin/merge.c:876 +#, c-format +msgid "Could not read from '%s'" +msgstr "" + +#: builtin/merge.c:885 +#, c-format +msgid "Not committing merge; use 'git commit' to complete the merge.\n" +msgstr "" + +#: builtin/merge.c:891 +msgid "" +"Please enter a commit message to explain why this merge is necessary,\n" +"especially if it merges an updated upstream into a topic branch.\n" +"\n" +"Lines starting with '#' will be ignored, and an empty message aborts\n" +"the commit.\n" +msgstr "" + +#: builtin/merge.c:915 +msgid "Empty commit message." +msgstr "" + +#: builtin/merge.c:927 +#, c-format +msgid "Wonderful.\n" +msgstr "" + +#: builtin/merge.c:992 +#, c-format +msgid "Automatic merge failed; fix conflicts and then commit the result.\n" +msgstr "" + +#: builtin/merge.c:1008 +#, c-format +msgid "'%s' is not a commit" +msgstr "" + +#: builtin/merge.c:1049 +msgid "No current branch." +msgstr "" + +#: builtin/merge.c:1051 +msgid "No remote for the current branch." +msgstr "" + +#: builtin/merge.c:1053 +msgid "No default upstream defined for the current branch." +msgstr "" + +#: builtin/merge.c:1058 +#, c-format +msgid "No remote tracking branch for %s from %s" +msgstr "" + +#: builtin/merge.c:1145 builtin/merge.c:1302 +#, c-format +msgid "%s - not something we can merge" +msgstr "" + +#: builtin/merge.c:1213 +msgid "There is no merge to abort (MERGE_HEAD missing)." +msgstr "" + +#: builtin/merge.c:1229 git-pull.sh:31 +msgid "" +"You have not concluded your merge (MERGE_HEAD exists).\n" +"Please, commit your changes before you can merge." +msgstr "" + +#: builtin/merge.c:1232 git-pull.sh:34 +msgid "You have not concluded your merge (MERGE_HEAD exists)." +msgstr "" + +#: builtin/merge.c:1236 +msgid "" +"You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n" +"Please, commit your changes before you can merge." +msgstr "" + +#: builtin/merge.c:1239 +msgid "You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)." +msgstr "" + +#: builtin/merge.c:1248 +msgid "You cannot combine --squash with --no-ff." +msgstr "" + +#: builtin/merge.c:1253 +msgid "You cannot combine --no-ff with --ff-only." +msgstr "" + +#: builtin/merge.c:1260 +msgid "No commit specified and merge.defaultToUpstream not set." +msgstr "" + +#: builtin/merge.c:1292 +msgid "Can merge only exactly one commit into empty head" +msgstr "" + +#: builtin/merge.c:1295 +msgid "Squash commit into empty head not supported yet" +msgstr "" + +#: builtin/merge.c:1297 +msgid "Non-fast-forward commit does not make sense into an empty head" +msgstr "" + +#: builtin/merge.c:1412 +#, c-format +msgid "Updating %s..%s\n" +msgstr "" + +#: builtin/merge.c:1450 +#, c-format +msgid "Trying really trivial in-index merge...\n" +msgstr "" + +#: builtin/merge.c:1457 +#, c-format +msgid "Nope.\n" +msgstr "" + +#: builtin/merge.c:1489 +msgid "Not possible to fast-forward, aborting." +msgstr "" + +#: builtin/merge.c:1512 builtin/merge.c:1591 +#, c-format +msgid "Rewinding the tree to pristine...\n" +msgstr "" + +#: builtin/merge.c:1516 +#, c-format +msgid "Trying merge strategy %s...\n" +msgstr "" + +#: builtin/merge.c:1582 +#, c-format +msgid "No merge strategy handled the merge.\n" +msgstr "" + +#: builtin/merge.c:1584 +#, c-format +msgid "Merge with strategy %s failed.\n" +msgstr "" + +#: builtin/merge.c:1593 +#, c-format +msgid "Using the %s to prepare resolving by hand.\n" +msgstr "" + +#: builtin/merge.c:1605 +#, c-format +msgid "Automatic merge went well; stopped before committing as requested\n" +msgstr "" + +#: builtin/merge-base.c:26 +msgid "git merge-base [-a|--all] ..." +msgstr "" + +#: builtin/merge-base.c:27 +msgid "git merge-base [-a|--all] --octopus ..." +msgstr "" + +#: builtin/merge-base.c:28 +msgid "git merge-base --independent ..." +msgstr "" + +#: builtin/merge-base.c:29 +msgid "git merge-base --is-ancestor " +msgstr "" + +#: builtin/merge-base.c:98 +msgid "output all common ancestors" +msgstr "" + +#: builtin/merge-base.c:99 +msgid "find ancestors for a single n-way merge" +msgstr "" + +#: builtin/merge-base.c:100 +msgid "list revs not reachable from others" +msgstr "" + +#: builtin/merge-base.c:102 +msgid "is the first one ancestor of the other?" +msgstr "" + +#: builtin/merge-file.c:8 +msgid "" +"git merge-file [options] [-L name1 [-L orig [-L name2]]] file1 orig_file " +"file2" +msgstr "" + +#: builtin/merge-file.c:33 +msgid "send results to standard output" +msgstr "" + +#: builtin/merge-file.c:34 +msgid "use a diff3 based merge" +msgstr "" + +#: builtin/merge-file.c:35 +msgid "for conflicts, use our version" +msgstr "" + +#: builtin/merge-file.c:37 +msgid "for conflicts, use their version" +msgstr "" + +#: builtin/merge-file.c:39 +msgid "for conflicts, use a union version" +msgstr "" + +#: builtin/merge-file.c:42 +msgid "for conflicts, use this marker size" +msgstr "" + +#: builtin/merge-file.c:43 +msgid "do not warn about conflicts" +msgstr "" + +#: builtin/merge-file.c:45 +msgid "set labels for file1/orig_file/file2" +msgstr "" + +#: builtin/mktree.c:67 +msgid "git mktree [-z] [--missing] [--batch]" +msgstr "" + +#: builtin/mktree.c:153 +msgid "input is NUL terminated" +msgstr "" + +#: builtin/mktree.c:154 builtin/write-tree.c:24 +msgid "allow missing objects" +msgstr "" + +#: builtin/mktree.c:155 +msgid "allow creation of more than one tree" +msgstr "" + +#: builtin/mv.c:14 +msgid "git mv [options] ... " +msgstr "" + +#: builtin/mv.c:64 +msgid "force move/rename even if target exists" +msgstr "" + +#: builtin/mv.c:65 +msgid "skip move/rename errors" +msgstr "" + +#: builtin/mv.c:108 +#, c-format +msgid "Checking rename of '%s' to '%s'\n" +msgstr "" + +#: builtin/mv.c:112 +msgid "bad source" +msgstr "" + +#: builtin/mv.c:115 +msgid "can not move directory into itself" +msgstr "" + +#: builtin/mv.c:118 +msgid "cannot move directory over file" +msgstr "" + +#: builtin/mv.c:128 +#, c-format +msgid "Huh? %.*s is in index?" +msgstr "" + +#: builtin/mv.c:140 +msgid "source directory is empty" +msgstr "" + +#: builtin/mv.c:171 +msgid "not under version control" +msgstr "" + +#: builtin/mv.c:173 +msgid "destination exists" +msgstr "" + +#: builtin/mv.c:181 +#, c-format +msgid "overwriting '%s'" +msgstr "" + +#: builtin/mv.c:184 +msgid "Cannot overwrite" +msgstr "" + +#: builtin/mv.c:187 +msgid "multiple sources for the same target" +msgstr "" + +#: builtin/mv.c:202 +#, c-format +msgid "%s, source=%s, destination=%s" +msgstr "" + +#: builtin/mv.c:212 +#, c-format +msgid "Renaming %s to %s\n" +msgstr "" + +#: builtin/mv.c:215 builtin/remote.c:731 +#, c-format +msgid "renaming '%s' failed" +msgstr "" + +#: builtin/name-rev.c:175 +msgid "git name-rev [options] ..." +msgstr "" + +#: builtin/name-rev.c:176 +msgid "git name-rev [options] --all" +msgstr "" + +#: builtin/name-rev.c:177 +msgid "git name-rev [options] --stdin" +msgstr "" + +#: builtin/name-rev.c:229 +msgid "print only names (no SHA-1)" +msgstr "" + +#: builtin/name-rev.c:230 +msgid "only use tags to name the commits" +msgstr "" + +#: builtin/name-rev.c:232 +msgid "only use refs matching " +msgstr "" + +#: builtin/name-rev.c:234 +msgid "list all commits reachable from all refs" +msgstr "" + +#: builtin/name-rev.c:235 +msgid "read from stdin" +msgstr "" + +#: builtin/name-rev.c:236 +msgid "allow to print `undefined` names" +msgstr "" + +#: builtin/notes.c:26 +msgid "git notes [--ref ] [list []]" +msgstr "" + +#: builtin/notes.c:27 +msgid "" +"git notes [--ref ] add [-f] [-m | -F | (-c | -C) " +"] []" +msgstr "" + +#: builtin/notes.c:28 +msgid "git notes [--ref ] copy [-f] " +msgstr "" + +#: builtin/notes.c:29 +msgid "" +"git notes [--ref ] append [-m | -F | (-c | -C) " +"] []" +msgstr "" + +#: builtin/notes.c:30 +msgid "git notes [--ref ] edit []" +msgstr "" + +#: builtin/notes.c:31 +msgid "git notes [--ref ] show []" +msgstr "" + +#: builtin/notes.c:32 +msgid "" +"git notes [--ref ] merge [-v | -q] [-s ] " +msgstr "" + +#: builtin/notes.c:33 +msgid "git notes merge --commit [-v | -q]" +msgstr "" + +#: builtin/notes.c:34 +msgid "git notes merge --abort [-v | -q]" +msgstr "" + +#: builtin/notes.c:35 +msgid "git notes [--ref ] remove [...]" +msgstr "" + +#: builtin/notes.c:36 +msgid "git notes [--ref ] prune [-n | -v]" +msgstr "" + +#: builtin/notes.c:37 +msgid "git notes [--ref ] get-ref" +msgstr "" + +#: builtin/notes.c:42 +msgid "git notes [list []]" +msgstr "" + +#: builtin/notes.c:47 +msgid "git notes add [] []" +msgstr "" + +#: builtin/notes.c:52 +msgid "git notes copy [] " +msgstr "" + +#: builtin/notes.c:53 +msgid "git notes copy --stdin [ ]..." +msgstr "" + +#: builtin/notes.c:58 +msgid "git notes append [] []" +msgstr "" + +#: builtin/notes.c:63 +msgid "git notes edit []" +msgstr "" + +#: builtin/notes.c:68 +msgid "git notes show []" +msgstr "" + +#: builtin/notes.c:73 +msgid "git notes merge [] " +msgstr "" + +#: builtin/notes.c:74 +msgid "git notes merge --commit []" +msgstr "" + +#: builtin/notes.c:75 +msgid "git notes merge --abort []" +msgstr "" + +#: builtin/notes.c:80 +msgid "git notes remove []" +msgstr "" + +#: builtin/notes.c:85 +msgid "git notes prune []" +msgstr "" + +#: builtin/notes.c:90 +msgid "git notes get-ref" +msgstr "" + +#: builtin/notes.c:142 +#, c-format +msgid "unable to start 'show' for object '%s'" +msgstr "" + +#: builtin/notes.c:148 +msgid "can't fdopen 'show' output fd" +msgstr "" + +#: builtin/notes.c:158 +#, c-format +msgid "failed to close pipe to 'show' for object '%s'" +msgstr "" + +#: builtin/notes.c:161 +#, c-format +msgid "failed to finish 'show' for object '%s'" +msgstr "" + +#: builtin/notes.c:178 builtin/tag.c:347 +#, c-format +msgid "could not create file '%s'" +msgstr "" + +#: builtin/notes.c:192 +msgid "Please supply the note contents using either -m or -F option" +msgstr "" + +#: builtin/notes.c:213 builtin/notes.c:976 +#, c-format +msgid "Removing note for object %s\n" +msgstr "" + +#: builtin/notes.c:218 +msgid "unable to write note object" +msgstr "" + +#: builtin/notes.c:220 +#, c-format +msgid "The note contents has been left in %s" +msgstr "" + +#: builtin/notes.c:254 builtin/tag.c:542 +#, c-format +msgid "cannot read '%s'" +msgstr "" + +#: builtin/notes.c:256 builtin/tag.c:545 +#, c-format +msgid "could not open or read '%s'" +msgstr "" + +#: builtin/notes.c:275 builtin/notes.c:448 builtin/notes.c:450 +#: builtin/notes.c:510 builtin/notes.c:564 builtin/notes.c:647 +#: builtin/notes.c:652 builtin/notes.c:727 builtin/notes.c:769 +#: builtin/notes.c:971 builtin/reset.c:293 builtin/tag.c:558 +#, c-format +msgid "Failed to resolve '%s' as a valid ref." +msgstr "" + +#: builtin/notes.c:278 +#, c-format +msgid "Failed to read object '%s'." +msgstr "" + +#: builtin/notes.c:302 +msgid "Cannot commit uninitialized/unreferenced notes tree" +msgstr "" + +#: builtin/notes.c:343 +#, c-format +msgid "Bad notes.rewriteMode value: '%s'" +msgstr "" + +#: builtin/notes.c:353 +#, c-format +msgid "Refusing to rewrite notes in %s (outside of refs/notes/)" +msgstr "" + +#. TRANSLATORS: The first %s is the name of the +#. environment variable, the second %s is its value +#: builtin/notes.c:380 +#, c-format +msgid "Bad %s value: '%s'" +msgstr "" + +#: builtin/notes.c:444 +#, c-format +msgid "Malformed input line: '%s'." +msgstr "" + +#: builtin/notes.c:459 +#, c-format +msgid "Failed to copy notes from '%s' to '%s'" +msgstr "" + +#: builtin/notes.c:503 builtin/notes.c:557 builtin/notes.c:630 +#: builtin/notes.c:642 builtin/notes.c:715 builtin/notes.c:762 +#: builtin/notes.c:1036 +msgid "too many parameters" +msgstr "" + +#: builtin/notes.c:516 builtin/notes.c:775 +#, c-format +msgid "No note found for object %s." +msgstr "" + +#: builtin/notes.c:538 builtin/notes.c:695 +msgid "note contents as a string" +msgstr "" + +#: builtin/notes.c:541 builtin/notes.c:698 +msgid "note contents in a file" +msgstr "" + +#: builtin/notes.c:543 builtin/notes.c:546 builtin/notes.c:700 +#: builtin/notes.c:703 builtin/tag.c:476 +msgid "object" +msgstr "" + +#: builtin/notes.c:544 builtin/notes.c:701 +msgid "reuse and edit specified note object" +msgstr "" + +#: builtin/notes.c:547 builtin/notes.c:704 +msgid "reuse specified note object" +msgstr "" + +#: builtin/notes.c:549 builtin/notes.c:617 +msgid "replace existing notes" +msgstr "" + +#: builtin/notes.c:583 +#, c-format +msgid "" +"Cannot add notes. Found existing notes for object %s. Use '-f' to overwrite " +"existing notes" +msgstr "" + +#: builtin/notes.c:588 builtin/notes.c:665 +#, c-format +msgid "Overwriting existing notes for object %s\n" +msgstr "" + +#: builtin/notes.c:618 +msgid "read objects from stdin" +msgstr "" + +#: builtin/notes.c:620 +msgid "load rewriting config for (implies --stdin)" +msgstr "" + +#: builtin/notes.c:638 +msgid "too few parameters" +msgstr "" + +#: builtin/notes.c:659 +#, c-format +msgid "" +"Cannot copy notes. Found existing notes for object %s. Use '-f' to overwrite " +"existing notes" +msgstr "" + +#: builtin/notes.c:671 +#, c-format +msgid "Missing notes on source object %s. Cannot copy." +msgstr "" + +#: builtin/notes.c:720 +#, c-format +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 "" + +#: builtin/notes.c:867 +msgid "General options" +msgstr "" + +#: builtin/notes.c:869 +msgid "Merge options" +msgstr "" + +#: builtin/notes.c:871 +msgid "" +"resolve notes conflicts using the given strategy (manual/ours/theirs/union/" +"cat_sort_uniq)" +msgstr "" + +#: builtin/notes.c:873 +msgid "Committing unmerged notes" +msgstr "" + +#: builtin/notes.c:875 +msgid "finalize notes merge by committing unmerged notes" +msgstr "" + +#: builtin/notes.c:877 +msgid "Aborting notes merge resolution" +msgstr "" + +#: builtin/notes.c:879 +msgid "abort notes merge" +msgstr "" + +#: builtin/notes.c:974 +#, c-format +msgid "Object %s has no note\n" +msgstr "" + +#: builtin/notes.c:986 +msgid "attempt to remove non-existent note is not an error" +msgstr "" + +#: builtin/notes.c:989 +msgid "read object names from the standard input" +msgstr "" + +#: builtin/notes.c:1070 +msgid "notes_ref" +msgstr "" + +#: builtin/notes.c:1071 +msgid "use notes from " +msgstr "" + +#: builtin/notes.c:1106 builtin/remote.c:1598 +#, c-format +msgid "Unknown subcommand: %s" +msgstr "" + +#: builtin/pack-objects.c:23 +msgid "git pack-objects --stdout [options...] [< ref-list | < object-list]" +msgstr "" + +#: builtin/pack-objects.c:24 +msgid "git pack-objects [options...] base-name [< ref-list | < object-list]" +msgstr "" + +#: builtin/pack-objects.c:183 builtin/pack-objects.c:186 +#, c-format +msgid "deflate error (%d)" +msgstr "" + +#: builtin/pack-objects.c:2398 +#, c-format +msgid "unsupported index version %s" +msgstr "" + +#: builtin/pack-objects.c:2402 +#, c-format +msgid "bad index version '%s'" +msgstr "" + +#: builtin/pack-objects.c:2425 +#, c-format +msgid "option %s does not accept negative form" +msgstr "" + +#: builtin/pack-objects.c:2429 +#, c-format +msgid "unable to parse value '%s' for option %s" +msgstr "" + +#: builtin/pack-objects.c:2448 +msgid "do not show progress meter" +msgstr "" + +#: builtin/pack-objects.c:2450 +msgid "show progress meter" +msgstr "" + +#: builtin/pack-objects.c:2452 +msgid "show progress meter during object writing phase" +msgstr "" + +#: builtin/pack-objects.c:2455 +msgid "similar to --all-progress when progress meter is shown" +msgstr "" + +#: builtin/pack-objects.c:2456 +msgid "version[,offset]" +msgstr "" + +#: builtin/pack-objects.c:2457 +msgid "write the pack index file in the specified idx format version" +msgstr "" + +#: builtin/pack-objects.c:2460 +msgid "maximum size of each output pack file" +msgstr "" + +#: builtin/pack-objects.c:2462 +msgid "ignore borrowed objects from alternate object store" +msgstr "" + +#: builtin/pack-objects.c:2464 +msgid "ignore packed objects" +msgstr "" + +#: builtin/pack-objects.c:2466 +msgid "limit pack window by objects" +msgstr "" + +#: builtin/pack-objects.c:2468 +msgid "limit pack window by memory in addition to object limit" +msgstr "" + +#: builtin/pack-objects.c:2470 +msgid "maximum length of delta chain allowed in the resulting pack" +msgstr "" + +#: builtin/pack-objects.c:2472 +msgid "reuse existing deltas" +msgstr "" + +#: builtin/pack-objects.c:2474 +msgid "reuse existing objects" +msgstr "" + +#: builtin/pack-objects.c:2476 +msgid "use OFS_DELTA objects" +msgstr "" + +#: builtin/pack-objects.c:2478 +msgid "use threads when searching for best delta matches" +msgstr "" + +#: builtin/pack-objects.c:2480 +msgid "do not create an empty pack output" +msgstr "" + +#: builtin/pack-objects.c:2482 +msgid "read revision arguments from standard input" +msgstr "" + +#: builtin/pack-objects.c:2484 +msgid "limit the objects to those that are not yet packed" +msgstr "" + +#: builtin/pack-objects.c:2487 +msgid "include objects reachable from any reference" +msgstr "" + +#: builtin/pack-objects.c:2490 +msgid "include objects referred by reflog entries" +msgstr "" + +#: builtin/pack-objects.c:2493 +msgid "output pack to stdout" +msgstr "" + +#: builtin/pack-objects.c:2495 +msgid "include tag objects that refer to objects to be packed" +msgstr "" + +#: builtin/pack-objects.c:2497 +msgid "keep unreachable objects" +msgstr "" + +#: builtin/pack-objects.c:2498 parse-options.h:141 +msgid "time" +msgstr "" + +#: builtin/pack-objects.c:2499 +msgid "unpack unreachable objects newer than