summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* setup_git_env: avoid blind fall-back to ".git"jk/no-looking-at-dotgit-outside-repo-finalJeff King2016-10-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we default to ".git" without having done any kind of repository setup, the results quite often do what the user expects. But this has also historically been the cause of some poorly behaved corner cases. These cases can be hard to find, because they happen at the conjunction of two relatively rare circumstances: 1. We are running some code which assumes there's a repository present, but there isn't necessarily one (e.g., low-level diff code triggered by "git diff --no-index" might try to look at some repository data). 2. We have an unusual setup, like being in a subdirectory of the working tree, or we have a .git file (rather than a directory), or we are running a tool like "init" or "clone" which may operate on a repository in a different directory. Our test scripts often cover (1), but miss doing (2) at the same time, and so the fallback appears to work but has lurking bugs. We can flush these bugs out by refusing to do the fallback entirely., This makes potential problems a lot more obvious by complaining even for "usual" setups. This passes the test suite (after the adjustments in the previous patches), but there's a risk of regression for any cases where the fallback usually works fine but the code isn't exercised by the test suite. So by itself, this commit is a potential step backward, but lets us take two steps forward once we've identified and fixed any such instances. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff: handle sha1 abbreviations outside of repositoryJeff King2016-10-261-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating diffs outside a repository (e.g., with "diff --no-index"), we may write abbreviated sha1s as part of "--raw" output or the "index" lines of "--patch" output. Since we have no object database, we never find any collisions, and these sha1s get whatever static abbreviation length is configured (typically 7). However, we do blindly look in ".git/objects" to see if any objects exist, even though we know we are not in a repository. This is usually harmless because such a directory is unlikely to exist, but could be wrong in rare circumstances. Let's instead notice when we are not in a repository and behave as if the object database is empty (i.e., just use the default abbrev length). It would perhaps make sense to be conservative and show full sha1s in that case, but showing the default abbreviation is what we've always done (and is certainly less ugly). Note that this does mean that: cd /not/a/repo GIT_OBJECT_DIRECTORY=/some/real/objdir git diff --no-index ... used to look for collisions in /some/real/objdir but now does not. This could be considered either a bugfix (we do not look at objects if we have no repository) or a regression, but it seems unlikely that anybody would care much either way. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff_aligned_abbrev: use "struct oid"Jeff King2016-10-263-12/+14
| | | | | | | | | | Since we're modifying this function anyway, it's a good time to update it to the more modern "struct oid". We can also drop some of the magic numbers in favor of GIT_SHA1_HEXSZ, along with some descriptive comments. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff_unique_abbrev: rename to diff_aligned_abbrevJeff King2016-10-263-11/+11
| | | | | | | | | | | | | | The word "align" describes how the function actually differs from find_unique_abbrev, and will make it less confusing when we add more diff-specific abbrevation functions that do not do this alignment. Since this is a globally available function, let's also move its descriptive comment to the header file, where we typically document function interfaces. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* find_unique_abbrev: use 4-buffer ringJeff King2016-10-264-19/+16
| | | | | | | | | | | | | | | | Some code paths want to format multiple abbreviated sha1s in the same output line. Because we use a single static buffer for our return value, they have to either break their output into several calls or allocate their own arrays and use find_unique_abbrev_r(). Intead, let's mimic sha1_to_hex() and use a ring of several buffers, so that the return value stays valid through multiple calls. This shortens some of the callers, and makes it harder to for them to make a silly mistake. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test-*-cache-tree: setup git dirJeff King2016-10-262-0/+2
| | | | | | | | | | | These test helper programs access the index, but do not ever setup_git_directory(), meaning we just blindly looked in ".git/index". This happened to work for the purposes of our tests (which do not run from subdirectories, nor in non-repos), but it's a bad habit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* read info/{attributes,exclude} only when in repositoryJeff King2016-10-262-7/+11
| | | | | | | | | | | | | | | | | | | The low-level attribute and gitignore code will try to look in $GIT_DIR/info for any repo-level configuration files, even if we have not actually determined that we are in a repository (e.g., running "git grep --no-index"). In such a case they end up looking for ".git/info/attributes", etc. This is generally harmless, as such a file is unlikely to exist outside of a repository, but it's still conceptually the wrong thing to do. Let's detect this situation explicitly and skip reading the file (i.e., the same behavior we'd get if we were in a repository and the file did not exist). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Eleventh batch for 2.11Junio C Hamano2016-10-261-0/+106
| | | | | | | | There still are a few topics that need to go in before -rc0 which would make the shape of the upcoming release clearer, but here is the final batch before it happens. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'ex/deprecate-empty-pathspec-as-match-all'Junio C Hamano2016-10-263-2/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty string used as a pathspec element has always meant 'everything matches', but it is too easy to write a script that finds a path to remove in $path and run 'git rm "$paht"', which ends up removing everything. Start warning about this use of an empty string used for 'everything matches' and ask users to use a more explicit '.' for that instead. The hope is that existing users will not mind this change, and eventually the warning can be turned into a hard error, upgrading the deprecation into removal of this (mis)feature. * ex/deprecate-empty-pathspec-as-match-all: pathspec: warn on empty strings as pathspec
| * pathspec: warn on empty strings as pathspecEmily Xie2016-06-223-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty string as a pathspec element matches all paths. A buggy script, however, could accidentally assign an empty string to a variable that then gets passed to a Git command invocation, e.g.: path=... compute a path to be removed in $path ... git rm -r "$paht" which would unintentionally remove all paths in the current directory. The fix for this issue requires a two-step approach. As there may be existing scripts that knowingly use empty strings in this manner, the first step simply gives a warning that (1) tells that an empty string will become an invalid pathspec element and (2) asks the user to use "." if they mean to match all. For step two, a follow-up patch several release cycles later will remove the warning and throw an error instead. This patch is the first step. Signed-off-by: Emily Xie <emilyxxie@gmail.com> Reported-by: David Turner <novalis@novalis.org> Mentored-by: Michail Denchev <mdenchev@gmail.com> Thanks-to: Sarah Sharp <sarah@thesharps.us> and James Sharp <jamey@minilop.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'po/fix-doc-merge-base-illustration'Junio C Hamano2016-10-262-21/+21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Some AsciiDoc formatter mishandles a displayed illustration with tabs in it. Adjust a few of them in merge-base documentation to work around them. * po/fix-doc-merge-base-illustration: doc: fix the 'revert a faulty merge' ASCII art tab spacing doc: fix merge-base ASCII art tab spacing
| * | doc: fix the 'revert a faulty merge' ASCII art tab spacingpo/fix-doc-merge-base-illustrationPhilip Oakley2016-10-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The asciidoctor doc-tool stack does not always respect the 'tab = 8 spaces' rule expectation, particularly for the Git-for-Windows generated html pages. This follows on from the 'doc: fix merge-base ASCII art tab spacing' fix. Use just spaces within the block of the ascii art. All other *.txt ascii art containing three dashes has been checked. Asciidoctor correctly formats the other art blocks that do contain tabs. Signed-off-by: Philip Oakley <philipoakley@iee.org Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | doc: fix merge-base ASCII art tab spacingPhilip Oakley2016-10-211-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The doc-tool stack does not always respect the 'tab = 8 spaces' rule, particularly the git-scm doc pages https://git-scm.com/docs/git-merge-base and the Git generated html pages. Use just spaces within the block of the ascii art. Noticed when reviewing Junio's suggested update to `git merge-base` https://public-inbox.org/git/xmqqmvi2sj8f.fsf@gitster.mtv.corp.google.com/T/#u Signed-off-by: Philip Oakley <philipoakley@iee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jk/tap-verbose-fix'Junio C Hamano2016-10-263-5/+37
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Travis CI configuration we ship ran the tests with --verbose option but this risks non-TAP output that happens to be "ok" to be misinterpreted as TAP signalling a test that passed. This resulted in unnecessary failure. This has been corrected by introducing a new mode to run our tests in the test harness to send the verbose output separately to the log file. * jk/tap-verbose-fix: test-lib: bail out when "-v" used under "prove" travis: use --verbose-log test option test-lib: add --verbose-log option test-lib: handle TEST_OUTPUT_DIRECTORY with spaces
| * | | test-lib: bail out when "-v" used under "prove"jk/tap-verbose-fixJeff King2016-10-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there is a TAP harness consuming the output of our test scripts, the "--verbose" breaks the output by mingling test command output with TAP. Because the TAP::Harness module used by "prove" is fairly lenient, this _usually_ works, but it violates the spec, and things get very confusing if the commands happen to output a line that looks like TAP (e.g., the word "ok" on its own line). Let's detect this situation and complain. Just calling error() isn't great, though; prove will tell us that the script failed, but the message doesn't make it through to the user. Instead, we can use the special TAP signal "Bail out!". This not only shows the message to the user, but instructs the harness to stop running the tests entirely. This is exactly what we want here, as the problem is in the command-line options, and every test script would produce the same error. The result looks like this (the first "Bailout called" line is in red if prove uses color on your terminal): $ make GIT_TEST_OPTS='--verbose --tee' rm -f -r 'test-results' *** prove *** Bailout called. Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log FAILED--Further testing stopped: verbose mode forbidden under TAP harness; try --verbose-log Makefile:39: recipe for target 'prove' failed make: *** [prove] Error 255 Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | travis: use --verbose-log test optionJeff King2016-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because we run the tests via "prove", the output from "--verbose" may interfere with our TAP output. Using "--verbose-log" solves this while letting us retain our on-disk log. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | test-lib: add --verbose-log optionJeff King2016-10-212-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "--verbose" option redirects output from arbitrary test commands to stdout. This is useful for examining the output manually, like: ./t5547-push-quarantine.sh -v | less But it also means that the output is intermingled with the TAP directives, which can confuse a TAP parser like "prove". This has always been a potential problem, but became an issue recently when one test happened to output the word "ok" on a line by itself, which prove interprets as a test success: $ prove t5547-push-quarantine.sh :: -v t5547-push-quarantine.sh .. 1/? To dest.git * [new branch] HEAD -> master To dest.git ! [remote rejected] reject -> reject (pre-receive hook declined) error: failed to push some refs to 'dest.git' fatal: git cat-file d08c8eba97f4e683ece08654c7c8d2ba0c03b129: bad file t5547-push-quarantine.sh .. Failed -1/4 subtests Test Summary Report ------------------- t5547-push-quarantine.sh (Wstat: 0 Tests: 5 Failed: 0) Parse errors: Tests out of sequence. Found (2) but expected (3) Tests out of sequence. Found (3) but expected (4) Tests out of sequence. Found (4) but expected (5) Bad plan. You planned 4 tests but ran 5. Files=1, Tests=5, 0 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU) Result: FAIL One answer is "if it hurts, don't do it", but that's not quite the whole story. The Travis tests use "--verbose --tee" so that they can get the benefit of prove's parallel options, along with a verbose log in case there is a failure. We just need the verbose output to go to the log, but keep stdout clean. Getting this right turns out to be surprisingly difficult. Here's the progression of alternatives I considered: 1. Add an option to write verbose output to stderr. This is hard to capture, though, because we want each test to have its own log (because they're all run in parallel and the jumbled output would be useless). 2. Add an option to write verbose output to a file in test-results. This works, but the log is missing all of the non-verbose output, which gives context. 3. Like (2), but teach say_color() to additionally output to the log. This mostly works, but misses any output that happens outside of the say() functions (which isn't a lot, but is a potential maintenance headache). 4. Like (2), but make the log file the same as the "--tee" file. That almost works, but now we have two processes opening the same file. That gives us two separate descriptors, each with their own idea of the current position. They'll each start writing at offset 0, and overwrite each other's data. 5. Like (4), but in each case open the file for appending. That atomically positions each write at the end of the file. It's possible we may still get sheared writes between the two processes, but this is already the case when writing to stdout. It's not a problem in practice because the test harness generally waits for snippets to finish before writing the TAP output. We can ignore buffering issues with tee, because POSIX mandates that it does not buffer. Likewise, POSIX specifies "tee -a", so it should be available everywhere. This patch implements option (5), which seems to work well in practice. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | test-lib: handle TEST_OUTPUT_DIRECTORY with spacesJeff King2016-10-211-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are careful in test_done to handle a results directory with a space in it, but the "--tee" code path does not. Doing: export TEST_OUTPUT_DIRECTORY='/tmp/path with spaces' ./t000-init.sh --tee results in errors. Let's consistently double-quote our path variables so that this works. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'mm/send-email-cc-cruft-after-address'Junio C Hamano2016-10-263-10/+42
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git send-email" attempts to pick up valid e-mails from the trailers, but people in real world write non-addresses there, like "Cc: Stable <add@re.ss> # 4.8+", which broke the output depending on the availability and vintage of Mail::Address perl module. * mm/send-email-cc-cruft-after-address: Git.pm: add comment pointing to t9000 t9000-addresses: update expected results after fix parse_mailboxes: accept extra text after <...> address
| * | | Git.pm: add comment pointing to t9000mm/send-email-cc-cruft-after-addressMatthieu Moy2016-10-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parse_mailboxes should probably eventually be completely equivalent to Mail::Address, and if this happens we can drop the Mail::Address dependency. Add a comment in the code reminding the current state of the code, and point to the corresponding failing test to help future contributors to get it right. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t9000-addresses: update expected results after fixMatthieu Moy2016-10-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e3fdbcc8e1 (parse_mailboxes: accept extra text after <...> address, 2016-10-13) improved our in-house address parser and made it closer to Mail::Address. As a consequence, some tests comparing it to Mail::Address now pass, but e3fdbcc8e1 forgot to update the test. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | parse_mailboxes: accept extra text after <...> addressMatthieu Moy2016-10-142-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test introduced in this commit succeeds without the patch to Git.pm if Mail::Address is installed, but fails otherwise because our in-house parser does not accept any text after the email address. They succeed both with and without Mail::Address after this commit. Mail::Address accepts extra text and considers it as part of the name, iff the address is surrounded with <...>. The implementation mimics this behavior as closely as possible. This mostly restores the behavior we had before b1c8a11 (send-email: allow multiple emails using --cc, --to and --bcc, 2015-06-30), but we keep the possibility to handle comma-separated lists. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'yk/git-tag-remove-mention-of-old-layout-in-doc'Junio C Hamano2016-10-261-3/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shorten description of auto-following in "git tag" by removing a mention of historical remotes layout which is not relevant to the main topic. * yk/git-tag-remove-mention-of-old-layout-in-doc: doc: remove reference to the traditional layout in git-tag.txt
| * | | | doc: remove reference to the traditional layout in git-tag.txtyk/git-tag-remove-mention-of-old-layout-in-docYounes Khoudli2016-10-201-3/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the only place in the documentation that the traditional layout is mentioned, and it is confusing. Remove it. * Documentation/git-tag.txt: Here. Signed-off-by: Younes Khoudli <younes.khoudli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'pt/gitgui-updates'Junio C Hamano2016-10-2626-1923/+1982
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new version of git-gui, now at its 0.21.0 tag. * pt/gitgui-updates: (22 commits) git-gui: set version 0.21 git-gui: Mark 'All' in remote.tcl for translation git-gui i18n: Updated Bulgarian translation (565,0f,0u) git-gui: avoid persisting modified author identity git-gui: handle the encoding of Git's output correctly git-gui: unicode file name support on windows git-gui: Update Russian translation git-gui: maintain backwards compatibility for merge syntax git-gui i18n: mark string in lib/error.tcl for translation git-gui: fix incorrect use of Tcl append command git-gui i18n: mark "usage:" strings for translation git-gui i18n: internationalize use of colon punctuation git-gui: ensure the file in the diff pane is in the list of selected files git-gui: support for $FILENAMES in tool definitions git-gui: fix initial git gui message encoding git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut` git-gui: fix detection of Cygwin Amend tab ordering and text widget border and highlighting. Allow keyboard control to work in the staging widgets. ...
| * \ \ \ Merge tag 'gitgui-0.21.0' of git://repo.or.cz/git-guipt/gitgui-updatesJunio C Hamano2016-10-2026-1923/+1982
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-gui 0.21.0 * tag 'gitgui-0.21.0' of git://repo.or.cz/git-gui: (22 commits) git-gui: set version 0.21 git-gui: Mark 'All' in remote.tcl for translation git-gui i18n: Updated Bulgarian translation (565,0f,0u) git-gui: avoid persisting modified author identity git-gui: handle the encoding of Git's output correctly git-gui: unicode file name support on windows git-gui: Update Russian translation git-gui: maintain backwards compatibility for merge syntax git-gui i18n: mark string in lib/error.tcl for translation git-gui: fix incorrect use of Tcl append command git-gui i18n: mark "usage:" strings for translation git-gui i18n: internationalize use of colon punctuation git-gui: ensure the file in the diff pane is in the list of selected files git-gui: support for $FILENAMES in tool definitions git-gui: fix initial git gui message encoding git-gui/po/glossary/txt-to-pot.sh: use the $( ... ) construct for command substitution git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut` git-gui: fix detection of Cygwin Amend tab ordering and text widget border and highlighting. Allow keyboard control to work in the staging widgets. ...
| | * | | | git-gui: set version 0.21gitgui-0.21.0Pat Thoyts2016-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | Merge branch 'as/bulgarian' into puPat Thoyts2016-10-202-1374/+1467
| | |\ \ \ \
| | | * | | | git-gui: Mark 'All' in remote.tcl for translationAlexander Shopov2016-10-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | git-gui i18n: Updated Bulgarian translation (565,0f,0u)Alexander Shopov2016-10-201-1370/+1463
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | Merge branch 'os/preserve-author' into puPat Thoyts2016-10-201-3/+33
| | |\ \ \ \ \
| | | * | | | | git-gui: avoid persisting modified author identityPat Thoyts2016-10-061-20/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7e71adc77f fixes a problem with git-gui failing to pick up the original author identity during a commit --amend operation. However, the new author details then become persistent for the remainder of the session. This commit fixes this by ensuring the environment variables are reset and the author information reset once the commit is completed. The relevant changes were reworked to reduce global variables. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui: Do not reset author details on amendOrgad Shaneh2016-04-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git commit --amend preserves the author details unless --reset-author is given. git-gui discards the author details on amend. Fix by reading the author details along with the commit message, and setting the appropriate environment variables required for preserving them. Reported long ago in the mailing list[1]. [1] http://article.gmane.org/gmane.comp.version-control.git/243921 Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
| | * | | | | | Merge branch 'kb/unicode' into puPat Thoyts2016-10-203-30/+12
| | |\ \ \ \ \ \ | | | |_|/ / / / | | |/| | | | |
| | | * | | | | git-gui: handle the encoding of Git's output correctlyKarsten Blees2016-10-061-25/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we use 'eval exec $opt $cmdp $args' to execute git command, tcl engine will convert the output of the git comand with the rule system default code page to unicode. But cp936 -> unicode conversion implicitly done by exec is not reversible. So we have to use git_read instead. Bug report and an original reproducer by Cloud Chou: https://github.com/msysgit/git/issues/302 Cloud Chou find the reason of the bug. Thanks-to: Johannes Schindelin <johannes.schindelin@gmx.de> Thanks-to: Pat Thoyts <patthoyts@users.sourceforge.net> Reported-by: Cloud Chou <515312382@qq.com> Original-test-by: Cloud Chou <515312382@qq.com> Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Cloud Chou <515312382@qq.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui: unicode file name support on windowsKarsten Blees2016-10-063-8/+11
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assumes file names in git tree objects are UTF-8 encoded. On most unix systems, the system encoding (and thus the TCL system encoding) will be UTF-8, so file names will be displayed correctly. On Windows, it is impossible to set the system encoding to UTF-8. Changing the TCL system encoding (via 'encoding system ...', e.g. in the startup code) is explicitly discouraged by the TCL docs. Change git-gui functions dealing with file names to always convert from and to UTF-8. Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | Merge branch 'dr/ru' into puPat Thoyts2016-10-041-431/+249
| | |\ \ \ \ \
| | | * | | | | git-gui: Update Russian translationDimitriy Ryazantcev2016-10-041-431/+249
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | git-gui: maintain backwards compatibility for merge syntaxPat Thoyts2016-10-041-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b5f325c updated to use the newer merge syntax but continue to support older versions of git. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | Merge branch 'va/i18n_2' into puPat Thoyts2016-10-0317-36/+35
| | |\ \ \ \ \
| | | * | | | | git-gui i18n: mark string in lib/error.tcl for translationVasco Almeida2016-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark string "$hook hook failed:" in lib/error.tcl for translation. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui: fix incorrect use of Tcl append commandVasco Almeida2016-10-0315-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix wrong use of append command in strings marked for translation. According to Tcl/Tk Documentation [1], append varName ?value value value ...? appends all value arguments to the current value of variable varName. This means that append "[appname] ([reponame]): " [mc "File Viewer"] is setting a variable named "[appname] ([reponame]): " to the output of [mc "File Viewer"], rather than returning the concatenation of both expressions as one might expect. The format for some strings enables, for instance, a French translator to translate like "%s (%s) : Create Branch" (space before colon). Conversely, strings already translated will be marked as fuzzy and the translator must update them herself. For some cases, use alternative way for concatenation instead of using strcat procedure defined in git-gui.sh. Reference: 31bb1d1 ("git-gui: Paper bag fix missing translated strings", 2007-09-14) fixes the same issue slightly differently. [1] http://www.tcl.tk/man/tcl/TclCmd/append.htm Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui i18n: mark "usage:" strings for translationVasco Almeida2016-10-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark command-line "usage:" string for translation in git-gui.sh. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui i18n: internationalize use of colon punctuationVasco Almeida2016-10-034-7/+7
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internationalize use of colon punctuation ':' in options window, windows titles, database statistics window. Some languages might use a different style, for instance French uses "User Name :" (space before colon). Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | Merge branch 'pt/non-mouse-usage' into puPat Thoyts2016-10-032-42/+155
| | |\ \ \ \ \
| | | * | | | | Amend tab ordering and text widget border and highlighting.Pat Thoyts2016-10-022-31/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tab order follows widget creation order (and Z-order) so amend this to match the layout more logically. For keyboard selection a highlight around the selected text widget is useful. Customized on Windows themed Tk to follow the native theme more closely with a custom EntryFrame style. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | Allow keyboard control to work in the staging widgets.Pat Thoyts2016-10-011-12/+32
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keyboard focus was restricted to the commit message widget and users were forced to use the mouse to select files in the workdir widget and only then could use a key combination to stage the file. It is now possible to use key navigation (Ctrl-Tab, arrow keys and Ctrl-T or Ctrl-U) to stage and unstage files. Suggested by @koppor in git-for-window/git issue #859 Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | * | | | | Merge branch 'pt/git4win-mods' into puPat Thoyts2016-10-032-4/+11
| | |\ \ \ \ \
| | | * | | | | git-gui (Windows): use git-gui.exe in `Create Desktop Shortcut`Pat Thoyts2016-10-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calling `Repository>Create Desktop Shortcut`, Git GUI assumes that it is okay to call `wish.exe` directly on Windows. However, in Git for Windows 2.x' context, that leaves several crucial environment variables uninitialized, resulting in a shortcut that does not work. To fix those environment variable woes, Git for Windows comes with a convenient `git-gui.exe`, so let's just use it when it is available. This fixes https://github.com/git-for-windows/git/issues/448 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
| | | * | | | | git-gui: fix detection of CygwinPat Thoyts2016-10-031-0/+4
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSys2 might *look* like Cygwin, but it is *not* Cygwin... Unless it is run with `MSYSTEM=MSYS`, that is. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>