diff --git a/Documentation/Makefile b/Documentation/Makefile index 7b0685b7b2..7a325462ee 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -23,7 +23,7 @@ ARTICLES += everyday ARTICLES += git-tools ARTICLES += glossary # with their own formatting rules. -SP_ARTICLES = howto/revert-branch-rebase user-manual +SP_ARTICLES = howto/revert-branch-rebase howto/using-merge-subtree user-manual API_DOCS = $(patsubst %.txt,%,$(filter-out technical/api-index-skel.txt technical/api-index.txt, $(wildcard technical/api-*.txt))) SP_ARTICLES += $(API_DOCS) SP_ARTICLES += technical/api-index diff --git a/Documentation/RelNotes-1.5.4.txt b/Documentation/RelNotes-1.5.4.txt index 7d2a973c79..9c864c9def 100644 --- a/Documentation/RelNotes-1.5.4.txt +++ b/Documentation/RelNotes-1.5.4.txt @@ -10,6 +10,9 @@ Removal * As git-commit and git-status have been rewritten, "git runstatus" helper script lost all its users and has been removed. + * Curl library older than 7.10 is not supported by "git http-push", + as it does not work without CURLM. + Deprecation notices ------------------- @@ -46,6 +49,10 @@ Deprecation notices and works for all transports; "git peek-remote" will be removed in the future. + * "git repo-config" which was an old name for "git config" command + has been supported without being advertised for a long time. The + next feature release will remove it. + * From v1.6.0, the repack.usedeltabaseoffset config option will default to true, which will give denser packfiles (i.e. more efficient storage). The downside is that git older than version 1.4.4 will not be able @@ -356,8 +363,10 @@ series. * Recent versions of AsciiDoc 8 has a change to break our documentation; a workaround has been implemented. + * "git diff --color-words" colored context lines in a wrong color. + -- exec >/var/tmp/1 -O=v1.5.4-rc3 +O=v1.5.4-rc4 echo O=`git describe refs/heads/master` git shortlog --no-merges $O..refs/heads/master ^refs/heads/maint diff --git a/Documentation/config.txt b/Documentation/config.txt index df091d1b8a..877eda960d 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -543,8 +543,8 @@ rerere.enabled:: Activate recording of resolved conflicts, so that identical conflict hunks can be resolved automatically, should they be encountered again. linkgit:git-rerere[1] command is by - default enabled, but can be disabled by setting this option to - false. + default enabled if you create `rr-cache` directory under + `$GIT_DIR`, but can be disabled by setting this option to false. gitcvs.enabled:: Whether the CVS server interface is enabled for this repository. diff --git a/Documentation/core-tutorial.txt b/Documentation/core-tutorial.txt index bd6cd41245..aa40dfd36a 100644 --- a/Documentation/core-tutorial.txt +++ b/Documentation/core-tutorial.txt @@ -578,7 +578,7 @@ particular state. You can, for example, do $ git diff my-first-tag ---------------- -to diff your current state against that tag (which at this point will +to diff your current state against that tag which at this point will obviously be an empty diff, but if you continue to develop and commit stuff, you can use your tag as an "anchor-point" to see what has changed since you tagged it. diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt index 3bcc12c132..877ab66ef5 100644 --- a/Documentation/git-cherry-pick.txt +++ b/Documentation/git-cherry-pick.txt @@ -24,7 +24,7 @@ OPTIONS -e|--edit:: With this option, `git-cherry-pick` will let you edit the commit - message prior committing. + message prior to committing. -x:: When recording the commit, append to the original commit diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt index 5985f47394..ebaee4b334 100644 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@ -19,14 +19,10 @@ command to control what is shown and how, and options applicable to the linkgit:git-diff-tree[1] commands to control how the changes each commit introduces are shown. -This manual page describes only the most frequently used options. - OPTIONS ------- -include::pretty-options.txt[] - :git-log: 1 include::diff-options.txt[] @@ -41,21 +37,6 @@ include::diff-options.txt[] and , see "SPECIFYING REVISIONS" section in linkgit:git-rev-parse[1]. ---first-parent:: - Follow only the first parent commit upon seeing a merge - commit. This option can give a better overview when - viewing the evolution of a particular topic branch, - because merges into a topic branch tend to be only about - adjusting to updated upstream from time to time, and - this option allows you to ignore the individual commits - brought in to your history by such a merge. - --g, \--walk-reflogs:: - Show commits as they were recorded in the reflog. The log contains - a record about how the tip of a reference was changed. - Cannot be combined with --reverse. - See also linkgit:git-reflog[1]. - --decorate:: Print out the ref names of any commits that are shown. @@ -80,6 +61,8 @@ include::diff-options.txt[] Show only commits that affect the specified paths. +include::rev-list-options.txt[] + include::pretty-formats.txt[] include::diff-generate-patch.txt[] diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index ed3a92404b..0c9ad7f2bb 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -74,14 +74,14 @@ it happens. In other words, `git-diff --cached HEAD` must report no changes. [NOTE] -This is a bit of lie. In certain special cases, your index are -allowed to be different from the tree of `HEAD` commit. The most +This is a bit of a lie. In certain special cases, your index is +allowed to be different from the tree of the `HEAD` commit. The most notable case is when your `HEAD` commit is already ahead of what is being merged, in which case your index can have arbitrary -difference from your `HEAD` commit. Otherwise, your index entries -are allowed have differences from your `HEAD` commit that match -the result of trivial merge (e.g. you received the same patch -from external source to produce the same result as what you are +differences from your `HEAD` commit. Also, your index entries +may have differences from your `HEAD` commit that match +the result of a trivial merge (e.g. you received the same patch +from an external source to produce the same result as what you are merging). For example, if a path did not exist in the common ancestor and your head commit but exists in the tree you are merging into your repository, and if you already happen to have diff --git a/Documentation/git-rerere.txt b/Documentation/git-rerere.txt index 3793267dad..a53858e250 100644 --- a/Documentation/git-rerere.txt +++ b/Documentation/git-rerere.txt @@ -22,6 +22,10 @@ automerge results and corresponding hand-resolve results on the initial manual merge, and later by noticing the same automerge results and applying the previously recorded hand resolution. +[NOTE] +You need to set the configuration variable rerere.enabled to +enable this command. + COMMANDS -------- diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt index db42cd8a92..5b96eabfce 100644 --- a/Documentation/git-rev-list.txt +++ b/Documentation/git-rev-list.txt @@ -88,363 +88,8 @@ linkgit:git-repack[1]. OPTIONS ------- -Commit Formatting -~~~~~~~~~~~~~~~~~ - -Using these options, linkgit:git-rev-list[1] will act similar to the -more specialized family of commit log tools: linkgit:git-log[1], -linkgit:git-show[1], and linkgit:git-whatchanged[1] - -include::pretty-options.txt[] - ---relative-date:: - - Synonym for `--date=relative`. - ---date={relative,local,default,iso,rfc}:: - - Only takes effect for dates shown in human-readable format, such - as when using "--pretty". -+ -`--date=relative` shows dates relative to the current time, -e.g. "2 hours ago". -+ -`--date=local` shows timestamps in user's local timezone. -+ -`--date=iso` (or `--date=iso8601`) shows timestamps in ISO 8601 format. -+ -`--date=rfc` (or `--date=rfc2822`) shows timestamps in RFC 2822 -format, often found in E-mail messages. -+ -`--date=short` shows only date but not time, in `YYYY-MM-DD` format. -+ -`--date=default` shows timestamps in the original timezone -(either committer's or author's). - ---header:: - - Print the contents of the commit in raw-format; each record is - separated with a NUL character. - ---parents:: - - Print the parents of the commit. - ---timestamp:: - Print the raw commit timestamp. - ---left-right:: - - Mark which side of a symmetric diff a commit is reachable from. - Commits from the left side are prefixed with `<` and those from - the right with `>`. If combined with `--boundary`, those - commits are prefixed with `-`. -+ -For example, if you have this topology: -+ ------------------------------------------------------------------------ - y---b---b branch B - / \ / - / . - / / \ - o---x---a---a branch A ------------------------------------------------------------------------ -+ -you would get an output line this: -+ ------------------------------------------------------------------------ - $ git rev-list --left-right --boundary --pretty=oneline A...B - - >bbbbbbb... 3rd on b - >bbbbbbb... 2nd on b - '. - ---stdin:: - - In addition to the '' listed on the command - line, read them from the standard input. - ---quiet:: - - Don't print anything to standard output. This form of - git-rev-list is primarily meant to allow the caller to - test the exit status to see if a range of objects is fully - connected (or not). It is faster than redirecting stdout - to /dev/null as the output does not have to be formatted. - ---cherry-pick:: - - Omit any commit that introduces the same change as - another commit on the "other side" when the set of - commits are limited with symmetric difference. -+ -For example, if you have two branches, `A` and `B`, a usual way -to list all commits on only one side of them is with -`--left-right`, like the example above in the description of -that option. It however shows the commits that were cherry-picked -from the other branch (for example, "3rd on b" may be cherry-picked -from branch A). With this option, such pairs of commits are -excluded from the output. - --g, --walk-reflogs:: - - Instead of walking the commit ancestry chain, walk - reflog entries from the most recent one to older ones. - When this option is used you cannot specify commits to - exclude (that is, '{caret}commit', 'commit1..commit2', - nor 'commit1...commit2' notations cannot be used). -+ -With '\--pretty' format other than oneline (for obvious reasons), -this causes the output to have two extra lines of information -taken from the reflog. By default, 'commit@\{Nth}' notation is -used in the output. When the starting commit is specified as -'commit@{now}', output also uses 'commit@\{timestamp}' notation -instead. Under '\--pretty=oneline', the commit message is -prefixed with this information on the same line. - -Cannot be combined with '\--reverse'. - ---merge:: - - After a failed merge, show refs that touch files having a - conflict and don't exist on all heads to merge. - ---boundary:: - - Output uninteresting commits at the boundary, which are usually - not shown. - ---dense, --sparse:: - -When optional paths are given, the default behaviour ('--dense') is to -only output commits that changes at least one of them, and also ignore -merges that do not touch the given paths. - -Use the '--sparse' flag to makes the command output all eligible commits -(still subject to count and age limitation), but apply merge -simplification nevertheless. - ---bisect:: - -Limit output to the one commit object which is roughly halfway between -the included and excluded commits. Thus, if - ------------------------------------------------------------------------ - $ git-rev-list --bisect foo ^bar ^baz ------------------------------------------------------------------------ - -outputs 'midpoint', the output of the two commands - ------------------------------------------------------------------------ - $ git-rev-list foo ^midpoint - $ git-rev-list midpoint ^bar ^baz ------------------------------------------------------------------------ - -would be of roughly the same length. Finding the change which -introduces a regression is thus reduced to a binary search: repeatedly -generate and test new 'midpoint's until the commit chain is of length -one. - ---bisect-vars:: - -This calculates the same as `--bisect`, but outputs text ready -to be eval'ed by the shell. These lines will assign the name of -the midpoint revision to the variable `bisect_rev`, and the -expected number of commits to be tested after `bisect_rev` is -tested to `bisect_nr`, the expected number of commits to be -tested if `bisect_rev` turns out to be good to `bisect_good`, -the expected number of commits to be tested if `bisect_rev` -turns out to be bad to `bisect_bad`, and the number of commits -we are bisecting right now to `bisect_all`. - ---bisect-all:: - -This outputs all the commit objects between the included and excluded -commits, ordered by their distance to the included and excluded -commits. The farthest from them is displayed first. (This is the only -one displayed by `--bisect`.) - -This is useful because it makes it easy to choose a good commit to -test when you want to avoid to test some of them for some reason (they -may not compile for example). - -This option can be used along with `--bisect-vars`, in this case, -after all the sorted commit objects, there will be the same text as if -`--bisect-vars` had been used alone. - --- - -Commit Ordering -~~~~~~~~~~~~~~~ - -By default, the commits are shown in reverse chronological order. - ---topo-order:: - - This option makes them appear in topological order (i.e. - descendant commits are shown before their parents). - ---date-order:: - - This option is similar to '--topo-order' in the sense that no - parent comes before all of its children, but otherwise things - are still ordered in the commit timestamp order. - ---reverse:: - - Output the commits in reverse order. - Cannot be combined with '\--walk-reflogs'. - -Object Traversal -~~~~~~~~~~~~~~~~ - -These options are mostly targeted for packing of git repositories. - ---objects:: - - Print the object IDs of any object referenced by the listed - commits. 'git-rev-list --objects foo ^bar' thus means "send me - all object IDs which I need to download if I have the commit - object 'bar', but not 'foo'". - ---objects-edge:: - - Similar to '--objects', but also print the IDs of excluded - commits prefixed with a "-" character. This is used by - linkgit:git-pack-objects[1] to build "thin" pack, which records - objects in deltified form based on objects contained in these - excluded commits to reduce network traffic. - ---unpacked:: - - Only useful with '--objects'; print the object IDs that are not - in packs. - ---no-walk:: - - Only show the given revs, but do not traverse their ancestors. - ---do-walk:: - - Overrides a previous --no-walk. - +:git-rev-list: 1 +include::rev-list-options.txt[] include::pretty-formats.txt[] diff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt index 494fc7f847..93e20f7752 100644 --- a/Documentation/git-revert.txt +++ b/Documentation/git-revert.txt @@ -24,7 +24,7 @@ OPTIONS -e|--edit:: With this option, `git-revert` will let you edit the commit - message prior committing the revert. This is the default if + message prior to committing the revert. This is the default if you run the command from a terminal. -m parent-number|--mainline parent-number:: diff --git a/Documentation/howto/using-merge-subtree.txt b/Documentation/howto/using-merge-subtree.txt new file mode 100644 index 0000000000..0953a50b69 --- /dev/null +++ b/Documentation/howto/using-merge-subtree.txt @@ -0,0 +1,75 @@ +Date: Sat, 5 Jan 2008 20:17:40 -0500 +From: Sean +To: Miklos Vajna +Cc: git@vger.kernel.org +Subject: how to use git merge -s subtree? +Abstract: In this article, Sean demonstrates how one can use the subtree merge + strategy. +Content-type: text/asciidoc +Message-ID: + +How to use the subtree merge strategy +===================================== + +There are situations where you want to include contents in your project +from an independently developed project. You can just pull from the +other project as long as there are no conflicting paths. + +The problematic case is when there are conflicting files. Potential +candidates are Makefiles and other standard filenames. You could merge +these files but probably you do not want to. A better solution for this +problem can be to merge the project as its own subdirectory. This is not +supported by the 'recursive' merge strategy, so just pulling won't work. + +What you want is the 'subtree' merge strategy, which helps you in such a +situation. + +In this example, let's say you have the repository at `/path/to/B` (but +it can be an URL as well, if you want). You want to merge the 'master' +branch of that repository to the `dir-B` subdirectory in your current +branch. + +Here is the command sequence you need: + +---------------- +$ git remote add -f Bproject /path/to/B <1> +$ git merge -s ours --no-commit Bproject/master <2> +$ git read-tree --prefix=dir-B/ -u Bproject/master <3> +$ git commit -m "Merge B project as our subdirectory" <4> + +$ git pull -s subtree Bproject master <5> +---------------- +<1> name the other project "Bproject", and fetch. +<2> prepare for the later step to record the result as a merge. +<3> read "master" branch of Bproject to the subdirectory "dir-B". +<4> record the merge result. +<5> maintain the result with subsequent merges using "subtree" + +The first four commands are used for the initial merge, while the last +one is to merge updates from 'B project'. + +Comparing 'subtree' merge with submodules +----------------------------------------- + +- The benefit of using subtree merge is that it requires less + administrative burden from the users of your repository. It works with + older (before Git v1.5.2) clients and you have the code right after + clone. + +- However if you use submodules then you can choose not to transfer the + submodule objects. This may be a problem with the subtree merge. + +- Also, in case you make changes to the other project, it is easier to + submit changes if you just use submodules. + +Additional tips +--------------- + +- If you made changes to the other project in your repository, they may + want to merge from your project. This is possible using subtree -- it + can shift up the paths in your tree and then they can merge only the + relevant parts of your tree. + +- Please note that if the other project merges from you, then it will + connects its history to yours, which can be something they don't want + to. diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt new file mode 100644 index 0000000000..a8138e27a1 --- /dev/null +++ b/Documentation/rev-list-options.txt @@ -0,0 +1,361 @@ +Commit Formatting +~~~~~~~~~~~~~~~~~ + +ifdef::git-rev-list[] +Using these options, linkgit:git-rev-list[1] will act similar to the +more specialized family of commit log tools: linkgit:git-log[1], +linkgit:git-show[1], and linkgit:git-whatchanged[1] +endif::git-rev-list[] + +include::pretty-options.txt[] + +--relative-date:: + + Synonym for `--date=relative`. + +--date={relative,local,default,iso,rfc}:: + + Only takes effect for dates shown in human-readable format, such + as when using "--pretty". ++ +`--date=relative` shows dates relative to the current time, +e.g. "2 hours ago". ++ +`--date=local` shows timestamps in user's local timezone. ++ +`--date=iso` (or `--date=iso8601`) shows timestamps in ISO 8601 format. ++ +`--date=rfc` (or `--date=rfc2822`) shows timestamps in RFC 2822 +format, often found in E-mail messages. ++ +`--date=short` shows only date but not time, in `YYYY-MM-DD` format. ++ +`--date=default` shows timestamps in the original timezone +(either committer's or author's). + +--header:: + + Print the contents of the commit in raw-format; each record is + separated with a NUL character. + +--parents:: + + Print the parents of the commit. + +--timestamp:: + Print the raw commit timestamp. + +--left-right:: + + Mark which side of a symmetric diff a commit is reachable from. + Commits from the left side are prefixed with `<` and those from + the right with `>`. If combined with `--boundary`, those + commits are prefixed with `-`. ++ +For example, if you have this topology: ++ +----------------------------------------------------------------------- + y---b---b branch B + / \ / + / . + / / \ + o---x---a---a branch A +----------------------------------------------------------------------- ++ +you would get an output line this: ++ +----------------------------------------------------------------------- + $ git rev-list --left-right --boundary --pretty=oneline A...B + + >bbbbbbb... 3rd on b + >bbbbbbb... 2nd on b + '. + +--stdin:: + + In addition to the '' listed on the command + line, read them from the standard input. + +--quiet:: + + Don't print anything to standard output. This form + is primarily meant to allow the caller to + test the exit status to see if a range of objects is fully + connected (or not). It is faster than redirecting stdout + to /dev/null as the output does not have to be formatted. + +--cherry-pick:: + + Omit any commit that introduces the same change as + another commit on the "other side" when the set of + commits are limited with symmetric difference. ++ +For example, if you have two branches, `A` and `B`, a usual way +to list all commits on only one side of them is with +`--left-right`, like the example above in the description of +that option. It however shows the commits that were cherry-picked +from the other branch (for example, "3rd on b" may be cherry-picked +from branch A). With this option, such pairs of commits are +excluded from the output. + +-g, --walk-reflogs:: + + Instead of walking the commit ancestry chain, walk + reflog entries from the most recent one to older ones. + When this option is used you cannot specify commits to + exclude (that is, '{caret}commit', 'commit1..commit2', + nor 'commit1...commit2' notations cannot be used). ++ +With '\--pretty' format other than oneline (for obvious reasons), +this causes the output to have two extra lines of information +taken from the reflog. By default, 'commit@\{Nth}' notation is +used in the output. When the starting commit is specified as +'commit@{now}', output also uses 'commit@\{timestamp}' notation +instead. Under '\--pretty=oneline', the commit message is +prefixed with this information on the same line. + +Cannot be combined with '\--reverse'. +See also linkgit:git-reflog[1]. + +--merge:: + + After a failed merge, show refs that touch files having a + conflict and don't exist on all heads to merge. + +--boundary:: + + Output uninteresting commits at the boundary, which are usually + not shown. + +--dense, --sparse:: + +When optional paths are given, the default behaviour ('--dense') is to +only output commits that changes at least one of them, and also ignore +merges that do not touch the given paths. + +Use the '--sparse' flag to makes the command output all eligible commits +(still subject to count and age limitation), but apply merge +simplification nevertheless. + +ifdef::git-rev-list[] +--bisect:: + +Limit output to the one commit object which is roughly halfway between +the included and excluded commits. Thus, if + +----------------------------------------------------------------------- + $ git-rev-list --bisect foo ^bar ^baz +----------------------------------------------------------------------- + +outputs 'midpoint', the output of the two commands + +----------------------------------------------------------------------- + $ git-rev-list foo ^midpoint + $ git-rev-list midpoint ^bar ^baz +----------------------------------------------------------------------- + +would be of roughly the same length. Finding the change which +introduces a regression is thus reduced to a binary search: repeatedly +generate and test new 'midpoint's until the commit chain is of length +one. + +--bisect-vars:: + +This calculates the same as `--bisect`, but outputs text ready +to be eval'ed by the shell. These lines will assign the name of +the midpoint revision to the variable `bisect_rev`, and the +expected number of commits to be tested after `bisect_rev` is +tested to `bisect_nr`, the expected number of commits to be +tested if `bisect_rev` turns out to be good to `bisect_good`, +the expected number of commits to be tested if `bisect_rev` +turns out to be bad to `bisect_bad`, and the number of commits +we are bisecting right now to `bisect_all`. + +--bisect-all:: + +This outputs all the commit objects between the included and excluded +commits, ordered by their distance to the included and excluded +commits. The farthest from them is displayed first. (This is the only +one displayed by `--bisect`.) + +This is useful because it makes it easy to choose a good commit to +test when you want to avoid to test some of them for some reason (they +may not compile for example). + +This option can be used along with `--bisect-vars`, in this case, +after all the sorted commit objects, there will be the same text as if +`--bisect-vars` had been used alone. +endif::git-rev-list[] + +-- + +Commit Ordering +~~~~~~~~~~~~~~~ + +By default, the commits are shown in reverse chronological order. + +--topo-order:: + + This option makes them appear in topological order (i.e. + descendant commits are shown before their parents). + +--date-order:: + + This option is similar to '--topo-order' in the sense that no + parent comes before all of its children, but otherwise things + are still ordered in the commit timestamp order. + +--reverse:: + + Output the commits in reverse order. + Cannot be combined with '\--walk-reflogs'. + +Object Traversal +~~~~~~~~~~~~~~~~ + +These options are mostly targeted for packing of git repositories. + +--objects:: + + Print the object IDs of any object referenced by the listed + commits. '--objects foo ^bar' thus means "send me + all object IDs which I need to download if I have the commit + object 'bar', but not 'foo'". + +--objects-edge:: + + Similar to '--objects', but also print the IDs of excluded + commits prefixed with a "-" character. This is used by + linkgit:git-pack-objects[1] to build "thin" pack, which records + objects in deltified form based on objects contained in these + excluded commits to reduce network traffic. + +--unpacked:: + + Only useful with '--objects'; print the object IDs that are not + in packs. + +--no-walk:: + + Only show the given revs, but do not traverse their ancestors. + +--do-walk:: + + Overrides a previous --no-walk. diff --git a/Documentation/technical/api-lockfile.txt b/Documentation/technical/api-lockfile.txt index 73ac1025fd..dd894043ae 100644 --- a/Documentation/technical/api-lockfile.txt +++ b/Documentation/technical/api-lockfile.txt @@ -1,12 +1,74 @@ lockfile API ============ -Talk about , things like: +The lockfile API serves two purposes: -* lockfile lifetime -- atexit(3) looks at them, do not put them on the - stack; -* hold_lock_file_for_update() -* commit_lock_file() -* rollback_rock_file() +* Mutual exclusion. When we write out a new index file, first + we create a new file `$GIT_DIR/index.lock`, write the new + contents into it, and rename it to the final destination + `$GIT_DIR/index`. We try to create the `$GIT_DIR/index.lock` + file with O_EXCL so that we can notice and fail when somebody + else is already trying to update the index file. -(JC, Dscho, Shawn) +* Automatic cruft removal. After we create the "lock" file, we + may decide to `die()`, and we would want to make sure that we + remove the file that has not been committed to its final + destination. This is done by remembering the lockfiles we + created in a linked list and cleaning them up from an + `atexit(3)` handler. Outstanding lockfiles are also removed + when the program dies on a signal. + + +The functions +------------- + +hold_lock_file_for_update:: + + Take a pointer to `struct lock_file`, the filename of + the final destination (e.g. `$GIT_DIR/index`) and a flag + `die_on_error`. Attempt to create a lockfile for the + destination and return the file descriptor for writing + to the file. If `die_on_error` flag is true, it dies if + a lock is already taken for the file; otherwise it + returns a negative integer to the caller on failure. + +commit_lock_file:: + + Take a pointer to the `struct lock_file` initialized + with an earlier call to `hold_lock_file_for_update()`, + close the file descriptor and rename the lockfile to its + final destination. Returns 0 upon success, a negative + value on failure to close(2) or rename(2). + +rollback_lock_file:: + + Take a pointer to the `struct lock_file` initialized + with an earlier call to `hold_lock_file_for_update()`, + close the file descriptor and remove the lockfile. + +close_lock_file:: + Take a pointer to the `struct lock_file` initialized + with an earlier call to `hold_lock_file_for_update()`, + and close the file descriptor. Returns 0 upon success, + a negative value on failure to close(2). + +Because the structure is used in an `atexit(3)` handler, its +storage has to stay throughout the life of the program. It +cannot be an auto variable allocated on the stack. + +Call `commit_lock_file()` or `rollback_lock_file()` when you are +done writing to the file descriptor. If you do not call either +and simply `exit(3)` from the program, an `atexit(3)` handler +will close and remove the lockfile. + +If you need to close the file descriptor you obtained from +`hold_lock_file_for_update` function yourself, do so by calling +`close_lock_file()`. You should never call `close(2)` yourself! +Otherwise the `struct +lock_file` structure still remembers that the file descriptor +needs to be closed, and a later call to `commit_lock_file()` or +`rollback_lock_file()` will result in duplicate calls to +`close(2)`. Worse yet, if you `close(2)`, open another file +descriptor for completely different purpose, and then call +`commit_lock_file()` or `rollback_lock_file()`, they may close +that unrelated file descriptor. diff --git a/Makefile b/Makefile index 3ad839eaa4..c8aef487f2 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,8 @@ all:: # # Define NO_SETENV if you don't have setenv in the C library. # +# Define NO_UNSETENV if you don't have unsetenv in the C library. +# # Define NO_MKDTEMP if you don't have mkdtemp in the C library. # # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link. @@ -315,7 +317,7 @@ LIB_OBJS = \ alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \ color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \ convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \ - transport.o bundle.o walker.o parse-options.o ws.o + transport.o bundle.o walker.o parse-options.o ws.o archive.o BUILTIN_OBJS = \ builtin-add.o \ @@ -1185,7 +1187,7 @@ check-docs:: case "$$v" in \ git-merge-octopus | git-merge-ours | git-merge-recursive | \ git-merge-resolve | git-merge-stupid | git-merge-subtree | \ - git-fsck-objects | git-init-db | git-repo-config | \ + git-fsck-objects | git-init-db | \ git-?*--?* ) continue ;; \ esac ; \ test -f "Documentation/$$v.txt" || \ @@ -1227,3 +1229,4 @@ check-docs:: # check-builtins:: ./check-builtins.sh + diff --git a/archive.c b/archive.c new file mode 100644 index 0000000000..fb159fe59e --- /dev/null +++ b/archive.c @@ -0,0 +1,84 @@ +#include "cache.h" +#include "commit.h" +#include "attr.h" + +static void format_subst(const struct commit *commit, + const char *src, size_t len, + struct strbuf *buf) +{ + char *to_free = NULL; + struct strbuf fmt; + + if (src == buf->buf) + to_free = strbuf_detach(buf, NULL); + strbuf_init(&fmt, 0); + for (;;) { + const char *b, *c; + + b = memmem(src, len, "$Format:", 8); + if (!b || src + len < b + 9) + break; + c = memchr(b + 8, '$', len - 8); + if (!c) + break; + + strbuf_reset(&fmt); + strbuf_add(&fmt, b + 8, c - b - 8); + + strbuf_add(buf, src, b - src); + format_commit_message(commit, fmt.buf, buf); + len -= c + 1 - src; + src = c + 1; + } + strbuf_add(buf, src, len); + strbuf_release(&fmt); + free(to_free); +} + +static int convert_to_archive(const char *path, + const void *src, size_t len, + struct strbuf *buf, + const struct commit *commit) +{ + static struct git_attr *attr_export_subst; + struct git_attr_check check[1]; + + if (!commit) + return 0; + + if (!attr_export_subst) + attr_export_subst = git_attr("export-subst", 12); + + check[0].attr = attr_export_subst; + if (git_checkattr(path, ARRAY_SIZE(check), check)) + return 0; + if (!ATTR_TRUE(check[0].value)) + return 0; + + format_subst(commit, src, len, buf); + return 1; +} + +void *sha1_file_to_archive(const char *path, const unsigned char *sha1, + unsigned int mode, enum object_type *type, + unsigned long *sizep, + const struct commit *commit) +{ + void *buffer; + + buffer = read_sha1_file(sha1, type, sizep); + if (buffer && S_ISREG(mode)) { + struct strbuf buf; + size_t size = 0; + + strbuf_init(&buf, 0); + strbuf_attach(&buf, buffer, *sizep, *sizep + 1); + convert_to_working_tree(path, buf.buf, buf.len, &buf); + convert_to_archive(path, buf.buf, buf.len, &buf, commit); + buffer = strbuf_detach(&buf, &size); + *sizep = size; + } + + return buffer; +} + diff --git a/builtin-add.c b/builtin-add.c index 5c29cc2f3f..4a91e3eb11 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -259,7 +259,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) finish: if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file)) + commit_locked_index(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-apply.c b/builtin-apply.c index d57bb6e070..15432b6782 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2921,7 +2921,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix) if (update_index) { if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file)) + commit_locked_index(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-archive.c b/builtin-archive.c index 14a1b3077c..c2e0c1ea5a 100644 --- a/builtin-archive.c +++ b/builtin-archive.c @@ -79,86 +79,6 @@ static int run_remote_archiver(const char *remote, int argc, return !!rv; } -static void format_subst(const struct commit *commit, - const char *src, size_t len, - struct strbuf *buf) -{ - char *to_free = NULL; - struct strbuf fmt; - - if (src == buf->buf) - to_free = strbuf_detach(buf, NULL); - strbuf_init(&fmt, 0); - for (;;) { - const char *b, *c; - - b = memmem(src, len, "$Format:", 8); - if (!b || src + len < b + 9) - break; - c = memchr(b + 8, '$', len - 8); - if (!c) - break; - - strbuf_reset(&fmt); - strbuf_add(&fmt, b + 8, c - b - 8); - - strbuf_add(buf, src, b - src); - format_commit_message(commit, fmt.buf, buf); - len -= c + 1 - src; - src = c + 1; - } - strbuf_add(buf, src, len); - strbuf_release(&fmt); - free(to_free); -} - -static int convert_to_archive(const char *path, - const void *src, size_t len, - struct strbuf *buf, - const struct commit *commit) -{ - static struct git_attr *attr_export_subst; - struct git_attr_check check[1]; - - if (!commit) - return 0; - - if (!attr_export_subst) - attr_export_subst = git_attr("export-subst", 12); - - check[0].attr = attr_export_subst; - if (git_checkattr(path, ARRAY_SIZE(check), check)) - return 0; - if (!ATTR_TRUE(check[0].value)) - return 0; - - format_subst(commit, src, len, buf); - return 1; -} - -void *sha1_file_to_archive(const char *path, const unsigned char *sha1, - unsigned int mode, enum object_type *type, - unsigned long *sizep, - const struct commit *commit) -{ - void *buffer; - - buffer = read_sha1_file(sha1, type, sizep); - if (buffer && S_ISREG(mode)) { - struct strbuf buf; - size_t size = 0; - - strbuf_init(&buf, 0); - strbuf_attach(&buf, buffer, *sizep, *sizep + 1); - convert_to_working_tree(path, buf.buf, buf.len, &buf); - convert_to_archive(path, buf.buf, buf.len, &buf, commit); - buffer = strbuf_detach(&buf, &size); - *sizep = size; - } - - return buffer; -} - static int init_archiver(const char *name, struct archiver *ar) { int rv = -1, i; diff --git a/builtin-checkout-index.c b/builtin-checkout-index.c index 70d619da8d..7e42024c67 100644 --- a/builtin-checkout-index.c +++ b/builtin-checkout-index.c @@ -246,8 +246,8 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) * want to update cache. */ if (state.refresh_cache) { - close(newfd); newfd = -1; rollback_lock_file(&lock_file); + newfd = -1; } state.refresh_cache = 0; } @@ -297,7 +297,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix) if (0 <= newfd && (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file))) + commit_locked_index(&lock_file))) die("Unable to write new index file"); return 0; } diff --git a/builtin-clean.c b/builtin-clean.c index 6cad8eaf25..eb853a37cf 100644 --- a/builtin-clean.c +++ b/builtin-clean.c @@ -90,7 +90,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) strbuf_init(&directory, 0); if (pathspec) - seen = xmalloc(argc); + seen = xmalloc(argc > 0 ? argc : 1); for (i = 0; i < dir.nr; i++) { struct dir_entry *ent = dir.entries[i]; @@ -125,7 +125,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) continue; if (pathspec) { - memset(seen, 0, argc); + memset(seen, 0, argc > 0 ? argc : 1); matches = match_pathspec(pathspec, ent->name, ent->len, baselen, seen); } else { diff --git a/builtin-commit.c b/builtin-commit.c index 73f1e3576a..02279360f7 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -21,6 +21,7 @@ #include "utf8.h" #include "parse-options.h" #include "path-list.h" +#include "unpack-trees.h" static const char * const builtin_commit_usage[] = { "git-commit [options] [--] ...", @@ -177,10 +178,34 @@ static void add_remove_files(struct path_list *list) } } +static void create_base_index(void) +{ + struct tree *tree; + struct unpack_trees_options opts; + struct tree_desc t; + + if (initial_commit) { + discard_cache(); + return; + } + + memset(&opts, 0, sizeof(opts)); + opts.head_idx = 1; + opts.index_only = 1; + opts.merge = 1; + + opts.fn = oneway_merge; + tree = parse_tree_indirect(head_sha1); + if (!tree) + die("failed to unpack HEAD tree object"); + parse_tree(tree); + init_tree_desc(&t, tree->buffer, tree->size); + unpack_trees(1, &t, &opts); +} + static char *prepare_index(int argc, const char **argv, const char *prefix) { int fd; - struct tree *tree; struct path_list partial; const char **pathspec = NULL; @@ -212,7 +237,8 @@ static char *prepare_index(int argc, const char **argv, const char *prefix) int fd = hold_locked_index(&index_lock, 1); add_files_to_cache(0, also ? prefix : NULL, pathspec); refresh_cache(REFRESH_QUIET); - if (write_cache(fd, active_cache, active_nr) || close(fd)) + if (write_cache(fd, active_cache, active_nr) || + close_lock_file(&index_lock)) die("unable to write new_index file"); commit_style = COMMIT_NORMAL; return index_lock.filename; @@ -231,7 +257,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix) fd = hold_locked_index(&index_lock, 1); refresh_cache(REFRESH_QUIET); if (write_cache(fd, active_cache, active_nr) || - close(fd) || commit_locked_index(&index_lock)) + commit_locked_index(&index_lock)) die("unable to write new_index file"); commit_style = COMMIT_AS_IS; return get_index_file(); @@ -273,23 +299,19 @@ static char *prepare_index(int argc, const char **argv, const char *prefix) fd = hold_locked_index(&index_lock, 1); add_remove_files(&partial); refresh_cache(REFRESH_QUIET); - if (write_cache(fd, active_cache, active_nr) || close(fd)) + if (write_cache(fd, active_cache, active_nr) || + close_lock_file(&index_lock)) die("unable to write new_index file"); fd = hold_lock_file_for_update(&false_lock, git_path("next-index-%d", getpid()), 1); - discard_cache(); - if (!initial_commit) { - tree = parse_tree_indirect(head_sha1); - if (!tree) - die("failed to unpack HEAD tree object"); - if (read_tree(tree, 0, NULL)) - die("failed to read HEAD tree object"); - } + + create_base_index(); add_remove_files(&partial); refresh_cache(REFRESH_QUIET); - if (write_cache(fd, active_cache, active_nr) || close(fd)) + if (write_cache(fd, active_cache, active_nr) || + close_lock_file(&false_lock)) die("unable to write temporary index file"); return false_lock.filename; } @@ -737,6 +759,17 @@ static const char commit_utf8_warn[] = "You may want to amend it after fixing the message, or set the config\n" "variable i18n.commitencoding to the encoding your project uses.\n"; +static void add_parent(struct strbuf *sb, const unsigned char *sha1) +{ + struct object *obj = parse_object(sha1); + const char *parent = sha1_to_hex(sha1); + if (!obj) + die("Unable to find commit parent %s", parent); + if (obj->type != OBJ_COMMIT) + die("Parent %s isn't a proper commit", parent); + strbuf_addf(sb, "parent %s\n", parent); +} + int cmd_commit(int argc, const char **argv, const char *prefix) { int header_len; @@ -799,21 +832,24 @@ int cmd_commit(int argc, const char **argv, const char *prefix) die("could not parse HEAD commit"); for (c = commit->parents; c; c = c->next) - strbuf_addf(&sb, "parent %s\n", - sha1_to_hex(c->item->object.sha1)); + add_parent(&sb, c->item->object.sha1); } else if (in_merge) { struct strbuf m; FILE *fp; reflog_msg = "commit (merge)"; - strbuf_addf(&sb, "parent %s\n", sha1_to_hex(head_sha1)); + add_parent(&sb, head_sha1); strbuf_init(&m, 0); fp = fopen(git_path("MERGE_HEAD"), "r"); if (fp == NULL) die("could not open %s for reading: %s", git_path("MERGE_HEAD"), strerror(errno)); - while (strbuf_getline(&m, fp, '\n') != EOF) - strbuf_addf(&sb, "parent %s\n", m.buf); + while (strbuf_getline(&m, fp, '\n') != EOF) { + unsigned char sha1[20]; + if (get_sha1_hex(m.buf, sha1) < 0) + die("Corrupt MERGE_HEAD file (%s)", m.buf); + add_parent(&sb, sha1); + } fclose(fp); strbuf_release(&m); } else { diff --git a/builtin-diff.c b/builtin-diff.c index 29365a0b17..8d7a5697f2 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -190,7 +190,7 @@ static void refresh_index_quietly(void) refresh_cache(REFRESH_QUIET|REFRESH_UNMERGED); if (active_cache_changed && - !write_cache(fd, active_cache, active_nr) && !close(fd)) + !write_cache(fd, active_cache, active_nr)) commit_locked_index(lock_file); rollback_lock_file(lock_file); diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c index 807fa93b53..e68e01592d 100644 --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@ -783,7 +783,6 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args, unlink(shallow); rollback_lock_file(&lock); } else { - close(fd); commit_lock_file(&lock); } } diff --git a/builtin-fsck.c b/builtin-fsck.c index e4874f64a3..2a6e94deaf 100644 --- a/builtin-fsck.c +++ b/builtin-fsck.c @@ -555,20 +555,23 @@ static int fsck_handle_reflog(const char *logname, const unsigned char *sha1, in return 0; } +static int is_branch(const char *refname) +{ + return !strcmp(refname, "HEAD") || !prefixcmp(refname, "refs/heads/"); +} + static int fsck_handle_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data) { struct object *obj; - obj = lookup_object(sha1); + obj = parse_object(sha1); if (!obj) { - if (has_sha1_file(sha1)) { - default_refs++; - return 0; /* it is in a pack */ - } error("%s: invalid sha1 pointer %s", refname, sha1_to_hex(sha1)); /* We'll continue with the rest despite the error.. */ return 0; } + if (obj->type != OBJ_COMMIT && is_branch(refname)) + error("%s: not a commit", refname); default_refs++; obj->used = 1; mark_reachable(obj, REACHABLE); diff --git a/builtin-http-fetch.c b/builtin-http-fetch.c index 4a50dbd95b..7f450c61d9 100644 --- a/builtin-http-fetch.c +++ b/builtin-http-fetch.c @@ -9,6 +9,7 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix) const char **write_ref = NULL; char **commit_id; const char *url; + char *rewritten_url = NULL; int arg = 1; int rc = 0; int get_tree = 0; @@ -51,6 +52,12 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix) commits = 1; } url = argv[arg]; + if (url && url[strlen(url)-1] != '/') { + rewritten_url = malloc(strlen(url)+2); + strcpy(rewritten_url, url); + strcat(rewritten_url, "/"); + url = rewritten_url; + } walker = get_http_walker(url); walker->get_tree = get_tree; @@ -73,5 +80,8 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix) walker_free(walker); + if (rewritten_url) + free(rewritten_url); + return rc; } diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c index c2caeeabe2..6dd31d1dd6 100644 --- a/builtin-ls-remote.c +++ b/builtin-ls-remote.c @@ -54,11 +54,11 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) uploadpack = arg + 7; continue; } - if (!strcmp("--tags", arg)) { + if (!strcmp("--tags", arg) || !strcmp("-t", arg)) { flags |= REF_TAGS; continue; } - if (!strcmp("--heads", arg)) { + if (!strcmp("--heads", arg) || !strcmp("-h", arg)) { flags |= REF_HEADS; continue; } diff --git a/builtin-mv.c b/builtin-mv.c index a3f9ad1744..990e21355d 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -264,7 +264,6 @@ int cmd_mv(int argc, const char **argv, const char *prefix) if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c index 1923fb1914..1aaa76dd1f 100644 --- a/builtin-pack-refs.c +++ b/builtin-pack-refs.c @@ -108,6 +108,12 @@ static int pack_refs(unsigned int flags) die("failed to write ref-pack file"); if (fflush(cbdata.refs_file) || fsync(fd) || fclose(cbdata.refs_file)) die("failed to write ref-pack file (%s)", strerror(errno)); + /* + * Since the lock file was fdopen()'ed and then fclose()'ed above, + * assign -1 to the lock file descriptor so that commit_lock_file() + * won't try to close() it. + */ + packed.fd = -1; if (commit_lock_file(&packed) < 0) die("unable to overwrite old ref-pack file (%s)", strerror(errno)); if (cbdata.flags & PACK_REFS_PRUNE) diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 43cd56a3b5..c0ea0342b7 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -283,7 +283,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) } if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file)) + commit_locked_index(&lock_file)) die("unable to write new index file"); return 0; } diff --git a/builtin-rerere.c b/builtin-rerere.c index 37e6248138..a9e3ebc137 100644 --- a/builtin-rerere.c +++ b/builtin-rerere.c @@ -61,9 +61,9 @@ static int write_rr(struct path_list *rr, int out_fd) write_in_full(out_fd, path, length) != length) die("unable to write rerere record"); } - if (close(out_fd) != 0) + if (commit_lock_file(&write_lock) != 0) die("unable to write rerere record"); - return commit_lock_file(&write_lock); + return 0; } static int handle_file(const char *path, diff --git a/builtin-reset.c b/builtin-reset.c index 10dba60c39..7ee811f0b8 100644 --- a/builtin-reset.c +++ b/builtin-reset.c @@ -108,7 +108,6 @@ static int update_index_refresh(int fd, struct lock_file *index_lock) return error("Could not read index"); result = refresh_cache(0) ? 1 : 0; if (write_cache(fd, active_cache, active_nr) || - close(fd) || commit_locked_index(index_lock)) return error ("Could not refresh index"); return result; diff --git a/builtin-revert.c b/builtin-revert.c index 4bf8eb2f58..358af53747 100644 --- a/builtin-revert.c +++ b/builtin-revert.c @@ -371,13 +371,13 @@ static int revert_or_cherry_pick(int argc, const char **argv) i++; } } - if (close(msg_fd) || commit_lock_file(&msg_file) < 0) + if (commit_lock_file(&msg_file) < 0) die ("Error wrapping up %s", defmsg); fprintf(stderr, "Automatic %s failed.%s\n", me, help_msg(commit->object.sha1)); exit(1); } - if (close(msg_fd) || commit_lock_file(&msg_file) < 0) + if (commit_lock_file(&msg_file) < 0) die ("Error wrapping up %s", defmsg); fprintf(stderr, "Finished one %s.\n", me); diff --git a/builtin-rm.c b/builtin-rm.c index a3d25e6a57..c0a8bb6cf5 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -250,7 +250,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (active_cache_changed) { if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(&lock_file)) + commit_locked_index(&lock_file)) die("Unable to write new index file"); } diff --git a/builtin-update-index.c b/builtin-update-index.c index e1a938d897..c3a14c74ed 100644 --- a/builtin-update-index.c +++ b/builtin-update-index.c @@ -738,7 +738,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) get_index_file(), strerror(lock_error)); } if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_locked_index(lock_file)) + commit_locked_index(lock_file)) die("Unable to write new index file"); } diff --git a/builtin-write-tree.c b/builtin-write-tree.c index b89d02efec..d16b9ed009 100644 --- a/builtin-write-tree.c +++ b/builtin-write-tree.c @@ -35,11 +35,9 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix) missing_ok, 0) < 0) die("git-write-tree: error building trees"); if (0 <= newfd) { - if (!write_cache(newfd, active_cache, active_nr) - && !close(newfd)) { - commit_lock_file(lock_file); + if (!write_cache(newfd, active_cache, active_nr) && + !commit_lock_file(lock_file)) newfd = -1; - } } /* Not being able to write is fine -- we are only interested * in updating the cache-tree part, and if the next caller @@ -60,8 +58,7 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix) hashcpy(sha1, active_cache_tree->sha1); if (0 <= newfd) - close(newfd); - rollback_lock_file(lock_file); + rollback_lock_file(lock_file); return 0; } diff --git a/bundle.c b/bundle.c index 316aa7420d..5c95eca07d 100644 --- a/bundle.c +++ b/bundle.c @@ -317,6 +317,14 @@ int create_bundle(struct bundle_header *header, const char *path, rls.git_cmd = 1; if (start_command(&rls)) return error("Could not spawn pack-objects"); + + /* + * start_command closed bundle_fd if it was > 1 + * so set the lock fd to -1 so commit_lock_file() + * won't fail trying to close it. + */ + lock.fd = -1; + for (i = 0; i < revs.pending.nr; i++) { struct object *object = revs.pending.objects[i].item; if (object->flags & UNINTERESTING) @@ -326,10 +334,8 @@ int create_bundle(struct bundle_header *header, const char *path, } if (finish_command(&rls)) return error ("pack-objects died"); - close(bundle_fd); - if (!bundle_to_stdout) - commit_lock_file(&lock); - return 0; + + return bundle_to_stdout ? close(bundle_fd) : commit_lock_file(&lock); } int unbundle(struct bundle_header *header, int bundle_fd) diff --git a/cache.h b/cache.h index 6fdc32a5f0..03d7883815 100644 --- a/cache.h +++ b/cache.h @@ -308,7 +308,7 @@ extern int commit_lock_file(struct lock_file *); extern int hold_locked_index(struct lock_file *, int); extern int commit_locked_index(struct lock_file *); extern void set_alternate_index_output(const char *); - +extern int close_lock_file(struct lock_file *); extern void rollback_lock_file(struct lock_file *); extern int delete_ref(const char *, const unsigned char *sha1); @@ -565,6 +565,7 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1, extern void pack_report(void); extern int open_pack_index(struct packed_git *); extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *); +extern void close_pack_windows(struct packed_git *); extern void unuse_pack(struct pack_window **); extern struct packed_git *add_packed_git(const char *, int, int); extern const unsigned char *nth_packed_object_sha1(struct packed_git *, uint32_t); diff --git a/command-list.txt b/command-list.txt index 6c2b1d830d..3583a33ee9 100644 --- a/command-list.txt +++ b/command-list.txt @@ -91,6 +91,7 @@ git-reflog ancillarymanipulators git-relink ancillarymanipulators git-remote ancillarymanipulators git-repack ancillarymanipulators +git-repo-config ancillarymanipulators deprecated git-request-pull foreignscminterface git-rerere ancillaryinterrogators git-reset mainporcelain common diff --git a/commit.c b/commit.c index f074811edc..8b8fb04d1f 100644 --- a/commit.c +++ b/commit.c @@ -48,19 +48,32 @@ struct commit *lookup_commit(const unsigned char *sha1) return check_commit(obj, sha1, 0); } -static unsigned long parse_commit_date(const char *buf) +static unsigned long parse_commit_date(const char *buf, const char *tail) { unsigned long date; + const char *dateptr; + if (buf + 6 >= tail) + return 0; if (memcmp(buf, "author", 6)) return 0; - while (*buf++ != '\n') + while (buf < tail && *buf++ != '\n') /* nada */; + if (buf + 9 >= tail) + return 0; if (memcmp(buf, "committer", 9)) return 0; - while (*buf++ != '>') + while (buf < tail && *buf++ != '>') /* nada */; - date = strtoul(buf, NULL, 10); + if (buf >= tail) + return 0; + dateptr = buf; + while (buf < tail && *buf++ != '\n') + /* nada */; + if (buf >= tail) + return 0; + /* dateptr < buf && buf[-1] == '\n', so strtoul will stop at buf-1 */ + date = strtoul(dateptr, NULL, 10); if (date == ULONG_MAX) date = 0; return date; @@ -236,9 +249,9 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size) return 0; item->object.parsed = 1; tail += size; - if (tail <= bufptr + 5 || memcmp(bufptr, "tree ", 5)) + if (tail <= bufptr + 46 || memcmp(bufptr, "tree ", 5) || bufptr[45] != '\n') return error("bogus commit object %s", sha1_to_hex(item->object.sha1)); - if (tail <= bufptr + 45 || get_sha1_hex(bufptr + 5, parent) < 0) + if (get_sha1_hex(bufptr + 5, parent) < 0) return error("bad tree pointer in commit %s", sha1_to_hex(item->object.sha1)); item->tree = lookup_tree(parent); @@ -275,7 +288,7 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size) n_refs++; } } - item->date = parse_commit_date(bufptr); + item->date = parse_commit_date(bufptr, tail); if (track_object_refs) { unsigned i = 0; diff --git a/config.c b/config.c index 857deb6c85..526a3f4294 100644 --- a/config.c +++ b/config.c @@ -955,14 +955,12 @@ int git_config_set_multivar(const char* key, const char* value, munmap(contents, contents_sz); } - if (close(fd) || commit_lock_file(lock) < 0) { + if (commit_lock_file(lock) < 0) { fprintf(stderr, "Cannot commit config file!\n"); ret = 4; goto out_free; } - /* fd is closed, so don't try to close it below. */ - fd = -1; /* * lock is committed, so don't try to roll it back below. * NOTE: Since lockfile.c keeps a linked list of all created @@ -973,8 +971,6 @@ int git_config_set_multivar(const char* key, const char* value, ret = 0; out_free: - if (0 <= fd) - close(fd); if (lock) rollback_lock_file(lock); free(config_filename); @@ -1072,7 +1068,7 @@ int git_config_rename_section(const char *old_name, const char *new_name) } fclose(config_file); unlock_and_out: - if (close(out_fd) || commit_lock_file(lock) < 0) + if (commit_lock_file(lock) < 0) ret = error("Cannot commit config file!"); out: free(config_filename); diff --git a/config.mak.in b/config.mak.in index 15fb26cb92..40b14d985a 100644 --- a/config.mak.in +++ b/config.mak.in @@ -40,6 +40,7 @@ NO_MEMMEM=@NO_MEMMEM@ NO_STRLCPY=@NO_STRLCPY@ NO_STRTOUMAX=@NO_STRTOUMAX@ NO_SETENV=@NO_SETENV@ +NO_UNSETENV=@NO_UNSETENV@ NO_MKDTEMP=@NO_MKDTEMP@ NO_ICONV=@NO_ICONV@ OLD_ICONV=@OLD_ICONV@ diff --git a/configure.ac b/configure.ac index 6f641e32f0..af177fdb4d 100644 --- a/configure.ac +++ b/configure.ac @@ -356,6 +356,12 @@ AC_CHECK_FUNC(setenv, [NO_SETENV=YesPlease]) AC_SUBST(NO_SETENV) # +# Define NO_UNSETENV if you don't have unsetenv in the C library. +AC_CHECK_FUNC(unsetenv, +[NO_UNSETENV=], +[NO_UNSETENV=YesPlease]) +AC_SUBST(NO_UNSETENV) +# # Define NO_MKDTEMP if you don't have mkdtemp in the C library. AC_CHECK_FUNC(mkdtemp, [NO_MKDTEMP=], diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 343364de04..0d33f9a3dc 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -333,7 +333,7 @@ __git_commands () read-tree) : plumbing;; receive-pack) : plumbing;; reflog) : plumbing;; - repo-config) : plumbing;; + repo-config) : deprecated;; rerere) : plumbing;; rev-list) : plumbing;; rev-parse) : plumbing;; @@ -970,18 +970,18 @@ _git_remote () while [ $c -lt $COMP_CWORD ]; do i="${COMP_WORDS[c]}" case "$i" in - add|show|prune|update) command="$i"; break ;; + add|rm|show|prune|update) command="$i"; break ;; esac c=$((++c)) done if [ $c -eq $COMP_CWORD -a -z "$command" ]; then - __gitcomp "add show prune update" + __gitcomp "add rm show prune update" return fi case "$command" in - show|prune) + rm|show|prune) __gitcomp "$(__git_remotes)" ;; update) diff --git a/contrib/examples/git-tag.sh b/contrib/examples/git-tag.sh index ae7c531666..e9f3a228af 100755 --- a/contrib/examples/git-tag.sh +++ b/contrib/examples/git-tag.sh @@ -167,7 +167,7 @@ type=$(git cat-file -t $object) || exit 1 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1 test -n "$username" || - username=$(git repo-config user.signingkey) || + username=$(git config user.signingkey) || username=$(expr "z$tagger" : 'z\(.*>\)') trap 'rm -f "$GIT_DIR"/TAG_TMP* "$GIT_DIR"/TAG_FINALMSG "$GIT_DIR"/TAG_EDITMSG' 0 diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py index 9befb92c41..c35b15860d 100755 --- a/contrib/hg-to-git/hg-to-git.py +++ b/contrib/hg-to-git/hg-to-git.py @@ -1,6 +1,6 @@ #! /usr/bin/python -""" hg-to-svn.py - A Mercurial to GIT converter +""" hg-to-git.py - A Mercurial to GIT converter Copyright (C)2007 Stelian Pop @@ -27,6 +27,8 @@ import re hgvers = {} # List of children for each hg revision hgchildren = {} +# List of parents for each hg revision +hgparents = {} # Current branch for each hg revision hgbranch = {} # Number of new changesets converted from hg @@ -99,17 +101,19 @@ if state: else: print 'State does not exist, first run' -tip = os.popen('hg tip | head -1 | cut -f 2 -d :').read().strip() +tip = os.popen('hg tip --template "{rev}"').read() print 'tip is', tip # Calculate the branches print 'analysing the branches...' hgchildren["0"] = () +hgparents["0"] = (None, None) hgbranch["0"] = "master" for cset in range(1, int(tip) + 1): hgchildren[str(cset)] = () - prnts = os.popen('hg log -r %d | grep ^parent: | cut -f 2 -d :' % cset).readlines() - if len(prnts) > 0: + prnts = os.popen('hg log -r %d --template "{parents}"' % cset).read().split(' ') + prnts = map(lambda x: x[:x.find(':')], prnts) + if prnts[0] != '': parent = prnts[0].strip() else: parent = str(cset - 1) @@ -120,6 +124,8 @@ for cset in range(1, int(tip) + 1): else: mparent = None + hgparents[str(cset)] = (parent, mparent) + if mparent: # For merge changesets, take either one, preferably the 'master' branch if hgbranch[mparent] == 'master': @@ -147,34 +153,27 @@ for cset in range(int(tip) + 1): hgnewcsets += 1 # get info - prnts = os.popen('hg log -r %d | grep ^parent: | cut -f 2 -d :' % cset).readlines() - if len(prnts) > 0: - parent = prnts[0].strip() - else: - parent = str(cset - 1) - if len(prnts) > 1: - mparent = prnts[1].strip() - else: - mparent = None + log_data = os.popen('hg log -r %d --template "{tags}\n{date|date}\n{author}\n"' % cset).readlines() + tag = log_data[0].strip() + date = log_data[1].strip() + user = log_data[2].strip() + parent = hgparents[str(cset)][0] + mparent = hgparents[str(cset)][1] + #get comment (fdcomment, filecomment) = tempfile.mkstemp() - csetcomment = os.popen('hg log -r %d -v | grep -v ^changeset: | grep -v ^parent: | grep -v ^user: | grep -v ^date | grep -v ^files: | grep -v ^description: | grep -v ^tag:' % cset).read().strip() + csetcomment = os.popen('hg log -r %d --template "{desc}"' % cset).read().strip() os.write(fdcomment, csetcomment) os.close(fdcomment) - date = os.popen('hg log -r %d | grep ^date: | cut -f 2- -d :' % cset).read().strip() - - tag = os.popen('hg log -r %d | grep ^tag: | cut -f 2- -d :' % cset).read().strip() - - user = os.popen('hg log -r %d | grep ^user: | cut -f 2- -d :' % cset).read().strip() - print '-----------------------------------------' print 'cset:', cset print 'branch:', hgbranch[str(cset)] print 'user:', user print 'date:', date print 'comment:', csetcomment - print 'parent:', parent + if parent: + print 'parent:', parent if mparent: print 'mparent:', mparent if tag: @@ -224,8 +223,7 @@ for cset in range(int(tip) + 1): os.system('git-branch -d %s' % otherbranch) # retrieve and record the version - vvv = os.popen('git-show | head -1').read() - vvv = vvv[vvv.index(' ') + 1 : ].strip() + vvv = os.popen('git-show --quiet --pretty=format:%H').read() print 'record', cset, '->', vvv hgvers[str(cset)] = vvv diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 7511ea0797..77c88ebf1f 100644 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -248,24 +248,24 @@ generate_update_branch_email() # In this case we want to issue an email containing only revisions # 3, 4, and N. Given (almost) by # - # git-rev-list N ^O --not --all + # git rev-list N ^O --not --all # # The reason for the "almost", is that the "--not --all" will take # precedence over the "N", and effectively will translate to # - # git-rev-list N ^O ^X ^N + # git rev-list N ^O ^X ^N # - # So, we need to build up the list more carefully. git-rev-parse - # will generate a list of revs that may be fed into git-rev-list. + # So, we need to build up the list more carefully. git rev-parse + # will generate a list of revs that may be fed into git rev-list. # We can get it to make the "--not --all" part and then filter out # the "^N" with: # - # git-rev-parse --not --all | grep -v N + # git rev-parse --not --all | grep -v N # - # Then, using the --stdin switch to git-rev-list we have effectively + # Then, using the --stdin switch to git rev-list we have effectively # manufactured # - # git-rev-list N ^O ^X + # git rev-list N ^O ^X # # This leaves a problem when someone else updates the repository # while this script is running. Their new value of the ref we're @@ -274,10 +274,10 @@ generate_update_branch_email() # all of our commits. What we really want is to exclude the current # value of $refname from the --not list, rather than N itself. So: # - # git-rev-parse --not --all | grep -v $(git-rev-parse $refname) + # git rev-parse --not --all | grep -v $(git rev-parse $refname) # # Get's us to something pretty safe (apart from the small time - # between refname being read, and git-rev-parse running - for that, + # between refname being read, and git rev-parse running - for that, # I give up) # # @@ -295,7 +295,7 @@ generate_update_branch_email() # As above, we need to take into account the presence of X; if # another branch is already in the repository and points at some of # the revisions that we are about to output - we don't want them. - # The solution is as before: git-rev-parse output filtered. + # The solution is as before: git rev-parse output filtered. # # Finally, tags: 1 --- 2 --- O --- T --- 3 --- 4 --- N # @@ -305,7 +305,7 @@ generate_update_branch_email() # for a branch update. Therefore we still want to output revisions # that have been output on a tag email. # - # Luckily, git-rev-parse includes just the tool. Instead of using + # Luckily, git rev-parse includes just the tool. Instead of using # "--all" we use "--branches"; this has the added benefit that # "remotes/" will be ignored as well. @@ -454,7 +454,7 @@ generate_update_atag_email() # generate_atag_email() { - # Use git-for-each-ref to pull out the individual fields from the + # Use git for-each-ref to pull out the individual fields from the # tag eval $(git for-each-ref --shell --format=' tagobject=%(*objectname) @@ -572,7 +572,7 @@ generate_general_email() else # What can we do here? The tag marks an object that is not # a commit, so there is no log for us to display. It's - # probably not wise to output git-cat-file as it could be a + # probably not wise to output git cat-file as it could be a # binary blob. We'll just say how big it is echo "$newrev is a $newrev_type, and is $(git cat-file -s $newrev) bytes long." fi @@ -622,10 +622,10 @@ then projectdesc="UNNAMED PROJECT" fi -recipients=$(git repo-config hooks.mailinglist) -announcerecipients=$(git repo-config hooks.announcelist) -envelopesender=$(git-repo-config hooks.envelopesender) -emailprefix=$(git-repo-config hooks.emailprefix || echo '[SCM] ') +recipients=$(git config hooks.mailinglist) +announcerecipients=$(git config hooks.announcelist) +envelopesender=$(git config hooks.envelopesender) +emailprefix=$(git config hooks.emailprefix || echo '[SCM] ') # --- Main loop # Allow dual mode: run from the command line just like the update hook, or diff --git a/convert.c b/convert.c index 4df75595b1..80f114b2e2 100644 --- a/convert.c +++ b/convert.c @@ -17,8 +17,8 @@ #define CRLF_INPUT 2 struct text_stat { - /* CR, LF and CRLF counts */ - unsigned cr, lf, crlf; + /* NUL, CR, LF and CRLF counts */ + unsigned nul, cr, lf, crlf; /* These are just approximations! */ unsigned printable, nonprintable; @@ -51,6 +51,9 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat * case '\b': case '\t': case '\033': case '\014': stats->printable++; break; + case 0: + stats->nul++; + /* fall through */ default: stats->nonprintable++; } @@ -66,6 +69,8 @@ static void gather_stats(const char *buf, unsigned long size, struct text_stat * static int is_binary(unsigned long size, struct text_stat *stats) { + if (stats->nul) + return 1; if ((stats->printable >> 7) < stats->nonprintable) return 1; /* diff --git a/diff.c b/diff.c index b18c140e3d..5b8afdcb05 100644 --- a/diff.c +++ b/diff.c @@ -552,7 +552,8 @@ static void fn_out_consume(void *priv, char *line, unsigned long len) int i; int color; struct emit_callback *ecbdata = priv; - const char *set = diff_get_color(ecbdata->color_diff, DIFF_METAINFO); + const char *meta = diff_get_color(ecbdata->color_diff, DIFF_METAINFO); + const char *plain = diff_get_color(ecbdata->color_diff, DIFF_PLAIN); const char *reset = diff_get_color(ecbdata->color_diff, DIFF_RESET); *(ecbdata->found_changesp) = 1; @@ -564,9 +565,9 @@ static void fn_out_consume(void *priv, char *line, unsigned long len) name_b_tab = strchr(ecbdata->label_path[1], ' ') ? "\t" : ""; printf("%s--- %s%s%s\n", - set, ecbdata->label_path[0], reset, name_a_tab); + meta, ecbdata->label_path[0], reset, name_a_tab); printf("%s+++ %s%s%s\n", - set, ecbdata->label_path[1], reset, name_b_tab); + meta, ecbdata->label_path[1], reset, name_b_tab); ecbdata->label_path[0] = ecbdata->label_path[1] = NULL; } @@ -586,7 +587,6 @@ static void fn_out_consume(void *priv, char *line, unsigned long len) } if (len < ecbdata->nparents) { - set = reset; emit_line(reset, reset, line, len); return; } @@ -610,7 +610,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len) diff_words_show(ecbdata->diff_words); line++; len--; - emit_line(set, reset, line, len); + emit_line(plain, reset, line, len); return; } for (i = 0; i < ecbdata->nparents && len; i++) { @@ -1224,7 +1224,7 @@ static const char *diff_funcname_pattern(struct diff_filespec *one) /* * And define built-in fallback patterns here. Note that - * these can be overriden by the user's config settings. + * these can be overridden by the user's config settings. */ for (i = 0; i < ARRAY_SIZE(builtin_funcname_pattern); i++) if (!strcmp(ident, builtin_funcname_pattern[i].name)) diff --git a/fast-import.c b/fast-import.c index 82e9161339..45b4edf36b 100644 --- a/fast-import.c +++ b/fast-import.c @@ -917,6 +917,7 @@ static void end_packfile(void) struct branch *b; struct tag *t; + close_pack_windows(pack_data); fixup_pack_header_footer(pack_data->pack_fd, pack_data->sha1, pack_data->pack_name, object_count); close(pack_data->pack_fd); @@ -926,7 +927,6 @@ static void end_packfile(void) new_p = add_packed_git(idx_name, strlen(idx_name), 1); if (!new_p) die("core git rejected index %s", idx_name); - new_p->windows = old_p->windows; all_packs[pack_id] = new_p; install_packed_git(new_p); @@ -1129,8 +1129,10 @@ static void *gfi_unpack_entry( { enum object_type type; struct packed_git *p = all_packs[oe->pack_id]; - if (p == pack_data) + if (p == pack_data && p->pack_size < (pack_size + 20)) { + close_pack_windows(p); p->pack_size = pack_size + 20; + } return unpack_entry(p, oe->offset, &type, sizep); } @@ -1539,17 +1541,36 @@ static void dump_marks(void) f = fdopen(mark_fd, "w"); if (!f) { + int saved_errno = errno; rollback_lock_file(&mark_lock); failure |= error("Unable to write marks file %s: %s", - mark_file, strerror(errno)); + mark_file, strerror(saved_errno)); return; } + /* + * Since the lock file was fdopen()'ed, it should not be close()'ed. + * Assign -1 to the lock file descriptor so that commit_lock_file() + * won't try to close() it. + */ + mark_lock.fd = -1; + dump_marks_helper(f, 0, marks); - fclose(f); - if (commit_lock_file(&mark_lock)) + if (ferror(f) || fclose(f)) { + int saved_errno = errno; + rollback_lock_file(&mark_lock); failure |= error("Unable to write marks file %s: %s", - mark_file, strerror(errno)); + mark_file, strerror(saved_errno)); + return; + } + + if (commit_lock_file(&mark_lock)) { + int saved_errno = errno; + rollback_lock_file(&mark_lock); + failure |= error("Unable to commit marks file %s: %s", + mark_file, strerror(saved_errno)); + return; + } } static int read_next_command(void) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 6d8ff93f5f..5694978c46 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -88,7 +88,7 @@ sub write_author_info($) { close ($f); } -# convert getopts specs for use by git-repo-config +# convert getopts specs for use by git config sub read_repo_config { # Split the string between characters, unless there is a ':' # So "abc:de" becomes ["a", "b", "c:", "d", "e"] @@ -96,7 +96,7 @@ sub read_repo_config { foreach my $o (@opts) { my $key = $o; $key =~ s/://g; - my $arg = 'git-repo-config'; + my $arg = 'git config'; $arg .= ' --bool' if ($o !~ /:$/); chomp(my $tmp = `$arg --get cvsimport.$key`); @@ -116,7 +116,7 @@ getopts($opts) or usage(); usage if $opt_h; if (@ARGV == 0) { - chomp(my $module = `git-repo-config --get cvsimport.module`); + chomp(my $module = `git config --get cvsimport.module`); push(@ARGV, $module) if $? == 0; } @ARGV <= 1 or usage("You can't specify more than one CVS module"); diff --git a/git-gui/Makefile b/git-gui/Makefile index c109eab137..1baf4b0861 100644 --- a/git-gui/Makefile +++ b/git-gui/Makefile @@ -110,7 +110,7 @@ TCLTK_PATH_SED = $(subst ','\'',$(subst \,\\,$(TCLTK_PATH))) gg_libdir ?= $(sharedir)/git-gui/lib libdir_SQ = $(subst ','\'',$(gg_libdir)) -libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir))) +libdir_SED = $(subst ','\'',$(subst \,\\,$(gg_libdir_sed_in))) exedir = $(dir $(gitexecdir))share/git-gui/lib GITGUI_SCRIPT := $$0 @@ -119,11 +119,12 @@ GITGUI_MACOSXAPP := ifeq ($(uname_O),Cygwin) GITGUI_SCRIPT := `cygpath --windows --absolute "$(GITGUI_SCRIPT)"` - gg_libdir := $(shell cygpath --windows --absolute "$(gg_libdir)") + gg_libdir_sed_in := $(shell cygpath --windows --absolute "$(gg_libdir)") else ifeq ($(exedir),$(gg_libdir)) GITGUI_RELATIVE := 1 endif + gg_libdir_sed_in := $(gg_libdir) endif ifeq ($(uname_S),Darwin) ifeq ($(shell test -d $(TKFRAMEWORK) && echo y),y) diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl index 2bac50e149..86faf24cc8 100644 --- a/git-gui/lib/choose_repository.tcl +++ b/git-gui/lib/choose_repository.tcl @@ -290,11 +290,6 @@ method _write_local_path {args} { } method _git_init {} { - if {[file exists $local_path]} { - error_popup [mc "Location %s already exists." $local_path] - return 0 - } - if {[catch {file mkdir $local_path} err]} { error_popup [strcat \ [mc "Failed to create repository %s:" $local_path] \ @@ -417,41 +412,35 @@ method _new_local_path {} { if {$p eq {}} return set p [file normalize $p] - if {[file isdirectory $p]} { - foreach i [glob \ - -directory $p \ - -tails \ - -nocomplain \ - * .*] { - switch -- $i { - . continue - .. continue - default { - error_popup [mc "Directory %s already exists." $p] - return - } - } - } - if {[catch {file delete $p} err]} { - error_popup [strcat \ - [mc "Directory %s already exists." $p] \ - "\n\n$err"] - return - } - } elseif {[file exists $p]} { - error_popup [mc "File %s already exists." $p] + if {![_new_ok $p]} { return } set local_path $p } method _do_new2 {} { + if {![_new_ok $local_path]} { + return + } if {![_git_init $this]} { return } set done 1 } +proc _new_ok {p} { + if {[file isdirectory $p]} { + if {[_is_git [file join $p .git]]} { + error_popup [mc "Directory %s already exists." $p] + return 0 + } + } elseif {[file exists $p]} { + error_popup [mc "File %s already exists." $p] + return 0 + } + return 1 +} + ###################################################################### ## ## Clone Existing Repository @@ -607,6 +596,11 @@ method _do_clone2 {} { } } + if {[file exists $local_path]} { + error_popup [mc "Location %s already exists." $local_path] + return + } + if {![_git_init $this]} return set local_path [pwd] diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index 18aba3eae3..d04f6dbde2 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -358,5 +358,7 @@ proc apply_hunk {x y} { display_file $current_diff_path $mi if {$o eq {_}} { clear_diff + } else { + set current_diff_path $current_diff_path } } diff --git a/git-gui/lib/index.tcl b/git-gui/lib/index.tcl index a0b22f2945..30a244cc17 100644 --- a/git-gui/lib/index.tcl +++ b/git-gui/lib/index.tcl @@ -386,7 +386,9 @@ proc revert_helper {txt paths} { set reply [tk_dialog \ .confirm_revert \ "[appname] ([reponame])" \ - [mc "Any unstaged changes will be permanently lost by the revert."] \ + "$query + +[mc "Any unstaged changes will be permanently lost by the revert."]" \ question \ 1 \ [mc "Do Nothing"] \ diff --git a/git-gui/po/de.po b/git-gui/po/de.po index ac8ae0a205..2dfe07e06f 100644 --- a/git-gui/po/de.po +++ b/git-gui/po/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: git-gui\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-11-24 10:36+0100\n" -"PO-Revision-Date: 2007-11-24 10:55+0100\n" +"PO-Revision-Date: 2008-01-15 20:33+0100\n" "Last-Translator: Christian Stimming \n" "Language-Team: German\n" "MIME-Version: 1.0\n" @@ -272,7 +272,7 @@ msgstr "Neue Version" #: git-gui.sh:1973 git-gui.sh:2357 msgid "Amend Last Commit" -msgstr "Letzte Version nachbessern" +msgstr "Letzte nachbessern" #: git-gui.sh:1982 git-gui.sh:2317 lib/remote_branch_delete.tcl:99 msgid "Rescan" @@ -284,7 +284,7 @@ msgstr "Zum Eintragen bereitstellen" #: git-gui.sh:1994 msgid "Stage Changed Files To Commit" -msgstr "Geänderte Dateien zum Eintragen bereitstellen" +msgstr "Geänderte Dateien bereitstellen" #: git-gui.sh:2000 msgid "Unstage From Commit" @@ -292,7 +292,7 @@ msgstr "Aus der Bereitstellung herausnehmen" #: git-gui.sh:2005 lib/index.tcl:393 msgid "Revert Changes" -msgstr "Änderungen revidieren" +msgstr "Änderungen verwerfen" #: git-gui.sh:2012 git-gui.sh:2329 git-gui.sh:2427 msgid "Sign Off" @@ -351,7 +351,7 @@ msgstr "Aktueller Zweig:" #: git-gui.sh:2255 msgid "Staged Changes (Will Commit)" -msgstr "Bereitgestellte Änderungen (zum Eintragen)" +msgstr "Bereitstellung (zum Eintragen)" #: git-gui.sh:2274 msgid "Unstaged Changes" @@ -403,7 +403,7 @@ msgstr "Aktualisieren" #: git-gui.sh:2566 msgid "Apply/Reverse Hunk" -msgstr "Änderung anwenden/umkehren" +msgstr "Kontext anwenden/umkehren" #: git-gui.sh:2572 msgid "Decrease Font Size" @@ -415,19 +415,19 @@ msgstr "Schriftgröße vergrößern" #: git-gui.sh:2581 msgid "Show Less Context" -msgstr "Weniger Kontext anzeigen" +msgstr "Weniger Zeilen anzeigen" #: git-gui.sh:2588 msgid "Show More Context" -msgstr "Mehr Kontext anzeigen" +msgstr "Mehr Zeilen anzeigen" #: git-gui.sh:2602 msgid "Unstage Hunk From Commit" -msgstr "Aus der Bereitstellung herausnehmen" +msgstr "Kontext aus Bereitstellung herausnehmen" #: git-gui.sh:2604 msgid "Stage Hunk For Commit" -msgstr "In die Bereitstellung hinzufügen" +msgstr "Kontext zur Bereitstellung hinzufügen" #: git-gui.sh:2623 msgid "Initializing..." @@ -914,11 +914,11 @@ msgstr "Neu..." #: lib/choose_repository.tcl:93 lib/choose_repository.tcl:468 msgid "Clone Existing Repository" -msgstr "Projektarchiv kopieren" +msgstr "Projektarchiv klonen" #: lib/choose_repository.tcl:99 msgid "Clone..." -msgstr "Kopieren..." +msgstr "Klonen..." #: lib/choose_repository.tcl:106 lib/choose_repository.tcl:978 msgid "Open Existing Repository" @@ -968,7 +968,7 @@ msgstr "Datei »%s« existiert bereits." #: lib/choose_repository.tcl:463 msgid "Clone" -msgstr "Kopieren" +msgstr "Klonen" #: lib/choose_repository.tcl:476 msgid "URL:" @@ -976,7 +976,7 @@ msgstr "URL:" #: lib/choose_repository.tcl:496 msgid "Clone Type:" -msgstr "Art der Kopie:" +msgstr "Art des Klonens:" #: lib/choose_repository.tcl:502 msgid "Standard (Fast, Semi-Redundant, Hardlinks)" @@ -1025,7 +1025,7 @@ msgstr "Kopien von Objekten/Info/Alternates konnten nicht erstellt werden: %s" #: lib/choose_repository.tcl:690 #, tcl-format msgid "Nothing to clone from %s." -msgstr "Von »%s« konnte nichts kopiert werden." +msgstr "Von »%s« konnte nichts geklont werden." #: lib/choose_repository.tcl:692 lib/choose_repository.tcl:906 #: lib/choose_repository.tcl:918 @@ -1086,7 +1086,7 @@ msgstr "Verzeichnis »%s« kann nicht aufgeräumt werden." #: lib/choose_repository.tcl:897 msgid "Clone failed." -msgstr "Kopieren fehlgeschlagen." +msgstr "Klonen fehlgeschlagen." #: lib/choose_repository.tcl:904 msgid "No default branch obtained." @@ -1440,11 +1440,11 @@ msgstr "Fehler beim Laden des Vergleichs:" #: lib/diff.tcl:302 msgid "Failed to unstage selected hunk." -msgstr "Fehler beim Herausnehmen der gewählten Dateien aus der Bereitstellung." +msgstr "Fehler beim Herausnehmen des gewählten Kontexts aus der Bereitstellung." #: lib/diff.tcl:309 msgid "Failed to stage selected hunk." -msgstr "Fehler beim Bereitstellen der gewählten Dateien." +msgstr "Fehler beim Bereitstellen des gewählten Kontexts." #: lib/error.tcl:12 lib/error.tcl:102 msgid "error" @@ -1494,17 +1494,16 @@ msgstr "»%s« hinzufügen..." #: lib/index.tcl:381 #, tcl-format msgid "Revert changes in file %s?" -msgstr "Änderungen in Datei »%s« revidieren?" +msgstr "Änderungen in Datei »%s« verwerfen?" #: lib/index.tcl:383 #, tcl-format msgid "Revert changes in these %i files?" -msgstr "Änderungen in den gewählten %i Dateien revidieren?" +msgstr "Änderungen in den gewählten %i Dateien verwerfen?" #: lib/index.tcl:389 msgid "Any unstaged changes will be permanently lost by the revert." -msgstr "" -"Alle nicht bereitgestellten Änderungen werden beim Revidieren verloren gehen." +msgstr "Alle nicht bereitgestellten Änderungen werden beim Verwerfen verloren gehen." #: lib/index.tcl:392 msgid "Do Nothing" @@ -1730,7 +1729,7 @@ msgstr "Optionen konnten nicht gespeichert werden:" #: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 msgid "Delete Remote Branch" -msgstr "Zweig im anderen Projektarchiv löschen" +msgstr "Zweig aus anderem Projektarchiv löschen" #: lib/remote_branch_delete.tcl:47 msgid "From Repository" @@ -1852,7 +1851,7 @@ msgstr "Neue Änderungen von »%s« holen" #: lib/transport.tcl:18 #, tcl-format msgid "remote prune %s" -msgstr "Entfernen von »%s« im anderen Archiv" +msgstr "Entfernen von »%s« aus anderem Archiv" #: lib/transport.tcl:19 #, tcl-format diff --git a/git-gui/po/fr.po b/git-gui/po/fr.po new file mode 100644 index 0000000000..d389bdaca1 --- /dev/null +++ b/git-gui/po/fr.po @@ -0,0 +1,1875 @@ +# translation of fr.po to French +# Translation of git-gui to French. +# Copyright (C) 2008 Shawn Pearce, et al. +# This file is distributed under the same license as the git package. +# +# Christian Couder , 2008. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-11-24 10:36+0100\n" +"PO-Revision-Date: 2008-01-14 21:08+0100\n" +"Last-Translator: Christian Couder \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: git-gui.sh:41 git-gui.sh:604 git-gui.sh:618 git-gui.sh:631 git-gui.sh:714 +#: git-gui.sh:733 +msgid "git-gui: fatal error" +msgstr "git-gui: erreur fatale" + +#: git-gui.sh:565 +#, tcl-format +msgid "Invalid font specified in %s:" +msgstr "Invalide fonte spécifiée dans %s :" + +#: git-gui.sh:590 +msgid "Main Font" +msgstr "Fonte principale" + +#: git-gui.sh:591 +msgid "Diff/Console Font" +msgstr "Fonte diff/console" + +#: git-gui.sh:605 +msgid "Cannot find git in PATH." +msgstr "Impossible de trouver git dans PATH." + +#: git-gui.sh:632 +msgid "Cannot parse Git version string:" +msgstr "Impossible de parser la version de Git :" + +#: git-gui.sh:650 +#, tcl-format +msgid "" +"Git version cannot be determined.\n" +"\n" +"%s claims it is version '%s'.\n" +"\n" +"%s requires at least Git 1.5.0 or later.\n" +"\n" +"Assume '%s' is version 1.5.0?\n" +msgstr "" +"Impossible de déterminer la version de Git.\n" +"\n" +"%s affirme qu'il s'agit de la version '%s'.\n" +"\n" +"%s nécessite au moins Git 1.5.0.\n" +"\n" +"Peut'on considérer que '%s' est en version 1.5.0 ?\n" + +#: git-gui.sh:888 +msgid "Git directory not found:" +msgstr "Impossible de trouver le répertoire de Git :" + +#: git-gui.sh:895 +msgid "Cannot move to top of working directory:" +msgstr "Impossible d'aller à la racine du répertoire de travail :" + +#: git-gui.sh:902 +msgid "Cannot use funny .git directory:" +msgstr "Impossible d'utiliser un drôle de répertoire git :" + +#: git-gui.sh:907 +msgid "No working directory" +msgstr "Pas de répertoire de travail" + +#: git-gui.sh:1054 +msgid "Refreshing file status..." +msgstr "Rafraichissement du status des fichiers..." + +#: git-gui.sh:1119 +msgid "Scanning for modified files ..." +msgstr "Recherche de fichiers modifiés..." + +#: git-gui.sh:1294 lib/browser.tcl:245 +msgid "Ready." +msgstr "Prêt." + +#: git-gui.sh:1560 +msgid "Unmodified" +msgstr "Non modifié" + +#: git-gui.sh:1562 +msgid "Modified, not staged" +msgstr "Modifié, non pré-commité" + +#: git-gui.sh:1563 git-gui.sh:1568 +msgid "Staged for commit" +msgstr "Pré-commité" + +#: git-gui.sh:1564 git-gui.sh:1569 +msgid "Portions staged for commit" +msgstr "En partie pré-commité" + +#: git-gui.sh:1565 git-gui.sh:1570 +msgid "Staged for commit, missing" +msgstr "Pré-commité, manquant" + +#: git-gui.sh:1567 +msgid "Untracked, not staged" +msgstr "Non suivi, non pré-commité" + +#: git-gui.sh:1572 +msgid "Missing" +msgstr "Manquant" + +#: git-gui.sh:1573 +msgid "Staged for removal" +msgstr "Pré-commité pour suppression" + +#: git-gui.sh:1574 +msgid "Staged for removal, still present" +msgstr "Pré-commité pour suppression, toujours présent" + +#: git-gui.sh:1576 git-gui.sh:1577 git-gui.sh:1578 git-gui.sh:1579 +msgid "Requires merge resolution" +msgstr "Nécessite la résolution d'une fusion" + +#: git-gui.sh:1614 +msgid "Starting gitk... please wait..." +msgstr "Lancement de gitk... merci de patienter..." + +#: git-gui.sh:1623 +#, tcl-format +msgid "" +"Unable to start gitk:\n" +"\n" +"%s does not exist" +msgstr "" +"Impossible de lancer gitk :\n" +"\n" +"%s inexistant" + +#: git-gui.sh:1823 lib/choose_repository.tcl:35 +msgid "Repository" +msgstr "Référentiel" + +#: git-gui.sh:1824 +msgid "Edit" +msgstr "Editer" + +#: git-gui.sh:1826 lib/choose_rev.tcl:560 +msgid "Branch" +msgstr "Branche" + +#: git-gui.sh:1829 lib/choose_rev.tcl:547 +msgid "Commit@@noun" +msgstr "Commit" + +#: git-gui.sh:1832 lib/merge.tcl:121 lib/merge.tcl:150 lib/merge.tcl:168 +msgid "Merge" +msgstr "Fusionner" + +#: git-gui.sh:1833 lib/choose_rev.tcl:556 +msgid "Remote" +msgstr "Référentiel distant" + +#: git-gui.sh:1842 +msgid "Browse Current Branch's Files" +msgstr "Visionner fichiers dans branche courante" + +#: git-gui.sh:1846 +msgid "Browse Branch Files..." +msgstr "Visionner fichiers de branche" + +#: git-gui.sh:1851 +msgid "Visualize Current Branch's History" +msgstr "Visualiser historique branche courante" + +#: git-gui.sh:1855 +msgid "Visualize All Branch History" +msgstr "Visualiser historique toutes branches" + +#: git-gui.sh:1862 +#, tcl-format +msgid "Browse %s's Files" +msgstr "Visionner fichiers de %s" + +#: git-gui.sh:1864 +#, tcl-format +msgid "Visualize %s's History" +msgstr "Visualiser historique de %s" + +#: git-gui.sh:1869 lib/database.tcl:27 lib/database.tcl:67 +msgid "Database Statistics" +msgstr "Statistiques base de donnée" + +#: git-gui.sh:1872 lib/database.tcl:34 +msgid "Compress Database" +msgstr "Comprimer base de donnée" + +#: git-gui.sh:1875 +msgid "Verify Database" +msgstr "Vérifier base de donnée" + +#: git-gui.sh:1882 git-gui.sh:1886 git-gui.sh:1890 lib/shortcut.tcl:7 +#: lib/shortcut.tcl:39 lib/shortcut.tcl:71 +msgid "Create Desktop Icon" +msgstr "Créer icône sur bureau" + +#: git-gui.sh:1895 lib/choose_repository.tcl:176 lib/choose_repository.tcl:184 +msgid "Quit" +msgstr "Quitter" + +#: git-gui.sh:1902 +msgid "Undo" +msgstr "Défaire" + +#: git-gui.sh:1905 +msgid "Redo" +msgstr "Refaire" + +#: git-gui.sh:1909 git-gui.sh:2403 +msgid "Cut" +msgstr "Couper" + +#: git-gui.sh:1912 git-gui.sh:2406 git-gui.sh:2477 git-gui.sh:2549 +#: lib/console.tcl:67 +msgid "Copy" +msgstr "Copier" + +#: git-gui.sh:1915 git-gui.sh:2409 +msgid "Paste" +msgstr "Coller" + +#: git-gui.sh:1918 git-gui.sh:2412 lib/branch_delete.tcl:26 +#: lib/remote_branch_delete.tcl:38 +msgid "Delete" +msgstr "Supprimer" + +#: git-gui.sh:1922 git-gui.sh:2416 git-gui.sh:2553 lib/console.tcl:69 +msgid "Select All" +msgstr "Tout sélectionner" + +#: git-gui.sh:1931 +msgid "Create..." +msgstr "Créer..." + +#: git-gui.sh:1937 +msgid "Checkout..." +msgstr "Emprunter... " + +#: git-gui.sh:1943 +msgid "Rename..." +msgstr "Renommer..." + +#: git-gui.sh:1948 git-gui.sh:2048 +msgid "Delete..." +msgstr "Supprimer..." + +#: git-gui.sh:1953 +msgid "Reset..." +msgstr "Réinitialiser..." + +#: git-gui.sh:1965 git-gui.sh:2350 +msgid "New Commit" +msgstr "Nouveau commit" + +#: git-gui.sh:1973 git-gui.sh:2357 +msgid "Amend Last Commit" +msgstr "Corriger dernier commit" + +#: git-gui.sh:1982 git-gui.sh:2317 lib/remote_branch_delete.tcl:99 +msgid "Rescan" +msgstr "Resynchroniser" + +#: git-gui.sh:1988 +msgid "Stage To Commit" +msgstr "Commiter un pré-commit" + +#: git-gui.sh:1994 +msgid "Stage Changed Files To Commit" +msgstr "Commiter fichiers modifiés dans pré-commit" + +#: git-gui.sh:2000 +msgid "Unstage From Commit" +msgstr "Commit vers pré-commit" + +#: git-gui.sh:2005 lib/index.tcl:393 +msgid "Revert Changes" +msgstr "Inverser modification" + +#: git-gui.sh:2012 git-gui.sh:2329 git-gui.sh:2427 +msgid "Sign Off" +msgstr "Se désinscrire" + +#: git-gui.sh:2016 git-gui.sh:2333 +msgid "Commit@@verb" +msgstr "Commiter" + +#: git-gui.sh:2027 +msgid "Local Merge..." +msgstr "Fusion locale..." + +#: git-gui.sh:2032 +msgid "Abort Merge..." +msgstr "Abandonner fusion..." + +#: git-gui.sh:2044 +msgid "Push..." +msgstr "Pousser..." + +#: git-gui.sh:2055 lib/choose_repository.tcl:40 +msgid "Apple" +msgstr "Pomme" + +#: git-gui.sh:2058 git-gui.sh:2080 lib/about.tcl:13 +#: lib/choose_repository.tcl:43 lib/choose_repository.tcl:49 +#, tcl-format +msgid "About %s" +msgstr "A propos de %s" + +#: git-gui.sh:2062 +msgid "Preferences..." +msgstr "Préférences..." + +#: git-gui.sh:2070 git-gui.sh:2595 +msgid "Options..." +msgstr "Options..." + +#: git-gui.sh:2076 lib/choose_repository.tcl:46 +msgid "Help" +msgstr "Aide" + +#: git-gui.sh:2117 +msgid "Online Documentation" +msgstr "Documentation en ligne" + +#: git-gui.sh:2201 +#, tcl-format +msgid "fatal: cannot stat path %s: No such file or directory" +msgstr "fatale : pas d'infos sur le chemin %s : Fichier ou répertoire inexistant" + +#: git-gui.sh:2234 +msgid "Current Branch:" +msgstr "Branche courante :" + +#: git-gui.sh:2255 +msgid "Staged Changes (Will Commit)" +msgstr "Modifications pré-commitées" + +#: git-gui.sh:2274 +msgid "Unstaged Changes" +msgstr "Modifications non pré-commitées" + +#: git-gui.sh:2323 +msgid "Stage Changed" +msgstr "Pré-commit modifié" + +#: git-gui.sh:2339 lib/transport.tcl:93 lib/transport.tcl:182 +msgid "Push" +msgstr "Pousser" + +#: git-gui.sh:2369 +msgid "Initial Commit Message:" +msgstr "Message de commit initial :" + +#: git-gui.sh:2370 +msgid "Amended Commit Message:" +msgstr "Message de commit corrigé :" + +#: git-gui.sh:2371 +msgid "Amended Initial Commit Message:" +msgstr "Message de commit initial corrigé :" + +#: git-gui.sh:2372 +msgid "Amended Merge Commit Message:" +msgstr "Message de commit de fusion corrigé :" + +#: git-gui.sh:2373 +msgid "Merge Commit Message:" +msgstr "Message de commit de fusion :" + +#: git-gui.sh:2374 +msgid "Commit Message:" +msgstr "Message de commit :" + +#: git-gui.sh:2419 git-gui.sh:2557 lib/console.tcl:71 +msgid "Copy All" +msgstr "Copier tout" + +#: git-gui.sh:2443 lib/blame.tcl:104 +msgid "File:" +msgstr "Fichier :" + +#: git-gui.sh:2545 +msgid "Refresh" +msgstr "Rafraichir" + +#: git-gui.sh:2566 +msgid "Apply/Reverse Hunk" +msgstr "Appliquer/Inverser section" + +#: git-gui.sh:2572 +msgid "Decrease Font Size" +msgstr "Réduire fonte" + +#: git-gui.sh:2576 +msgid "Increase Font Size" +msgstr "Agrandir fonte" + +#: git-gui.sh:2581 +msgid "Show Less Context" +msgstr "Montrer moins de contexte" + +#: git-gui.sh:2588 +msgid "Show More Context" +msgstr "Montrer plus de contexte" + +#: git-gui.sh:2602 +msgid "Unstage Hunk From Commit" +msgstr "Enlever section pré-commitée" + +#: git-gui.sh:2604 +msgid "Stage Hunk For Commit" +msgstr "Pré-commiter section" + +#: git-gui.sh:2623 +msgid "Initializing..." +msgstr "Initialisation..." + +#: git-gui.sh:2718 +#, tcl-format +msgid "" +"Possible environment issues exist.\n" +"\n" +"The following environment variables are probably\n" +"going to be ignored by any Git subprocess run\n" +"by %s:\n" +"\n" +msgstr "" +"Des problèmes d'environnement sont possibles.\n" +"\n" +"Les variables d'environnement suivantes seront\n" +"probablement ignorées par tous les\n" +"sous-processus de Git lancés par %s\n" +"\n" + +#: git-gui.sh:2748 +msgid "" +"\n" +"This is due to a known issue with the\n" +"Tcl binary distributed by Cygwin." +msgstr "" +"\n" +"Ceci est du à un problème connu avec\n" +"le binaire Tcl distribué par Cygwin." + +#: git-gui.sh:2753 +#, tcl-format +msgid "" +"\n" +"\n" +"A good replacement for %s\n" +"is placing values for the user.name and\n" +"user.email settings into your personal\n" +"~/.gitconfig file.\n" +msgstr "" +"\n" +"\n" +"Un bon remplacement pour %s\n" +"est de mettre les valeurs pour 'user.name' (nom\n" +"de l'utilisateur) et 'user.email' (addresse email\n" +"de l'utilisateur) dans votre fichier '~/.gitconfig'.\n" + +#: lib/about.tcl:25 +msgid "git-gui - a graphical user interface for Git." +msgstr "git-gui - une interface graphique utilisateur pour Git" + +#: lib/blame.tcl:77 +msgid "File Viewer" +msgstr "Visionneur de fichier" + +#: lib/blame.tcl:81 +msgid "Commit:" +msgstr "Commit :" + +#: lib/blame.tcl:249 +msgid "Copy Commit" +msgstr "Copier commit" + +#: lib/blame.tcl:369 +#, tcl-format +msgid "Reading %s..." +msgstr "Lecture de %s..." + +#: lib/blame.tcl:473 +msgid "Loading copy/move tracking annotations..." +msgstr "Chargement des annotations de suivi des copies/déplacements..." + +#: lib/blame.tcl:493 +msgid "lines annotated" +msgstr "lignes annotées" + +#: lib/blame.tcl:674 +msgid "Loading original location annotations..." +msgstr "Chargement des annotations d'emplacement original" + +#: lib/blame.tcl:677 +msgid "Annotation complete." +msgstr "Annotation terminée." + +#: lib/blame.tcl:731 +msgid "Loading annotation..." +msgstr "Chargement des annotations..." + +#: lib/blame.tcl:787 +msgid "Author:" +msgstr "Auteur :" + +#: lib/blame.tcl:791 +msgid "Committer:" +msgstr "Commiteur :" + +#: lib/blame.tcl:796 +msgid "Original File:" +msgstr "Fichier original :" + +#: lib/blame.tcl:910 +msgid "Originally By:" +msgstr "A l'origine par :" + +#: lib/blame.tcl:916 +msgid "In File:" +msgstr "Dans le fichier :" + +#: lib/blame.tcl:921 +msgid "Copied Or Moved Here By:" +msgstr "Copié ou déplacé ici par :" + +#: lib/branch_checkout.tcl:14 lib/branch_checkout.tcl:19 +msgid "Checkout Branch" +msgstr "Emprunter branche" + +#: lib/branch_checkout.tcl:23 +msgid "Checkout" +msgstr "Emprunter" + +#: lib/branch_checkout.tcl:27 lib/branch_create.tcl:35 +#: lib/branch_delete.tcl:32 lib/branch_rename.tcl:30 lib/browser.tcl:281 +#: lib/checkout_op.tcl:522 lib/choose_font.tcl:43 lib/merge.tcl:172 +#: lib/option.tcl:90 lib/remote_branch_delete.tcl:42 lib/transport.tcl:97 +msgid "Cancel" +msgstr "Annuler" + +#: lib/branch_checkout.tcl:32 lib/browser.tcl:286 +msgid "Revision" +msgstr "Révision" + +#: lib/branch_checkout.tcl:36 lib/branch_create.tcl:69 lib/option.tcl:202 +msgid "Options" +msgstr "Options" + +#: lib/branch_checkout.tcl:39 lib/branch_create.tcl:92 +msgid "Fetch Tracking Branch" +msgstr "Branche suivant récupération" + +#: lib/branch_checkout.tcl:44 +msgid "Detach From Local Branch" +msgstr "Détacher de branche locale" + +#: lib/branch_create.tcl:22 +msgid "Create Branch" +msgstr "Créer branche" + +#: lib/branch_create.tcl:27 +msgid "Create New Branch" +msgstr "Créer nouvelle branche" + +#: lib/branch_create.tcl:31 lib/choose_repository.tcl:375 +msgid "Create" +msgstr "Créer" + +#: lib/branch_create.tcl:40 +msgid "Branch Name" +msgstr "Nom de branche" + +#: lib/branch_create.tcl:43 +msgid "Name:" +msgstr "Nom :" + +#: lib/branch_create.tcl:58 +msgid "Match Tracking Branch Name" +msgstr "Trouver nom de branche de suivi" + +#: lib/branch_create.tcl:66 +msgid "Starting Revision" +msgstr "Début de révision" + +#: lib/branch_create.tcl:72 +msgid "Update Existing Branch:" +msgstr "Mettre à jour branche existante :" + +#: lib/branch_create.tcl:75 +msgid "No" +msgstr "Non" + +#: lib/branch_create.tcl:80 +msgid "Fast Forward Only" +msgstr "Avance rapide seulement" + +#: lib/branch_create.tcl:85 lib/checkout_op.tcl:514 +msgid "Reset" +msgstr "Réinitialiser" + +#: lib/branch_create.tcl:97 +msgid "Checkout After Creation" +msgstr "Emprunt après création" + +#: lib/branch_create.tcl:131 +msgid "Please select a tracking branch." +msgstr "Merci de choisir une branche de suivi" + +#: lib/branch_create.tcl:140 +#, tcl-format +msgid "Tracking branch %s is not a branch in the remote repository." +msgstr "La branche de suivi %s n'est pas une branche dans le référentiel distant." + +#: lib/branch_create.tcl:153 lib/branch_rename.tcl:86 +msgid "Please supply a branch name." +msgstr "Merci de fournir un nom de branche." + +#: lib/branch_create.tcl:164 lib/branch_rename.tcl:106 +#, tcl-format +msgid "'%s' is not an acceptable branch name." +msgstr "'%s' n'est pas un nom de branche acceptable." + +#: lib/branch_delete.tcl:15 +msgid "Delete Branch" +msgstr "Supprimer branche" + +#: lib/branch_delete.tcl:20 +msgid "Delete Local Branch" +msgstr "Supprimer branche locale" + +#: lib/branch_delete.tcl:37 +msgid "Local Branches" +msgstr "Branches locales" + +#: lib/branch_delete.tcl:52 +msgid "Delete Only If Merged Into" +msgstr "Supprimer ssi fusion dedans" + +#: lib/branch_delete.tcl:54 +msgid "Always (Do not perform merge test.)" +msgstr "Toujours (Ne pas faire de test de fusion.)" + +#: lib/branch_delete.tcl:103 +#, tcl-format +msgid "The following branches are not completely merged into %s:" +msgstr "Les branches suivantes ne sont pas complètement fusionnées dans %s :" + +#: lib/branch_delete.tcl:115 +msgid "" +"Recovering deleted branches is difficult. \n" +"\n" +" Delete the selected branches?" +msgstr "" +"Récupérer des branches supprimées est difficile.\n" +"\n" +"Supprimer les branches sélectionnées ?" + +#: lib/branch_delete.tcl:141 +#, tcl-format +msgid "" +"Failed to delete branches:\n" +"%s" +msgstr "" +"La suppression des branches suivantes a échouée :\n" +"%s" + +#: lib/branch_rename.tcl:14 lib/branch_rename.tcl:22 +msgid "Rename Branch" +msgstr "Renommer branche" + +#: lib/branch_rename.tcl:26 +msgid "Rename" +msgstr "Renommer" + +#: lib/branch_rename.tcl:36 +msgid "Branch:" +msgstr "Branche :" + +#: lib/branch_rename.tcl:39 +msgid "New Name:" +msgstr "Nouveau nom :" + +#: lib/branch_rename.tcl:75 +msgid "Please select a branch to rename." +msgstr "Merci de sélectionner une branche à renommer." + +#: lib/branch_rename.tcl:96 lib/checkout_op.tcl:179 +#, tcl-format +msgid "Branch '%s' already exists." +msgstr "La branche '%s' existe déjà." + +#: lib/branch_rename.tcl:117 +#, tcl-format +msgid "Failed to rename '%s'." +msgstr "Le renommage de '%s' a échoué." + +#: lib/browser.tcl:17 +msgid "Starting..." +msgstr "Lancement..." + +#: lib/browser.tcl:26 +msgid "File Browser" +msgstr "Visionneur de fichier" + +#: lib/browser.tcl:125 lib/browser.tcl:142 +#, tcl-format +msgid "Loading %s..." +msgstr "Chargement de %s..." + +#: lib/browser.tcl:186 +msgid "[Up To Parent]" +msgstr "[Jusqu'au parent]" + +#: lib/browser.tcl:266 lib/browser.tcl:272 +msgid "Browse Branch Files" +msgstr "Visionner fichiers de branches" + +#: lib/browser.tcl:277 lib/choose_repository.tcl:391 +#: lib/choose_repository.tcl:482 lib/choose_repository.tcl:492 +#: lib/choose_repository.tcl:989 +msgid "Browse" +msgstr "Visionner" + +#: lib/checkout_op.tcl:79 +#, tcl-format +msgid "Fetching %s from %s" +msgstr "Récupération de %s à partir de %s" + +#: lib/checkout_op.tcl:127 +#, tcl-format +msgid "fatal: Cannot resolve %s" +msgstr "Erreur fatale : Impossible de résoudre %s" + +#: lib/checkout_op.tcl:140 lib/console.tcl:79 lib/database.tcl:31 +msgid "Close" +msgstr "Fermer" + +#: lib/checkout_op.tcl:169 +#, tcl-format +msgid "Branch '%s' does not exist." +msgstr "La branche '%s' n'existe pas." + +#: lib/checkout_op.tcl:206 +#, tcl-format +msgid "" +"Branch '%s' already exists.\n" +"\n" +"It cannot fast-forward to %s.\n" +"A merge is required." +msgstr "" +"La branche '%s' existe déjà.\n" +"\n" +"Impossible d'avancer rapidement à %s.\n" +"Une fusion est nécessaire." + +#: lib/checkout_op.tcl:220 +#, tcl-format +msgid "Merge strategy '%s' not supported." +msgstr "La stratégie de fusion '%s' n'est pas supportée." + +#: lib/checkout_op.tcl:239 +#, tcl-format +msgid "Failed to update '%s'." +msgstr "La mise à jour de '%s' a échouée." + +#: lib/checkout_op.tcl:251 +msgid "Staging area (index) is already locked." +msgstr "L'espace de pré-commit ('index' ou 'staging') est déjà vérouillé." + +#: lib/checkout_op.tcl:266 +msgid "" +"Last scanned state does not match repository state.\n" +"\n" +"Another Git program has modified this repository since the last scan. A " +"rescan must be performed before the current branch can be changed.\n" +"\n" +"The rescan will be automatically started now.\n" +msgstr "" +"L'état lors de la dernière synchronisation ne correspond plus à l'état du référentiel.\n" +"\n" +"Un autre programme Git a modifié ce référentiel depuis la dernière synchronisation. Une resynchronisation doit être effectuée avant de pouvoir modifier la branche courante.\n" +"\n" +"Cela va être fait tout de suite automatiquement.\n" + +#: lib/checkout_op.tcl:322 +#, tcl-format +msgid "Updating working directory to '%s'..." +msgstr "Mise à jour du répertoire courant avec '%s'..." + +#: lib/checkout_op.tcl:353 +#, tcl-format +msgid "Aborted checkout of '%s' (file level merging is required)." +msgstr "Emprunt de '%s' abandonné. (Il est nécessaire de fusionner des fichiers.)" + +#: lib/checkout_op.tcl:354 +msgid "File level merge required." +msgstr "Il est nécessaire de fusionner des fichiers." + +#: lib/checkout_op.tcl:358 +#, tcl-format +msgid "Staying on branch '%s'." +msgstr "Le répertoire de travail reste sur la branche '%s'." + +#: lib/checkout_op.tcl:429 +msgid "" +"You are no longer on a local branch.\n" +"\n" +"If you wanted to be on a branch, create one now starting from 'This Detached " +"Checkout'." +msgstr "" +"Vous n'êtes plus ur une branche locale.\n" +"\n" +"Si vous vouliez être sur une branche, créez en une maintenant en partant de 'Cet emprunt détaché'." + +#: lib/checkout_op.tcl:446 +#, tcl-format +msgid "Checked out '%s'." +msgstr "'%s' emprunté." + +#: lib/checkout_op.tcl:478 +#, tcl-format +msgid "Resetting '%s' to '%s' will lose the following commits:" +msgstr "Réinitialiser '%s' à '%s' va faire perdre les commits suivants :" + +#: lib/checkout_op.tcl:500 +msgid "Recovering lost commits may not be easy." +msgstr "Récupérer les commits perdus ne sera peut être pas facile." + +#: lib/checkout_op.tcl:505 +#, tcl-format +msgid "Reset '%s'?" +msgstr "Réinitialiser '%s' ?" + +#: lib/checkout_op.tcl:510 lib/merge.tcl:164 +msgid "Visualize" +msgstr "Visualiser" + +#: lib/checkout_op.tcl:578 +#, tcl-format +msgid "" +"Failed to set current branch.\n" +"\n" +"This working directory is only partially switched. We successfully updated " +"your files, but failed to update an internal Git file.\n" +"\n" +"This should not have occurred. %s will now close and give up." +msgstr "" +"Le changement de la branche courante a échoué.\n" +"\n" +"Le répertoire courant n'est que partiellement modifié. Les fichiers ont été mis à jour avec succès, mais la mise à jour d'un fichier interne à Git a échouée.\n" +"\n" +"Cela n'aurait pas du se produire. %s va abandonner et se terminer." + +#: lib/choose_font.tcl:39 +msgid "Select" +msgstr "Sélectionner" + +#: lib/choose_font.tcl:53 +msgid "Font Family" +msgstr "Famille de fonte" + +#: lib/choose_font.tcl:73 +msgid "Font Size" +msgstr "Taille de fonte" + +#: lib/choose_font.tcl:90 +msgid "Font Example" +msgstr "Exemple de fonte" + +#: lib/choose_font.tcl:101 +msgid "" +"This is example text.\n" +"If you like this text, it can be your font." +msgstr "" +"C'est un texte d'exemple.\n" +"Si vous aimez ce texte, vous pouvez choisir cette fonte." + +#: lib/choose_repository.tcl:27 +msgid "Git Gui" +msgstr "Git Gui" + +#: lib/choose_repository.tcl:80 lib/choose_repository.tcl:380 +msgid "Create New Repository" +msgstr "Créer nouveau référentiel" + +#: lib/choose_repository.tcl:86 +msgid "New..." +msgstr "Nouveau..." + +#: lib/choose_repository.tcl:93 lib/choose_repository.tcl:468 +msgid "Clone Existing Repository" +msgstr "Cloner référentiel existant" + +#: lib/choose_repository.tcl:99 +msgid "Clone..." +msgstr "Cloner..." + +#: lib/choose_repository.tcl:106 lib/choose_repository.tcl:978 +msgid "Open Existing Repository" +msgstr "Ouvrir référentiel existant" + +#: lib/choose_repository.tcl:112 +msgid "Open..." +msgstr "Ouvrir..." + +#: lib/choose_repository.tcl:125 +msgid "Recent Repositories" +msgstr "Référentiels récents" + +#: lib/choose_repository.tcl:131 +msgid "Open Recent Repository:" +msgstr "Ouvrir référentiel récent :" + +#: lib/choose_repository.tcl:294 +#, tcl-format +msgid "Location %s already exists." +msgstr "L'emplacement %s existe déjà." + +#: lib/choose_repository.tcl:300 lib/choose_repository.tcl:307 +#: lib/choose_repository.tcl:314 +#, tcl-format +msgid "Failed to create repository %s:" +msgstr "La création du référentiel %s a échouée :" + +#: lib/choose_repository.tcl:385 lib/choose_repository.tcl:486 +msgid "Directory:" +msgstr "Répertoire :" + +#: lib/choose_repository.tcl:415 lib/choose_repository.tcl:544 +#: lib/choose_repository.tcl:1013 +msgid "Git Repository" +msgstr "Référentiel Git" + +#: lib/choose_repository.tcl:430 lib/choose_repository.tcl:437 +#, tcl-format +msgid "Directory %s already exists." +msgstr "Le répertoire %s existe déjà." + +#: lib/choose_repository.tcl:442 +#, tcl-format +msgid "File %s already exists." +msgstr "Le fichier %s existe déjà." + +#: lib/choose_repository.tcl:463 +msgid "Clone" +msgstr "Cloner" + +#: lib/choose_repository.tcl:476 +msgid "URL:" +msgstr "URL :" + +#: lib/choose_repository.tcl:496 +msgid "Clone Type:" +msgstr "Type de clonage :" + +#: lib/choose_repository.tcl:502 +msgid "Standard (Fast, Semi-Redundant, Hardlinks)" +msgstr "Standard (rapide, semi-redondant, liens durs)" + +#: lib/choose_repository.tcl:508 +msgid "Full Copy (Slower, Redundant Backup)" +msgstr "Copy complète (plus lent, sauvegarde redondante)" + +#: lib/choose_repository.tcl:514 +msgid "Shared (Fastest, Not Recommended, No Backup)" +msgstr "Partagé (le plus rapide, non recommandé, pas de sauvegarde)" + +#: lib/choose_repository.tcl:550 lib/choose_repository.tcl:597 +#: lib/choose_repository.tcl:738 lib/choose_repository.tcl:808 +#: lib/choose_repository.tcl:1019 lib/choose_repository.tcl:1027 +#, tcl-format +msgid "Not a Git repository: %s" +msgstr "'%s' n'est pas un référentiel Git." + +#: lib/choose_repository.tcl:586 +msgid "Standard only available for local repository." +msgstr "Standard n'est disponible que pour un référentiel local." + +#: lib/choose_repository.tcl:590 +msgid "Shared only available for local repository." +msgstr "Partagé n'est disponible que pour un référentiel local." + +#: lib/choose_repository.tcl:617 +msgid "Failed to configure origin" +msgstr "La configuration de l'origine a échouée." + +#: lib/choose_repository.tcl:629 +msgid "Counting objects" +msgstr "Comptage des objets" + +#: lib/choose_repository.tcl:630 +msgid "buckets" +msgstr "paniers" + +#: lib/choose_repository.tcl:654 +#, tcl-format +msgid "Unable to copy objects/info/alternates: %s" +msgstr "Impossible de copier 'objects/info/alternates' : %s" + +#: lib/choose_repository.tcl:690 +#, tcl-format +msgid "Nothing to clone from %s." +msgstr "Il n'y a rien à cloner depuis %s." + +#: lib/choose_repository.tcl:692 lib/choose_repository.tcl:906 +#: lib/choose_repository.tcl:918 +msgid "The 'master' branch has not been initialized." +msgstr "Cette branche 'master' n'a pas été initialisée." + +#: lib/choose_repository.tcl:705 +msgid "Hardlinks are unavailable. Falling back to copying." +msgstr "Les liens durs ne sont pas disponibles. On se résoud à copier." + +#: lib/choose_repository.tcl:717 +#, tcl-format +msgid "Cloning from %s" +msgstr "Clonage depuis %s" + +#: lib/choose_repository.tcl:748 +msgid "Copying objects" +msgstr "Copie des objets" + +#: lib/choose_repository.tcl:749 +msgid "KiB" +msgstr "KiB" + +#: lib/choose_repository.tcl:773 +#, tcl-format +msgid "Unable to copy object: %s" +msgstr "Impossible de copier l'objet : %s" + +#: lib/choose_repository.tcl:783 +msgid "Linking objects" +msgstr "Liaison des objets" + +#: lib/choose_repository.tcl:784 +msgid "objects" +msgstr "objets" + +#: lib/choose_repository.tcl:792 +#, tcl-format +msgid "Unable to hardlink object: %s" +msgstr "Impossible créer un lien dur pour l'objet : %s" + +#: lib/choose_repository.tcl:847 +msgid "Cannot fetch branches and objects. See console output for details." +msgstr "Impossible de récupérer les branches et objets. Voir la sortie console pour plus de détails." + +#: lib/choose_repository.tcl:858 +msgid "Cannot fetch tags. See console output for details." +msgstr "Impossible de récupérer les marques. Voir la sortie console pour plus de détails." + +#: lib/choose_repository.tcl:882 +msgid "Cannot determine HEAD. See console output for details." +msgstr "Impossible de déterminer HEAD. Voir la sortie console pour plus de détails." + +#: lib/choose_repository.tcl:891 +#, tcl-format +msgid "Unable to cleanup %s" +msgstr "Impossible de nettoyer %s" + +#: lib/choose_repository.tcl:897 +msgid "Clone failed." +msgstr "Le clonage a échoué." + +#: lib/choose_repository.tcl:904 +msgid "No default branch obtained." +msgstr "Aucune branche par défaut n'a été obtenue." + +#: lib/choose_repository.tcl:915 +#, tcl-format +msgid "Cannot resolve %s as a commit." +msgstr "Impossible de résoudre %s comme commit." + +#: lib/choose_repository.tcl:927 +msgid "Creating working directory" +msgstr "Création du répertoire de travail" + +#: lib/choose_repository.tcl:928 lib/index.tcl:65 lib/index.tcl:127 +#: lib/index.tcl:193 +msgid "files" +msgstr "fichiers" + +#: lib/choose_repository.tcl:957 +msgid "Initial file checkout failed." +msgstr "L'emprunt initial de fichier a échoué." + +#: lib/choose_repository.tcl:973 +msgid "Open" +msgstr "Ouvrir" + +#: lib/choose_repository.tcl:983 +msgid "Repository:" +msgstr "Référentiel :" + +#: lib/choose_repository.tcl:1033 +#, tcl-format +msgid "Failed to open repository %s:" +msgstr "Impossible d'ouvrir le référentiel %s :" + +#: lib/choose_rev.tcl:53 +msgid "This Detached Checkout" +msgstr "Cet emprunt détaché" + +#: lib/choose_rev.tcl:60 +msgid "Revision Expression:" +msgstr "Expression de révision :" + +#: lib/choose_rev.tcl:74 +msgid "Local Branch" +msgstr "Branche locale" + +#: lib/choose_rev.tcl:79 +msgid "Tracking Branch" +msgstr "Suivi de branche" + +#: lib/choose_rev.tcl:84 lib/choose_rev.tcl:537 +msgid "Tag" +msgstr "Marque" + +#: lib/choose_rev.tcl:317 +#, tcl-format +msgid "Invalid revision: %s" +msgstr "Révision invalide : %s" + +#: lib/choose_rev.tcl:338 +msgid "No revision selected." +msgstr "Pas de révision selectionnée." + +#: lib/choose_rev.tcl:346 +msgid "Revision expression is empty." +msgstr "L'expression de révision est vide." + +#: lib/choose_rev.tcl:530 +msgid "Updated" +msgstr "Misa à jour" + +#: lib/choose_rev.tcl:558 +msgid "URL" +msgstr "URL" + +#: lib/commit.tcl:9 +msgid "" +"There is nothing to amend.\n" +"\n" +"You are about to create the initial commit. There is no commit before this " +"to amend.\n" +msgstr "" +"Il n'y a rien à corriger.\n" +"\n" +"Vous allez créer le commit initial. Il n'y a pas de commit avant celui-ci à corriger.\n" + +#: lib/commit.tcl:18 +msgid "" +"Cannot amend while merging.\n" +"\n" +"You are currently in the middle of a merge that has not been fully " +"completed. You cannot amend the prior commit unless you first abort the " +"current merge activity.\n" +msgstr "" +"Impossible de corriger pendant une fusion.\n" +"\n" +"Vous êtes actuellement au milieu d'une fusion qui n'a pas été completement terminée. Vous ne pouvez pas corriger le commit précédant sauf si vous abandonnez la fusion courante.\n" + +#: lib/commit.tcl:49 +msgid "Error loading commit data for amend:" +msgstr "Erreur lors du chargement des données de commit pour correction :" + +#: lib/commit.tcl:76 +msgid "Unable to obtain your identity:" +msgstr "Impossible d'obtenir votre identité :" + +#: lib/commit.tcl:81 +msgid "Invalid GIT_COMMITTER_IDENT:" +msgstr "GIT_COMMITTER_IDENT invalide :" + +#: lib/commit.tcl:133 +msgid "" +"Last scanned state does not match repository state.\n" +"\n" +"Another Git program has modified this repository since the last scan. A " +"rescan must be performed before another commit can be created.\n" +"\n" +"The rescan will be automatically started now.\n" +msgstr "" +"L'état lors de la dernière synchronisation ne correspond plus à l'état du référentiel.\n" +"\n" +"Un autre programme Git a modifié ce référentiel depuis la dernière synchronisation. Une resynshronisation doit être effectuée avant de pouvoir créer un nouveau commit.\n" +"\n" +"Cela va être fait tout de suite automatiquement.\n" + +#: lib/commit.tcl:154 +#, tcl-format +msgid "" +"Unmerged files cannot be committed.\n" +"\n" +"File %s has merge conflicts. You must resolve them and stage the file " +"before committing.\n" +msgstr "" +"Des fichiers non fusionnés ne peuvent être commités.\n" +"\n" +"Le fichier %s a des conflicts de fusion. Vous devez les résoudre et pré-commiter le fichier avant de pouvoir commiter.\n" + +#: lib/commit.tcl:162 +#, tcl-format +msgid "" +"Unknown file state %s detected.\n" +"\n" +"File %s cannot be committed by this program.\n" +msgstr "" +"Un état de fichier inconnu %s a été détecté.\n" +"\n" +"Le fichier %s ne peut pas être commité par ce programme.\n" + +#: lib/commit.tcl:170 +msgid "" +"No changes to commit.\n" +"\n" +"You must stage at least 1 file before you can commit.\n" +msgstr "" +"Pas de modification à commiter.\n" +"\n" +"Vous devez pré-commiter au moins 1 fichier avant de pouvoir commiter.\n" + +#: lib/commit.tcl:183 +msgid "" +"Please supply a commit message.\n" +"\n" +"A good commit message has the following format:\n" +"\n" +"- First line: Describe in one sentence what you did.\n" +"- Second line: Blank\n" +"- Remaining lines: Describe why this change is good.\n" +msgstr "" +"Merci de fournir un message de commit.\n" +"\n" +"Un bon message de commit a le format suivant :\n" +"\n" +"- Première ligne : décrire en une phrase ce que vous avez fait.\n" +"- Deuxième ligne : rien.\n" +"- Lignes suivantes : Décrire pourquoi ces modifications sont bonnes.\n" + +#: lib/commit.tcl:257 +msgid "write-tree failed:" +msgstr "write-tree a échoué :" + +#: lib/commit.tcl:275 +#, tcl-format +msgid "Commit %s appears to be corrupt" +msgstr "Le commit %s semble être corrompu" + +#: lib/commit.tcl:279 +msgid "" +"No changes to commit.\n" +"\n" +"No files were modified by this commit and it was not a merge commit.\n" +"\n" +"A rescan will be automatically started now.\n" +msgstr "" +"Pas de modification à commiter.\n" +"\n" +"Aucun fichier n'a été modifié par ce commit et il ne s'agit pas d'un commit de fusion.\n" +"\n" +"Une resynchronisation va être lancée tout de suite automatiquement.\n" + +#: lib/commit.tcl:286 +msgid "No changes to commit." +msgstr "Pas de modifications à commiter." + +#: lib/commit.tcl:303 +#, tcl-format +msgid "warning: Tcl does not support encoding '%s'." +msgstr "attention : Tcl ne supporte pas l'encodage '%s'." + +#: lib/commit.tcl:317 +msgid "commit-tree failed:" +msgstr "commit-tree a échoué :" + +#: lib/commit.tcl:339 +msgid "update-ref failed:" +msgstr "update-ref a échoué" + +#: lib/commit.tcl:430 +#, tcl-format +msgid "Created commit %s: %s" +msgstr "Commit créé %s : %s" + +#: lib/console.tcl:57 +msgid "Working... please wait..." +msgstr "Travail en cours... merci de patienter..." + +#: lib/console.tcl:183 +msgid "Success" +msgstr "Succès" + +#: lib/console.tcl:196 +msgid "Error: Command Failed" +msgstr "Erreur : échec de la commande" + +#: lib/database.tcl:43 +msgid "Number of loose objects" +msgstr "Nombre d'objets en fichier particulier" + +#: lib/database.tcl:44 +msgid "Disk space used by loose objects" +msgstr "Espace disque utilisé par les fichiers particuliers" + +#: lib/database.tcl:45 +msgid "Number of packed objects" +msgstr "Nombre d'objets empaquetés" + +#: lib/database.tcl:46 +msgid "Number of packs" +msgstr "Nombre de paquets d'objets" + +#: lib/database.tcl:47 +msgid "Disk space used by packed objects" +msgstr "Espace disque utilisé par les objets empaquetés" + +#: lib/database.tcl:48 +msgid "Packed objects waiting for pruning" +msgstr "Objets empaquetés attendant d'être supprimés" + +#: lib/database.tcl:49 +msgid "Garbage files" +msgstr "Fichiers poubelle" + +#: lib/database.tcl:72ets +msgid "Compressing the object database" +msgstr "Compression de la base des objets" + +#: lib/database.tcl:83 +msgid "Verifying the object database with fsck-objects" +msgstr "Vérification de la base des objets avec fsck-objects" + +#: lib/database.tcl:108 +#, tcl-format +msgid "" +"This repository currently has approximately %i loose objects.\n" +"\n" +"To maintain optimal performance it is strongly recommended that you compress " +"the database when more than %i loose objects exist.\n" +"\n" +"Compress the database now?" +msgstr "" +"Ce référentiel comprend actuellement environ %i objets ayant leur fichier particulier.\n" +"\n" +"Pour conserver une performance optimale, il est fortement recommandé de comprimer la base quand plus de %i objets ayant leur fichier particulier existent.\n" +"\n" +"Comprimer la base maintenant ?" + +#: lib/date.tcl:25 +#, tcl-format +msgid "Invalid date from Git: %s" +msgstr "Date invalide de Git : %s" + +#: lib/diff.tcl:42 +#, tcl-format +msgid "" +"No differences detected.\n" +"\n" +"%s has no changes.\n" +"\n" +"The modification date of this file was updated by another application, but " +"the content within the file was not changed.\n" +"\n" +"A rescan will be automatically started to find other files which may have " +"the same state." +msgstr "" +"Aucune différence détectée.\n" +"\n" +"%s ne comporte aucune modification.\n" +"\n" +"La date de modification de ce fichier a été mise à jour par une autre application, mais le contenu du fichier n'a pas changé.\n" +"\n" +"Une resynchronisation va être lancée automatiquement pour trouver d'autres fichiers qui pourraient se trouver dans le même état." + +#: lib/diff.tcl:81 +#, tcl-format +msgid "Loading diff of %s..." +msgstr "Chargement des différences de %s..." + +#: lib/diff.tcl:114 lib/diff.tcl:184 +#, tcl-format +msgid "Unable to display %s" +msgstr "Impossible d'afficher %s" + +#: lib/diff.tcl:115 +msgid "Error loading file:" +msgstr "Erreur lors du chargement du fichier :" + +#: lib/diff.tcl:122 +msgid "Git Repository (subproject)" +msgstr "Référentiel Git (sous projet)" + +#: lib/diff.tcl:134 +msgid "* Binary file (not showing content)." +msgstr "* Fichier binaire (pas d'apperçu du contenu)." + +#: lib/diff.tcl:185 +msgid "Error loading diff:" +msgstr "Erreur lors du chargement des différences :" + +#: lib/diff.tcl:302 +msgid "Failed to unstage selected hunk." +msgstr "La suppression dans le pré-commit de la section sélectionnée a échouée." + +#: lib/diff.tcl:309 +msgid "Failed to stage selected hunk." +msgstr "Le pré-commit de la section sélectionnée a échoué." + +#: lib/error.tcl:12 lib/error.tcl:102 +msgid "error" +msgstr "erreur" + +#: lib/error.tcl:28 +msgid "warning" +msgstr "attention" + +#: lib/error.tcl:81 +msgid "You must correct the above errors before committing." +msgstr "Vous devez corriger les erreurs suivantes avant de pouvoir commiter." + +#: lib/index.tcl:6 +msgid "Unable to unlock the index." +msgstr "Impossible de dévérouiller le pré-commit." + +#: lib/index.tcl:15 +msgid "Index Error" +msgstr "Erreur de pré-commit" + +#: lib/index.tcl:21 +msgid "" +"Updating the Git index failed. A rescan will be automatically started to " +"resynchronize git-gui." +msgstr "Le pré-commit a échoué. Une resynchronisation va être lancée automatiquement." + +#: lib/index.tcl:27 +msgid "Continue" +msgstr "Continuer" + +#: lib/index.tcl:31 +msgid "Unlock Index" +msgstr "Dévérouiller le pré-commit" + +#: lib/index.tcl:282 +#, tcl-format +msgid "Unstaging %s from commit" +msgstr "Supprimer %s du commit" + +#: lib/index.tcl:326 +#, tcl-format +msgid "Adding %s" +msgstr "Ajouter %s" + +#: lib/index.tcl:381 +#, tcl-format +msgid "Revert changes in file %s?" +msgstr "Inverser les modifications dans le fichier %s ? " + +#: lib/index.tcl:383 +#, tcl-format +msgid "Revert changes in these %i files?" +msgstr "Inverser les modifications dans ces %i fichiers ?" + +#: lib/index.tcl:389 +msgid "Any unstaged changes will be permanently lost by the revert." +msgstr "Toutes les modifications non pré-commitées seront définitivement perdues lors de l'inversion." + +#: lib/index.tcl:392 +msgid "Do Nothing" +msgstr "Ne rien faire" + +#: lib/merge.tcl:13 +msgid "" +"Cannot merge while amending.\n" +"\n" +"You must finish amending this commit before starting any type of merge.\n" +msgstr "" +"Impossible de fucionner pendant une correction.\n" +"\n" +"Vous devez finir de corriger ce commit avant de lancer une quelconque fusion.\n" + +#: lib/merge.tcl:27 +msgid "" +"Last scanned state does not match repository state.\n" +"\n" +"Another Git program has modified this repository since the last scan. A " +"rescan must be performed before a merge can be performed.\n" +"\n" +"The rescan will be automatically started now.\n" +msgstr "" +"L'état lors de la dernière synchronisation ne correspond plus à l'état du référentiel.\n" +"\n" +"Un autre programme Git a modifié ce référentiel depuis la dernière synchronisation. Une resynchronisation doit être effectuée avant de pouvoir fusionner de nouveau.\n" +"\n" +"Cela va être fait tout de suite automatiquement\n" + +#: lib/merge.tcl:44 +#, tcl-format +msgid "" +"You are in the middle of a conflicted merge.\n" +"\n" +"File %s has merge conflicts.\n" +"\n" +"You must resolve them, stage the file, and commit to complete the current " +"merge. Only then can you begin another merge.\n" +msgstr "" +"Vous êtes au milieu d'une fusion conflictuelle.\n" +"\n" +"Le fichier %s a des conflicts de fusion.\n" +"\n" +"Vous devez les résoudre, puis pré-commiter le fichier, et enfin commiter pour terminer la fusion courante. Seulementà ce moment là, il sera possible d'effectuer une nouvelle fusion.\n" + +#: lib/merge.tcl:54 +#, tcl-format +msgid "" +"You are in the middle of a change.\n" +"\n" +"File %s is modified.\n" +"\n" +"You should complete the current commit before starting a merge. Doing so " +"will help you abort a failed merge, should the need arise.\n" +msgstr "" +"Vous êtes au milieu d'une modification.\n" +"\n" +"Le fichier %s est modifié.\n" +"\n" +"Vous devriez terminer le commit courant avant de lancer une fusion. En faisait comme cela, vous éviterez de devoir éventuellement abandonner une fusion ayant échouée.\n" + +#: lib/merge.tcl:106 +#, tcl-format +msgid "%s of %s" +msgstr "%s de %s" + +#: lib/merge.tcl:119 +#, tcl-format +msgid "Merging %s and %s" +msgstr "Fusion de %s et %s" + +#: lib/merge.tcl:131 +msgid "Merge completed successfully." +msgstr "La fusion s'est faite avec succès." + +#: lib/merge.tcl:133 +msgid "Merge failed. Conflict resolution is required." +msgstr "La fusion a echouée. Il est nécessaire de résoudre les conflicts." + +#: lib/merge.tcl:158 +#, tcl-format +msgid "Merge Into %s" +msgstr "Fusion dans %s" + +#: lib/merge.tcl:177 +msgid "Revision To Merge" +msgstr "Révision à fusionner" + +#: lib/merge.tcl:212 +msgid "" +"Cannot abort while amending.\n" +"\n" +"You must finish amending this commit.\n" +msgstr "" +"Impossible d'abandonner en cours de correction.\n" +"\n" +"Vous devez finir de corriger ce commit.\n" + +#: lib/merge.tcl:222 +msgid "" +"Abort merge?\n" +"\n" +"Aborting the current merge will cause *ALL* uncommitted changes to be lost.\n" +"\n" +"Continue with aborting the current merge?" +msgstr "" +"Abandonner la fusion ?\n" +"\n" +"Abandonner la fusion courante entrainera la perte de TOUTES les modifications non commitées.\n" +"\n" +"Abandonner quand même la fusion courante ?" + +#: lib/merge.tcl:228 +msgid "" +"Reset changes?\n" +"\n" +"Resetting the changes will cause *ALL* uncommitted changes to be lost.\n" +"\n" +"Continue with resetting the current changes?" +msgstr "" +"Réinitialiser les modifications ?\n" +"\n" +"Réinitialiser les modifications va faire perdre TOUTES les modifications non commitées.\n" +"\n" +"Réinitialiser quand même les modifications courantes ?" + +#: lib/merge.tcl:239 +msgid "Aborting" +msgstr "Abandon" + +#: lib/merge.tcl:266 +msgid "Abort failed." +msgstr "L'abandon a échoué." + +#: lib/merge.tcl:268 +msgid "Abort completed. Ready." +msgstr "Abandon teminé. Prêt." + +#: lib/option.tcl:82 +msgid "Restore Defaults" +msgstr "Remettre les valeurs par défaut" + +#: lib/option.tcl:86 +msgid "Save" +msgstr "Sauvegarder" + +#: lib/option.tcl:96 +#, tcl-format +msgid "%s Repository" +msgstr "Référentiel de %s" + +#: lib/option.tcl:97 +msgid "Global (All Repositories)" +msgstr "Globales (tous les référentiels)" + +#: lib/option.tcl:103 +msgid "User Name" +msgstr "Nom d'utilisateur" + +#: lib/option.tcl:104 +msgid "Email Address" +msgstr "Adresse email" + +#: lib/option.tcl:106 +msgid "Summarize Merge Commits" +msgstr "Résumer les commits de fusion" + +#: lib/option.tcl:107 +msgid "Merge Verbosity" +msgstr "Fusion bavarde" + +#: lib/option.tcl:108 +msgid "Show Diffstat After Merge" +msgstr "Montrer statistiques de diff après fusion" + +#: lib/option.tcl:110 +msgid "Trust File Modification Timestamps" +msgstr "Faire confiance aux dates de modification de fichiers " + +#: lib/option.tcl:111 +msgid "Prune Tracking Branches During Fetch" +msgstr "Nettoyer les branches de suivi pendant la récupération" + +#: lib/option.tcl:112 +msgid "Match Tracking Branches" +msgstr "Faire correspondre les branches de suivi" + +#: lib/option.tcl:113 +msgid "Number of Diff Context Lines" +msgstr "Nombre de lignes de contexte dans les diffs" + +#: lib/option.tcl:114 +msgid "New Branch Name Template" +msgstr "Nouveau modèle de nom de branche" + +#: lib/option.tcl:176 +msgid "Change Font" +msgstr "Modifier les fontes" + +#: lib/option.tcl:180 +#, tcl-format +msgid "Choose %s" +msgstr "Choisir %s" + +#: lib/option.tcl:186 +msgid "pt." +msgstr "pt." + +#: lib/option.tcl:200 +msgid "Preferences" +msgstr "Préférences" + +#: lib/option.tcl:235 +msgid "Failed to completely save options:" +msgstr "La sauvegarde complète des options a échouée :" + +#: lib/remote_branch_delete.tcl:29 lib/remote_branch_delete.tcl:34 +msgid "Delete Remote Branch" +msgstr "Supprimer branche distante" + +#: lib/remote_branch_delete.tcl:47 +msgid "From Repository" +msgstr "Référentiel" + +#: lib/remote_branch_delete.tcl:50 lib/transport.tcl:123 +msgid "Remote:" +msgstr "Branche distante :" + +#: lib/remote_branch_delete.tcl:66 lib/transport.tcl:138 +msgid "Arbitrary URL:" +msgstr "URL arbitraire :" + +#: lib/remote_branch_delete.tcl:84 +msgid "Branches" +msgstr "Branches" + +#: lib/remote_branch_delete.tcl:109 +msgid "Delete Only If" +msgstr "Supprimer seulement si" + +#: lib/remote_branch_delete.tcl:111 +msgid "Merged Into:" +msgstr "Fusionné dans :" + +#: lib/remote_branch_delete.tcl:119 +msgid "Always (Do not perform merge checks)" +msgstr "Toujours (ne pas vérifier les fusions)" + +#: lib/remote_branch_delete.tcl:152 +msgid "A branch is required for 'Merged Into'." +msgstr "Une branche est nécessaire pour 'Fusionné dans'." + +#: lib/remote_branch_delete.tcl:184 +#, tcl-format +msgid "" +"The following branches are not completely merged into %s:\n" +"\n" +" - %s" +msgstr "" +"Les branches suivantes ne sont pas complètement fusionnées dans %s :\n" +"\n" +" - %s" + +#: lib/remote_branch_delete.tcl:189 +#, tcl-format +msgid "" +"One or more of the merge tests failed because you have not fetched the " +"necessary commits. Try fetching from %s first." +msgstr "Une ou plusieurs des tests de fusion ont échoués parce que vous n'avez pas récupéré les commits nécessaires. Essayez de récupéré à partir de %s d'abord." + +#: lib/remote_branch_delete.tcl:207 +msgid "Please select one or more branches to delete." +msgstr "Merci de sélectionner une ou plusieurs branches à supprimer." + +#: lib/remote_branch_delete.tcl:216 +msgid "" +"Recovering deleted branches is difficult.\n" +"\n" +"Delete the selected branches?" +msgstr "" +"Récupérer des branches supprimées est difficile.\n" +"\n" +"Souhaitez vous supprimer les branches sélectionnées ?" + +#: lib/remote_branch_delete.tcl:226 +#, tcl-format +msgid "Deleting branches from %s" +msgstr "Supprimer les branches de %s" + +#: lib/remote_branch_delete.tcl:286 +msgid "No repository selected." +msgstr "Aucun référentiel n'est sélectionné." + +#: lib/remote_branch_delete.tcl:291 +#, tcl-format +msgid "Scanning %s..." +msgstr "Synchronisation de %s..." + +#: lib/remote.tcl:165 +msgid "Prune from" +msgstr "Nettoyer de" + +#: lib/remote.tcl:170 +msgid "Fetch from" +msgstr "Récupérer de" + +#: lib/remote.tcl:213 +msgid "Push to" +msgstr "Pousser vers" + +#: lib/shortcut.tcl:20 lib/shortcut.tcl:61 +msgid "Cannot write shortcut:" +msgstr "Impossible d'écrire le raccourcis :" + +#: lib/shortcut.tcl:136 +msgid "Cannot write icon:" +msgstr "Impossible d'écrire l'icône :" + +#: lib/status_bar.tcl:83 +#, tcl-format +msgid "%s ... %*i of %*i %s (%3i%%)" +msgstr "%s ... %*i de %*i %s (%3i%%)" + +#: lib/transport.tcl:6 +#, tcl-format +msgid "fetch %s" +msgstr "récupérer %s" + +#: lib/transport.tcl:7 +#, tcl-format +msgid "Fetching new changes from %s" +msgstr "Récupération des dernières modifications de %s" + +#: lib/transport.tcl:18 +#, tcl-format +msgid "remote prune %s" +msgstr "nettoyer à distance %s" + +#: lib/transport.tcl:19 +#, tcl-format +msgid "Pruning tracking branches deleted from %s" +msgstr "Nettoyer les branches de suivi supprimées de %s" + +#: lib/transport.tcl:25 lib/transport.tcl:71 +#, tcl-format +msgid "push %s" +msgstr "pousser %s" + +#: lib/transport.tcl:26 +#, tcl-format +msgid "Pushing changes to %s" +msgstr "Les modifications sont poussées vers %s" + +#: lib/transport.tcl:72 +#, tcl-format +msgid "Pushing %s %s to %s" +msgstr "Pousse %s %s vers %s" + +#: lib/transport.tcl:89 +msgid "Push Branches" +msgstr "Pousser branches" + +#: lib/transport.tcl:103 +msgid "Source Branches" +msgstr "Branches source" + +#: lib/transport.tcl:120 +msgid "Destination Repository" +msgstr "Référentiel de destination" + +#: lib/transport.tcl:158 +msgid "Transfer Options" +msgstr "Transférer options" + +#: lib/transport.tcl:160 +msgid "Force overwrite existing branch (may discard changes)" +msgstr "Forcer l'écrasement d'une branche existante (peut supprimer des modifications)" + +#: lib/transport.tcl:164 +msgid "Use thin pack (for slow network connections)" +msgstr "Utiliser des petits paquets (pour les connexions lentes)" + +#: lib/transport.tcl:168 +msgid "Include tags" +msgstr "Inclure les marques" + diff --git a/git-gui/po/glossary/de.po b/git-gui/po/glossary/de.po index c94786c6ab..0b33c572bf 100644 --- a/git-gui/po/glossary/de.po +++ b/git-gui/po/glossary/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: git-gui glossary\n" -"POT-Creation-Date: 2007-10-19 21:43+0200\n" -"PO-Revision-Date: 2007-10-20 15:24+0200\n" +"POT-Creation-Date: 2008-01-07 21:20+0100\n" +"PO-Revision-Date: 2008-01-15 20:32+0100\n" "Last-Translator: Christian Stimming \n" "Language-Team: German \n" "MIME-Version: 1.0\n" @@ -62,7 +62,7 @@ msgstr "" #. "" msgid "clone [verb]" -msgstr "kopieren" +msgstr "klonen" #. "A single point in the git history." msgid "commit [noun]" @@ -92,6 +92,10 @@ msgstr "Schnellzusammenführung" msgid "fetch" msgstr "anfordern (holen?)" +#. "One context of consecutive lines in a whole patch, which consists of many such hunks" +msgid "hunk" +msgstr "Kontext" + #. "A collection of files. The index is a stored version of your working tree." msgid "index (in git-gui: staging area)" msgstr "Bereitstellung" @@ -138,7 +142,7 @@ msgstr "zurücksetzen (zurückkehren?)" #. "" msgid "revert" -msgstr "revidieren" +msgstr "verwerfen (bei git-reset), revidieren (bei git-revert, also mit neuem commit)" #. "A particular state of files and directories which was stored in the object database." msgid "revision" diff --git a/git-gui/po/glossary/fr.po b/git-gui/po/glossary/fr.po new file mode 100644 index 0000000000..bb2feaf137 --- /dev/null +++ b/git-gui/po/glossary/fr.po @@ -0,0 +1,166 @@ +# translation of fr.po to French +# Translation of git-gui glossary to French +# Copyright (C) 2008 Shawn Pearce, et al. +# +# Christian Couder , 2008. +msgid "" +msgstr "" +"Project-Id-Version: fr\n" +"POT-Creation-Date: 2008-01-15 21:04+0100\n" +"PO-Revision-Date: 2008-01-15 21:17+0100\n" +"Last-Translator: Christian Couder \n" +"Language-Team: French\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. "English Definition (Dear translator: This file will never be visible to the user! It should only serve as a tool for you, the translator. Nothing more.)" +msgid "English Term (Dear translator: This file will never be visible to the user!)" +msgstr "" + +#. "" +msgid "amend" +msgstr "corriger" + +#. "" +msgid "annotate" +msgstr "annoter" + +#. "A 'branch' is an active line of development." +msgid "branch [noun]" +msgstr "branche" + +#. "" +msgid "branch [verb]" +msgstr "créer une branche" + +#. "" +msgid "checkout [noun]" +msgstr "emprunt" + +#. "The action of updating the working tree to a revision which was stored in the object database." +msgid "checkout [verb]" +msgstr "emprunter" + +#. "" +msgid "clone [verb]" +msgstr "cloner" + +#. "A single point in the git history." +msgid "commit [noun]" +msgstr "commit" + +#. "The action of storing a new snapshot of the project's state in the git history." +msgid "commit [verb]" +msgstr "commiter" + +#. "" +msgid "diff [noun]" +msgstr "différence" + +#. "" +msgid "diff [verb]" +msgstr "comparer" + +#. "A fast-forward is a special type of merge where you have a revision and you are merging another branch's changes that happen to be a descendant of what you have." +msgid "fast forward merge" +msgstr "fusion par avance rapide" + +#. "Fetching a branch means to get the branch's head from a remote repository, to find out which objects are missing from the local object database, and to get them, too." +msgid "fetch" +msgstr "récupérer" + +#. "A collection of files. The index is a stored version of your working tree." +msgid "index (in git-gui: staging area)" +msgstr "pré-commit" + +#. "A successful merge results in the creation of a new commit representing the result of the merge." +msgid "merge [noun]" +msgstr "fusion" + +#. "To bring the contents of another branch into the current branch." +msgid "merge [verb]" +msgstr "fusionner" + +#. "" +msgid "message" +msgstr "message" + +#. "Deletes all stale tracking branches under . These stale branches have already been removed from the remote repository referenced by , but are still locally available in 'remotes/'." +msgid "prune" +msgstr "nettoyer" + +#. "Pulling a branch means to fetch it and merge it." +msgid "pull" +msgstr "tirer" + +#. "Pushing a branch means to get the branch's head ref from a remote repository, and ... (well, can someone please explain it for mere mortals?)" +msgid "push" +msgstr "pousser" + +#. "" +msgid "redo" +msgstr "refaire" + +#. "An other repository ('remote'). One might have a set of remotes whose branches one tracks." +msgid "remote" +msgstr "référentiel distant" + +#. "A collection of refs (?) together with an object database containing all objects which are reachable from the refs... (oops, you've lost me here. Again, please an explanation for mere mortals?)" +msgid "repository" +msgstr "référentiel" + +#. "" +msgid "reset" +msgstr "réinitialiser" + +#. "" +msgid "revert" +msgstr "inverser" + +#. "A particular state of files and directories which was stored in the object database." +msgid "revision" +msgstr "révision" + +#. "" +msgid "sign off" +msgstr "signer" + +#. "" +msgid "staging area" +msgstr "pré-commit" + +#. "" +msgid "status" +msgstr "état" + +#. "A ref pointing to a tag or commit object" +msgid "tag [noun]" +msgstr "marque" + +#. "" +msgid "tag [verb]" +msgstr "marquer" + +#. "A regular git branch that is used to follow changes from another repository." +msgid "tracking branch" +msgstr "branche de suivi" + +#. "" +msgid "undo" +msgstr "défaire" + +#. "" +msgid "update" +msgstr "mise à jour" + +#. "" +msgid "verify" +msgstr "vérifier" + +#. "The tree of actual checked out files." +msgid "working copy, working tree" +msgstr "copie de travail, arborescence de travail" + diff --git a/git-gui/po/glossary/git-gui-glossary.pot b/git-gui/po/glossary/git-gui-glossary.pot index 48af803314..40eb3e9c07 100644 --- a/git-gui/po/glossary/git-gui-glossary.pot +++ b/git-gui/po/glossary/git-gui-glossary.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2007-10-19 21:43+0200\n" +"POT-Creation-Date: 2008-01-07 21:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,6 +70,10 @@ msgstr "" msgid "fetch" msgstr "" +#. "One context of consecutive lines in a whole patch, which consists of many such hunks" +msgid "hunk" +msgstr "" + #. "A collection of files. The index is a stored version of your working tree." msgid "index (in git-gui: staging area)" msgstr "" diff --git a/git-gui/po/glossary/git-gui-glossary.txt b/git-gui/po/glossary/git-gui-glossary.txt index 500d0a0ea7..9b31f69152 100644 --- a/git-gui/po/glossary/git-gui-glossary.txt +++ b/git-gui/po/glossary/git-gui-glossary.txt @@ -12,6 +12,7 @@ "diff [verb]" "" "fast forward merge" "A fast-forward is a special type of merge where you have a revision and you are merging another branch's changes that happen to be a descendant of what you have." "fetch" "Fetching a branch means to get the branch's head from a remote repository, to find out which objects are missing from the local object database, and to get them, too." +"hunk" "One context of consecutive lines in a whole patch, which consists of many such hunks" "index (in git-gui: staging area)" "A collection of files. The index is a stored version of your working tree." "merge [noun]" "A successful merge results in the creation of a new commit representing the result of the merge." "merge [verb]" "To bring the contents of another branch into the current branch." diff --git a/git-gui/po/sv.po b/git-gui/po/sv.po index 58c96c85d2..cd3f40b4a8 100644 --- a/git-gui/po/sv.po +++ b/git-gui/po/sv.po @@ -2,13 +2,13 @@ # Copyright (C) 2007 Shawn Pearce, et al. # This file is distributed under the same license as the git-gui package. # -# Peter Karlsson , 2007. +# Peter Karlsson , 2007-2008. msgid "" msgstr "" "Project-Id-Version: sv\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-11-24 10:36+0100\n" -"PO-Revision-Date: 2007-12-27 13:31CET-1\n" +"PO-Revision-Date: 2008-01-12 09:27+0100\n" "Last-Translator: Peter Karlsson \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" @@ -67,11 +67,11 @@ msgstr "Git-katalogen hittades inte:" #: git-gui.sh:895 msgid "Cannot move to top of working directory:" -msgstr "Kunde inte gÃ¥ till början pÃ¥ arbetskatalogen:" +msgstr "Kan inte gÃ¥ till början pÃ¥ arbetskatalogen:" #: git-gui.sh:902 msgid "Cannot use funny .git directory:" -msgstr "Kunde inte använda underlig .git-katalog:" +msgstr "Kan inte använda underlig .git-katalog:" #: git-gui.sh:907 msgid "No working directory" @@ -87,7 +87,7 @@ msgstr "Söker efter ändrade filer..." #: git-gui.sh:1294 lib/browser.tcl:245 msgid "Ready." -msgstr "Redo." +msgstr "Klar." #: git-gui.sh:1560 msgid "Unmodified" @@ -127,7 +127,7 @@ msgstr "Köade för borttagning, fortfarande närvarande" #: git-gui.sh:1576 git-gui.sh:1577 git-gui.sh:1578 git-gui.sh:1579 msgid "Requires merge resolution" -msgstr "Kräver avgörande efter sammanslagning" +msgstr "Kräver konflikthantering efter sammanslagning" #: git-gui.sh:1614 msgid "Starting gitk... please wait..." @@ -499,23 +499,23 @@ msgstr "Läser %s..." #: lib/blame.tcl:473 msgid "Loading copy/move tracking annotations..." -msgstr "Läser spÃ¥rningsanteckningar för kopiering/flyttning..." +msgstr "Läser annoteringar för kopiering/flyttning..." #: lib/blame.tcl:493 msgid "lines annotated" -msgstr "rader spÃ¥rade" +msgstr "rader annoterade" #: lib/blame.tcl:674 msgid "Loading original location annotations..." -msgstr "Läser in spÃ¥rning av originalplacering..." +msgstr "Läser in annotering av originalplacering..." #: lib/blame.tcl:677 msgid "Annotation complete." -msgstr "SpÃ¥rning fullbordad." +msgstr "Annotering fullbordad." #: lib/blame.tcl:731 msgid "Loading annotation..." -msgstr "Läser in spÃ¥rning..." +msgstr "Läser in annotering..." #: lib/blame.tcl:787 msgid "Author:" diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index acdcc5417a..402ff3782c 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -73,14 +73,19 @@ comment_for_reflog () { esac } +last_count= mark_action_done () { sed -e 1q < "$TODO" >> "$DONE" sed -e 1d < "$TODO" >> "$TODO".new mv -f "$TODO".new "$TODO" count=$(($(grep -ve '^$' -e '^#' < "$DONE" | wc -l))) total=$(($count+$(grep -ve '^$' -e '^#' < "$TODO" | wc -l))) - printf "Rebasing (%d/%d)\r" $count $total - test -z "$VERBOSE" || echo + if test "$last_count" != "$count" + then + last_count=$count + printf "Rebasing (%d/%d)\r" $count $total + test -z "$VERBOSE" || echo + fi } make_patch () { diff --git a/git-send-email.perl b/git-send-email.perl index e47994afc4..6c72952fcc 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -100,6 +100,8 @@ Options: --envelope-sender Specify the envelope sender used to send the emails. + --no-validate Don't perform any sanity checks on patches. + EOT exit(1); } @@ -177,6 +179,7 @@ my ($quiet, $dry_run) = (0, 0); my ($thread, $chain_reply_to, $suppress_from, $signed_off_cc, $cc_cmd); my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_authpass, $smtp_ssl); my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts); +my ($no_validate); my %config_bool_settings = ( "thread" => [\$thread, 1], @@ -222,6 +225,7 @@ my $rc = GetOptions("sender|from=s" => \$sender, "dry-run" => \$dry_run, "envelope-sender=s" => \$envelope_sender, "thread!" => \$thread, + "no-validate" => \$no_validate, ); unless ($rc) { @@ -314,6 +318,40 @@ if (@alias_files and $aliasfiletype and defined $parse_alias{$aliasfiletype}) { ($sender) = expand_aliases($sender) if defined $sender; +# Now that all the defaults are set, process the rest of the command line +# arguments and collect up the files that need to be processed. +for my $f (@ARGV) { + if (-d $f) { + opendir(DH,$f) + or die "Failed to opendir $f: $!"; + + push @files, grep { -f $_ } map { +$f . "/" . $_ } + sort readdir(DH); + + } elsif (-f $f) { + push @files, $f; + + } else { + print STDERR "Skipping $f - not found.\n"; + } +} + +if (!$no_validate) { + foreach my $f (@files) { + my $error = validate_patch($f); + $error and die "fatal: $f: $error\nwarning: no patches were sent\n"; + } +} + +if (@files) { + unless ($quiet) { + print $_,"\n" for (@files); + } +} else { + print STDERR "\nNo patch files specified!\n\n"; + usage(); +} + my $prompting = 0; if (!defined $sender) { $sender = $repoauthor || $repocommitter; @@ -427,34 +465,6 @@ EOT @files = ($compose_filename . ".final"); } - -# Now that all the defaults are set, process the rest of the command line -# arguments and collect up the files that need to be processed. -for my $f (@ARGV) { - if (-d $f) { - opendir(DH,$f) - or die "Failed to opendir $f: $!"; - - push @files, grep { -f $_ } map { +$f . "/" . $_ } - sort readdir(DH); - - } elsif (-f $f) { - push @files, $f; - - } else { - print STDERR "Skipping $f - not found.\n"; - } -} - -if (@files) { - unless ($quiet) { - print $_,"\n" for (@files); - } -} else { - print STDERR "\nNo patch files specified!\n\n"; - usage(); -} - # Variables we set as part of the loop over files our ($message_id, %mail, $subject, $reply_to, $references, $message); @@ -838,3 +848,15 @@ sub unique_email_list(@) { } return @emails; } + +sub validate_patch { + my $fn = shift; + open(my $fh, '<', $fn) + or die "unable to open $fn: $!\n"; + while (my $line = <$fh>) { + if (length($line) > 998) { + return "$.: patch contains a line longer than 998 characters"; + } + } + return undef; +} diff --git a/git-svn.perl b/git-svn.perl index d5316eb6da..9f2b587b25 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1758,10 +1758,16 @@ sub svnsync { # see if we have it in our config, first: eval { my $section = "svn-remote.$self->{repo_id}"; - $svnsync = { - url => tmp_config('--get', "$section.svnsync-url"), - uuid => tmp_config('--get', "$section.svnsync-uuid"), - } + + my $url = tmp_config('--get', "$section.svnsync-url"); + ($url) = ($url =~ m{^([a-z\+]+://\S+)$}) or + die "doesn't look right - svn:sync-from-url is '$url'\n"; + + my $uuid = tmp_config('--get', "$section.svnsync-uuid"); + ($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}) or + die "doesn't look right - svn:sync-from-uuid is '$uuid'\n"; + + $svnsync = { url => $url, uuid => $uuid } }; if ($svnsync && $svnsync->{url} && $svnsync->{uuid}) { return $self->{svnsync} = $svnsync; @@ -1772,11 +1778,11 @@ sub svnsync { my $rp = $self->ra->rev_proplist(0); my $url = $rp->{'svn:sync-from-url'} or die $err . "url\n"; - $url =~ m{^[a-z\+]+://} or + ($url) = ($url =~ m{^([a-z\+]+://\S+)$}) or die "doesn't look right - svn:sync-from-url is '$url'\n"; my $uuid = $rp->{'svn:sync-from-uuid'} or die $err . "uuid\n"; - $uuid =~ m{^[0-9a-f\-]{30,}$} or + ($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}) or die "doesn't look right - svn:sync-from-uuid is '$uuid'\n"; my $section = "svn-remote.$self->{repo_id}"; diff --git a/gitk-git/gitk b/gitk-git/gitk index 07ccfff9bd..7a97cc813d 100644 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -996,6 +996,7 @@ proc makewindow {} { bind . <$M1B-r> dosearchback bind . <$M1B-s> dosearch bind . <$M1B-equal> {incrfont 1} + bind . <$M1B-plus> {incrfont 1} bind . <$M1B-KP_Add> {incrfont 1} bind . <$M1B-minus> {incrfont -1} bind . <$M1B-KP_Subtract> {incrfont -1} diff --git a/http-push.c b/http-push.c index 55d0c944ae..b2b410df90 100644 --- a/http-push.c +++ b/http-push.c @@ -1563,9 +1563,17 @@ static int locking_available(void) lock_flags = 0; } XML_ParserFree(parser); + if (!lock_flags) + error("Error: no DAV locking support on %s", + remote->url); + + } else { + error("Cannot access URL %s, return code %d", + remote->url, results.curl_result); + lock_flags = 0; } } else { - fprintf(stderr, "Unable to start PROPFIND request\n"); + error("Unable to start PROPFIND request on %s", remote->url); } strbuf_release(&out_buffer.buf); @@ -2161,6 +2169,7 @@ int main(int argc, char **argv) int i; int new_refs; struct ref *ref; + char *rewritten_url = NULL; setup_git_directory(); @@ -2212,6 +2221,10 @@ int main(int argc, char **argv) break; } +#ifndef USE_CURL_MULTI + die("git-push is not available for http/https repository when not compiled with USE_CURL_MULTI"); +#endif + if (!remote->url) usage(http_push_usage); @@ -2224,9 +2237,16 @@ int main(int argc, char **argv) no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:"); + if (remote->url && remote->url[strlen(remote->url)-1] != '/') { + rewritten_url = malloc(strlen(remote->url)+2); + strcpy(rewritten_url, remote->url); + strcat(rewritten_url, "/"); + remote->url = rewritten_url; + ++remote->path_len; + } + /* Verify DAV compliance/lock support */ if (!locking_available()) { - fprintf(stderr, "Error: no DAV locking support on remote repo %s\n", remote->url); rc = 1; goto cleanup; } @@ -2239,6 +2259,11 @@ int main(int argc, char **argv) info_ref_lock = lock_remote("info/refs", LOCK_TIME); if (info_ref_lock) remote->can_update_info_refs = 1; + else { + fprintf(stderr, "Error: cannot lock existing info/refs\n"); + rc = 1; + goto cleanup; + } } if (remote->has_info_packs) fetch_indices(); @@ -2260,11 +2285,14 @@ int main(int argc, char **argv) if (!remote_tail) remote_tail = &remote_refs; if (match_refs(local_refs, remote_refs, &remote_tail, - nr_refspec, (const char **) refspec, push_all)) - return -1; + nr_refspec, (const char **) refspec, push_all)) { + rc = -1; + goto cleanup; + } if (!remote_refs) { fprintf(stderr, "No refs in common and none specified; doing nothing.\n"); - return 0; + rc = 0; + goto cleanup; } new_refs = 0; @@ -2395,10 +2423,12 @@ int main(int argc, char **argv) fprintf(stderr, "Unable to update server info\n"); } } - if (info_ref_lock) - unlock_remote(info_ref_lock); cleanup: + if (rewritten_url) + free(rewritten_url); + if (info_ref_lock) + unlock_remote(info_ref_lock); free(remote); curl_slist_free_all(no_pragma_header); diff --git a/lockfile.c b/lockfile.c index f45d3ed544..663f18f9c4 100644 --- a/lockfile.c +++ b/lockfile.c @@ -13,7 +13,8 @@ static void remove_lock_file(void) while (lock_file_list) { if (lock_file_list->owner == me && lock_file_list->filename[0]) { - close(lock_file_list->fd); + if (lock_file_list->fd >= 0) + close(lock_file_list->fd); unlink(lock_file_list->filename); } lock_file_list = lock_file_list->next; @@ -159,17 +160,26 @@ int hold_lock_file_for_update(struct lock_file *lk, const char *path, int die_on return fd; } +int close_lock_file(struct lock_file *lk) +{ + int fd = lk->fd; + lk->fd = -1; + return close(fd); +} + int commit_lock_file(struct lock_file *lk) { char result_file[PATH_MAX]; - int i; - close(lk->fd); + size_t i; + if (lk->fd >= 0 && close_lock_file(lk)) + return -1; strcpy(result_file, lk->filename); i = strlen(result_file) - 5; /* .lock */ result_file[i] = 0; - i = rename(lk->filename, result_file); + if (rename(lk->filename, result_file)) + return -1; lk->filename[0] = 0; - return i; + return 0; } int hold_locked_index(struct lock_file *lk, int die_on_error) @@ -185,9 +195,12 @@ void set_alternate_index_output(const char *name) int commit_locked_index(struct lock_file *lk) { if (alternate_index_output) { - int result = rename(lk->filename, alternate_index_output); + if (lk->fd >= 0 && close_lock_file(lk)) + return -1; + if (rename(lk->filename, alternate_index_output)) + return -1; lk->filename[0] = 0; - return result; + return 0; } else return commit_lock_file(lk); @@ -196,7 +209,8 @@ int commit_locked_index(struct lock_file *lk) void rollback_lock_file(struct lock_file *lk) { if (lk->filename[0]) { - close(lk->fd); + if (lk->fd >= 0) + close(lk->fd); unlink(lk->filename); } lk->filename[0] = 0; diff --git a/merge-recursive.c b/merge-recursive.c index b34177d20f..c292a77a81 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -1753,7 +1753,7 @@ int main(int argc, char *argv[]) if (active_cache_changed && (write_cache(index_fd, active_cache, active_nr) || - close(index_fd) || commit_locked_index(lock))) + commit_locked_index(lock))) die ("unable to write %s", get_index_file()); return clean ? 0: 1; diff --git a/refs.c b/refs.c index 58f6d17397..67d2a502af 100644 --- a/refs.c +++ b/refs.c @@ -864,7 +864,6 @@ static int repack_without_ref(const char *refname) die("too long a refname '%s'", list->name); write_or_die(fd, line, len); } - close(fd); return commit_lock_file(&packlock); } @@ -1019,14 +1018,27 @@ int rename_ref(const char *oldref, const char *newref, const char *logmsg) return 1; } +static int close_ref(struct ref_lock *lock) +{ + if (close_lock_file(lock->lk)) + return -1; + lock->lock_fd = -1; + return 0; +} + +static int commit_ref(struct ref_lock *lock) +{ + if (commit_lock_file(lock->lk)) + return -1; + lock->lock_fd = -1; + return 0; +} + void unlock_ref(struct ref_lock *lock) { - if (lock->lock_fd >= 0) { - close(lock->lock_fd); - /* Do not free lock->lk -- atexit() still looks at them */ - if (lock->lk) - rollback_lock_file(lock->lk); - } + /* Do not free lock->lk -- atexit() still looks at them */ + if (lock->lk) + rollback_lock_file(lock->lk); free(lock->ref_name); free(lock->orig_ref_name); free(lock); @@ -1119,10 +1131,16 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1, return 0; } +static int is_branch(const char *refname) +{ + return !strcmp(refname, "HEAD") || !prefixcmp(refname, "refs/heads/"); +} + int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *logmsg) { static char term = '\n'; + struct object *o; if (!lock) return -1; @@ -1130,9 +1148,22 @@ int write_ref_sha1(struct ref_lock *lock, unlock_ref(lock); return 0; } + o = parse_object(sha1); + if (!o) { + error("Trying to write ref %s with nonexistant object %s", + lock->ref_name, sha1_to_hex(sha1)); + unlock_ref(lock); + return -1; + } + if (o->type != OBJ_COMMIT && is_branch(lock->ref_name)) { + error("Trying to write non-commit object %s to branch %s", + sha1_to_hex(sha1), lock->ref_name); + unlock_ref(lock); + return -1; + } if (write_in_full(lock->lock_fd, sha1_to_hex(sha1), 40) != 40 || write_in_full(lock->lock_fd, &term, 1) != 1 - || close(lock->lock_fd) < 0) { + || close_ref(lock) < 0) { error("Couldn't write %s", lock->lk->filename); unlock_ref(lock); return -1; @@ -1165,12 +1196,11 @@ int write_ref_sha1(struct ref_lock *lock, !strcmp(head_ref, lock->ref_name)) log_ref_write("HEAD", lock->old_sha1, sha1, logmsg); } - if (commit_lock_file(lock->lk)) { + if (commit_ref(lock)) { error("Couldn't set %s", lock->ref_name); unlock_ref(lock); return -1; } - lock->lock_fd = -1; unlock_ref(lock); return 0; } diff --git a/sha1_file.c b/sha1_file.c index 93a34271e6..d68486253e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -621,6 +621,22 @@ void release_pack_memory(size_t need, int fd) ; /* nothing */ } +void close_pack_windows(struct packed_git *p) +{ + while (p->windows) { + struct pack_window *w = p->windows; + + if (w->inuse_cnt) + die("pack '%s' still has open windows to it", + p->pack_name); + munmap(w->base, w->len); + pack_mapped -= w->len; + pack_open_windows--; + p->windows = w->next; + free(w); + } +} + void unuse_pack(struct pack_window **w_cursor) { struct pack_window *w = *w_cursor; diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index 89baebdfa6..8b27aa892b 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -19,7 +19,7 @@ remove_cr () { test_expect_success setup ' - git repo-config core.autocrlf false && + git config core.autocrlf false && for w in Hello world how are you; do echo $w; done >one && mkdir dir && @@ -46,7 +46,7 @@ test_expect_success 'update with autocrlf=input' ' rm -f tmp one dir/two three && git read-tree --reset -u HEAD && - git repo-config core.autocrlf input && + git config core.autocrlf input && for f in one dir/two do @@ -70,7 +70,7 @@ test_expect_success 'update with autocrlf=true' ' rm -f tmp one dir/two three && git read-tree --reset -u HEAD && - git repo-config core.autocrlf true && + git config core.autocrlf true && for f in one dir/two do @@ -93,7 +93,7 @@ test_expect_success 'update with autocrlf=true' ' test_expect_success 'checkout with autocrlf=true' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf true && + git config core.autocrlf true && git read-tree --reset -u HEAD && for f in one dir/two @@ -117,7 +117,7 @@ test_expect_success 'checkout with autocrlf=true' ' test_expect_success 'checkout with autocrlf=input' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf input && + git config core.autocrlf input && git read-tree --reset -u HEAD && for f in one dir/two @@ -143,7 +143,7 @@ test_expect_success 'checkout with autocrlf=input' ' test_expect_success 'apply patch (autocrlf=input)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf input && + git config core.autocrlf input && git read-tree --reset -u HEAD && git apply patch.file && @@ -156,7 +156,7 @@ test_expect_success 'apply patch (autocrlf=input)' ' test_expect_success 'apply patch --cached (autocrlf=input)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf input && + git config core.autocrlf input && git read-tree --reset -u HEAD && git apply --cached patch.file && @@ -169,7 +169,7 @@ test_expect_success 'apply patch --cached (autocrlf=input)' ' test_expect_success 'apply patch --index (autocrlf=input)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf input && + git config core.autocrlf input && git read-tree --reset -u HEAD && git apply --index patch.file && @@ -183,7 +183,7 @@ test_expect_success 'apply patch --index (autocrlf=input)' ' test_expect_success 'apply patch (autocrlf=true)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf true && + git config core.autocrlf true && git read-tree --reset -u HEAD && git apply patch.file && @@ -196,7 +196,7 @@ test_expect_success 'apply patch (autocrlf=true)' ' test_expect_success 'apply patch --cached (autocrlf=true)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf true && + git config core.autocrlf true && git read-tree --reset -u HEAD && git apply --cached patch.file && @@ -209,7 +209,7 @@ test_expect_success 'apply patch --cached (autocrlf=true)' ' test_expect_success 'apply patch --index (autocrlf=true)' ' rm -f tmp one dir/two three && - git repo-config core.autocrlf true && + git config core.autocrlf true && git read-tree --reset -u HEAD && git apply --index patch.file && @@ -224,7 +224,7 @@ test_expect_success '.gitattributes says two is binary' ' rm -f tmp one dir/two three && echo "two -crlf" >.gitattributes && - git repo-config core.autocrlf true && + git config core.autocrlf true && git read-tree --reset -u HEAD && if remove_cr dir/two >/dev/null diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index a90824ba8a..71ab2dd0ee 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -7,12 +7,19 @@ test_description='Test git update-ref and basic ref logging' . ./test-lib.sh Z=0000000000000000000000000000000000000000 -A=1111111111111111111111111111111111111111 -B=2222222222222222222222222222222222222222 -C=3333333333333333333333333333333333333333 -D=4444444444444444444444444444444444444444 -E=5555555555555555555555555555555555555555 -F=6666666666666666666666666666666666666666 + +test_expect_success setup ' + + for name in A B C D E F + do + test_tick && + T=$(git write-tree) && + sha1=$(echo $name | git commit-tree $T) && + eval $name=$sha1 + done + +' + m=refs/heads/master n_dir=refs/heads/gu n=$n_dir/fixes diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index 10a5fa9a3a..6d12efb74d 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -22,7 +22,7 @@ echo 3 > a1 git commit --quiet -m "$(echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" | sed "s/i/1234/g" | tr 1234 '\360\235\204\236')" a1 # now fsck up the utf8 -git repo-config i18n.commitencoding non-utf-8 +git config i18n.commitencoding non-utf-8 echo 4 > a1 git commit --quiet -m "$(echo "This is a very, very long first line for the commit message to see if it is wrapped correctly" | sed "s/i/1234/g" | tr 1234 '\370\235\204\236')" a1 diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 659f9c758f..4f6822f2c5 100755 --- a/t/t9001-send-email.sh +++ b/t/t9001-send-email.sh @@ -78,4 +78,34 @@ test_expect_success 'Show all headers' ' diff -u expected-show-all-headers actual-show-all-headers ' +z8=zzzzzzzz +z64=$z8$z8$z8$z8$z8$z8$z8$z8 +z512=$z64$z64$z64$z64$z64$z64$z64$z64 +test_expect_success 'reject long lines' ' + rm -f commandline && + cp $patches longline.patch && + echo $z512$z512 >>longline.patch && + ! git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + $patches longline.patch \ + 2>errors && + grep longline.patch errors +' + +test_expect_success 'no patch was sent' ' + ! test -e commandline +' + +test_expect_success 'allow long lines with --no-validate' ' + git send-email \ + --from="Example " \ + --to=nobody@example.com \ + --smtp-server="$(pwd)/fake.sendmail" \ + --no-validate \ + $patches longline.patch \ + 2>errors +' + test_done diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index 910c584f24..a15222ced4 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -225,7 +225,7 @@ test_expect_success \ ! git-cvsexportcommit -c $id )' -case "$(git repo-config --bool core.filemode)" in +case "$(git config --bool core.filemode)" in false) ;; *) diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit index 7092bae263..b25dce6bbf 100644 --- a/templates/hooks--pre-commit +++ b/templates/hooks--pre-commit @@ -61,7 +61,7 @@ perl -e ' if (/^\s* \t/) { bad_line("indent SP followed by a TAB", $_); } - if (/^(?:[<>=]){7}/) { + if (/^([<>])\1{6} |^={7}$/) { bad_line("unresolved merge conflict", $_); } } diff --git a/templates/hooks--update b/templates/hooks--update index bd93dd1977..4b69268fd0 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -37,9 +37,9 @@ if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then fi # --- Config -allowunannotated=$(git-repo-config --bool hooks.allowunannotated) -allowdeletebranch=$(git-repo-config --bool hooks.allowdeletebranch) -allowdeletetag=$(git-repo-config --bool hooks.allowdeletetag) +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) # check for no description projectdesc=$(sed -e '1q' "$GIT_DIR/description")