summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-19test-lib: clarify and tighten SANITYJunio C Hamano
f400e51c (test-lib.sh: set prerequisite SANITY by testing what we really need, 2015-01-27) improved the way SANITY prerequisite was determined, but made the resulting code (incorrectly) imply that SANITY is all about effects of permission bits of the containing directory has on the files contained in it by the comment it added, its log message and the actual tests. State what SANITY is about more clearly in the comment, and test that a file whose permission bits says should be unreadble truly cannot be read. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-15t0060: loosen overly strict expectationsJohannes Schindelin
The dirname() tests file were developed and tested on only the five platforms available to the developer at the time, namely: Linux (both 32 and 64bit), Windows XP 32-bit (MSVC), MinGW 32-bit and Cygwin 32-bit. http://pubs.opengroup.org/onlinepubs/9699919799/functions/basename.html (i.e. the POSIX spec) says, in part: If the string pointed to by path consists entirely of the '/' character, basename() shall return a pointer to the string "/". If the string pointed to by path is exactly "//", it is implementation-defined whether "/" or "//" is returned. The thinking behind testing precise, OS-dependent output values was to document that different setups produce different values. However, as the test failures on MacOSX illustrated eloquently: hardcoding pretty much each and every setup's expectations is pretty fragile. This is not limited to the "//" vs "/" case, of course, other inputs are also allowed to produce multiple outputs by the POSIX specs. So let's just test for all allowed values and be done with it. This still documents that Git cannot rely on one particular output value in those cases, so the intention of the original tests is still met. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13rebase: ignore failures from "gc --auto"Jeff King
After rebasing, we call "gc --auto" to clean up if we created a lot of loose objects. However, we do so inside an &&-chain. If "gc --auto" fails (e.g., because a previous background gc blocked us by leaving "gc.log" in place), then: 1. We will fail to clean up the state directory, leaving the user stuck in the rebase forever (even "git am --abort" doesn't work, because it calls "gc --auto"!). 2. In some cases, we may return a bogus exit code from rebase, indicating failure when everything except the auto-gc succeeded. We can fix this by ignoring the exit code of "gc --auto". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13receive-pack: release pack files before garbage-collectingJohannes Schindelin
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13merge: release pack files before garbage-collectingJohannes Schindelin
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13am: release pack files before garbage-collectingJohannes Schindelin
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13fetch: release pack files before garbage-collectingJohannes Schindelin
Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected. This fixes https://github.com/git-for-windows/git/issues/500 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-12Merge branch 'maint' of git://github.com/git-l10n/git-po into maintJunio C Hamano
* 'maint' of git://github.com/git-l10n/git-po: l10n: ko.po: Add Korean translation
2016-01-12gitweb: squelch "uninitialized value" warningØyvind A. Holm
git_object() chomps $type that is read from "cat-file -t", but it does so before checking if $type is defined, resulting in a Perl warning in the server error log: gitweb.cgi: Use of uninitialized value $type in scalar chomp at [...]/gitweb.cgi line 7579., referer: [...] when trying to access a non-existing commit, for example: http://HOST/?p=PROJECT.git;a=commit;h=NON_EXISTING_COMMIT Check the value in $type before chomping. This will cause us to call href with its action parameter set to undef when formulating the URL to redirect to, but that is harmless, as the function treats a parameter that set to undef as if it does not exist. Signed-off-by: Øyvind A. Holm <sunny@sunbase.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-12t0060: verify that basename() and dirname() work as expectedJohannes Schindelin
Unfortunately, some libgen implementations yield outcomes different from what Git expects. For example, mingw-w64-crt provides a basename() function, that shortens `path0/` to `path`! So let's verify that the basename() and dirname() functions we use conform to what Git expects. Derived-from-code-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-12compat/basename.c: provide a dirname() compatibility functionJohannes Schindelin
When there is no `libgen.h` to our disposal, we miss the `dirname()` function. Earlier we added basename() compatibility function for the same reason at e1c06886 (compat: add a basename() compatibility function, 2009-05-31). So far, we only had one user of that function: credential-cache--daemon (which was only compiled when Unix sockets are available, anyway). But now we also have `builtin/am.c` as user, so we need it. Since `dirname()` is a sibling of `basename()`, we simply put our very own `gitdirname()` implementation next to `gitbasename()` and use it if `NO_LIBGEN_H` has been set. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-12compat/basename: make basename() conform to POSIXJohannes Schindelin
According to POSIX, basename("/path/") should return "path", not "path/". Likewise, basename(NULL) and basename("") should both return "." to conform. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-12Refactor skipping DOS drive prefixesJohannes Schindelin
Junio noticed that there is an implicit assumption in pretty much all the code calling has_dos_drive_prefix(): it forces all of its callsites to hardcode the knowledge that the DOS drive prefix is always two bytes long. While this assumption is pretty safe, we can still make the code more readable and less error-prone by introducing a function that skips the DOS drive prefix safely. While at it, we change the has_dos_drive_prefix() return value: it now returns the number of bytes to be skipped if there is a DOS drive prefix. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-11Handle more file writes correctly in shared reposJohannes Schindelin
In shared repositories, we have to be careful when writing files whose permissions do not allow users other than the owner to write them. In particular, we force the marks file of fast-export and the FETCH_HEAD when fetching to be rewritten from scratch. This commit does not touch other calls to fopen() that want to write files: - commands that write to working tree files (core.sharedRepository does not affect permission bits of working tree files), e.g. .rej file created by "apply --reject", result of applying a previous conflict resolution by "rerere", "git merge-file". - git am, when splitting mails (git-am correctly cleans up its directory after finishing, so there is no need to share those files between users) - git submodule clone, when writing the .git file, because the file will not be overwritten - git_terminal_prompt() in compat/terminal.c, because it is not writing to a file at all - git diff --output, because the output file is clearly not intended to be shared between the users of the current repository - git fast-import, when writing a crash report, because the reports' file names are unique due to an embedded process ID - mailinfo() in mailinfo.c, because the output is clearly not intended to be shared between the users of the current repository - check_or_regenerate_marks() in remote-testsvn.c, because this is only used for Git's internal testing - git fsck, when writing lost&found blobs (this should probably be changed, but left as a low-hanging fruit for future contributors). Note that this patch does not touch callers of write_file() and write_file_gently(), which would benefit from the same scrutiny as to usage in shared repositories. Most notable users are branch, daemon, submodule & worktree, and a worrisome call in transport.c when updating one ref (which ignores the shared flag). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-08docs: clarify that --depth for git-fetch works with newly initialized reposSebastian Schuberth
The original wording sounded as if --depth could only be used to deepen or shorten the history of existing repos. However, that is not the case. In a workflow like $ git init $ git remote add origin https://github.com/git/git.git $ git fetch --depth=1 The newly initialized repo is properly created as a shallow repo. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-08docs: say "commits" in the --depth option wording for git-cloneSebastian Schuberth
It is not wrong to talk about "revisions" here, but in this context revisions are always commits, and that is how we already name it in the git-fetch docs. So align the docs by always referring to "commits". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-08Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"Nguyễn Thái Ngọc Duy
This reverts commit 57534ee77d22e725d971ee89c77dc6aad61c573f. The feature added in that commit requires that patterns behave the same way from anywhere. But some patterns can behave differently depending on current "working" directory. The conditions to catch and avoid these patterns are too loose. The untracked listing[1] and sparse-checkout selection[2] can become incorrect as a result. [1] http://article.gmane.org/gmane.comp.version-control.git/283520 [2] http://article.gmane.org/gmane.comp.version-control.git/283532 Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-07commit: allow editing the commit message even in shared reposJohannes Schindelin
It was pointed out by Yaroslav Halchenko that the file containing the commit message is writable only by the owner, which means that we have to rewrite it from scratch in a shared repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-07docs: clarify that passing --depth to git-clone implies --single-branchSebastian Schuberth
It is confusing to document how --depth behaves as part of the --single-branch docs. Better move that part to the --depth docs, saying that it implies --single-branch by default. Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-05Expand documentation describing --signoffDavid A. Wheeler
Modify various document (man page) files to explain in more detail what --signoff means. This was inspired by https://lwn.net/Articles/669976/ where paulj noted, "adding [the] '-s' argument to [a] git commit doesn't really mean you have even heard of the DCO...". Extending git's documentation will make it easier to argue that developers understood --signoff when they use it. Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-05reflog-walk: don't segfault on non-commit sha1's in the reflogDennis Kaarsemaker
git reflog (ab)uses the log machinery to display its list of log entries. To do so it must fake commit parent information for the log walker. For refs in refs/heads this is no problem, as they should only ever point to commits. Tags and other refs however can point to anything, thus their reflog may contain non-commit objects. To avoid segfaulting, we check whether reflog entries are commits before feeding them to the log walker and skip any non-commits. This means that git reflog output will be incomplete for such refs, but that's one step up from segfaulting. A more complete solution would be to decouple git reflog from the log walker machinery. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-05t6050-replace: make failing editor test more robustSZEDER Gábor
'git replace --edit' should error out when the invoked editor fails, but the test checking this behavior would not notice if this weren't the case. The test in question, ever since it was added in 85f98fc037ae (replace: add tests for --edit, 2014-05-17), has simulated a failing editor in an unconventional way: test_must_fail env GIT_EDITOR='./fakeeditor;false' git replace --edit I presume the reason for this unconventional editor was the fact that 'git replace --edit' requires the edited object to be different from the original, but a mere 'false' as editor would leave the object unchanged and 'git replace --edit' would error out anyway complaining about the new and the original object files being the same. Running 'fakeeditor' before 'false' was supposed to ensure that the object file is modified and thus 'git replace --edit' errors out because of the failed editor. However, this editor doesn't actually modify the edited object, because start_command() turns this editor into: /bin/sh -c './fakeeditor;false "$@"' './fakeeditor;false' \ '.../.git/REPLACE_EDITOBJ' This means that the test's fakeeditor script doesn't even get the path of the object to be edited as argument, triggering error messages from the commands executed inside the script ('sed' and 'mv'), and ultimately leaving the object file unchanged. If a patch were to remove the die() from the error path after launch_editor(), the test would not catch it, because 'git replace' would continue execution past launch_editor() and would error out a bit later due to the unchanged edited object. Though 'git replace' would error out for the wrong reason, this would satisfy 'test_must_fail' just as well, and the test would succeed leaving the undesired change unnoticed. Create a proper failing fake editor script for this test to ensure that the edited object is in fact modified and 'git replace --edit' won't error out because the new and original object files are the same. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-05for-each-ref: document `creatordate` and `creator` fieldsEric Wong
These were introduced back in 2006 at 3175aa1ec28c but never documented. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-04Git 2.7v2.7.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-04Sync with 2.6.5Junio C Hamano
2016-01-04Git 2.6.5v2.6.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-04Merge branch 'jk/pending-keep-tag-name' into maintJunio C Hamano
History traversal with "git log --source" that starts with an annotated tag failed to report the tag as "source", due to an old regression in the command line parser back in v2.2 days. * jk/pending-keep-tag-name: revision.c: propagate tag names from pending array
2016-01-04Merge branch 'jk/symbolic-ref-maint' into maintJunio C Hamano
"git symbolic-ref" forgot to report a failure with its exit status. * jk/symbolic-ref-maint: t1401: test reflog creation for git-symbolic-ref symbolic-ref: propagate error code from create_symref()
2016-01-04Merge branch 'jk/ident-loosen-getpwuid' into maintJunio C Hamano
When getpwuid() on the system returned NULL (e.g. the user is not in the /etc/passwd file or other uid-to-name mappings), the codepath to find who the user is to record it in the reflog barfed and died. Loosen the check in this codepath, which already accepts questionable ident string (e.g. host part of the e-mail address is obviously bogus), and in general when we operate fmt_ident() function in non-strict mode. * jk/ident-loosen-getpwuid: ident: loosen getpwuid error in non-strict mode ident: keep a flag for bogus default_email ident: make xgetpwuid_self() a static local helper
2016-01-04Merge branch 'jk/send-email-ssl-errors' into maintJunio C Hamano
Improve error reporting when SMTP TLS fails. * jk/send-email-ssl-errors: send-email: enable SSL level 1 debug output
2016-01-04Merge branch 'sg/completion-no-column' into maintJunio C Hamano
The completion script (in contrib/) used to list "git column" (which is not an end-user facing command) as one of the choices * sg/completion-no-column: completion: remove 'git column' from porcelain commands
2016-01-04git-send-email: do not double-escape quotes from muttEric Wong
mutt saves aliases with escaped quotes in the form of: alias dot \"Dot U. Sir\" <somebody@example.org> When we pass through our sanitize_address routine, we end up with double-escaping: To: "\\\"Dot U. Sir\\\" <somebody@example.org> Remove the escaping in mutt only for now, as I am not sure if other mailers can do this or if this is better fixed in sanitize_address. Cc: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> Cc: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-04bswap: add NO_UNALIGNED_LOADS defineJeff King
The byte-swapping code automatically decides, based on the platform, whether it is sensible to cast and do a potentially unaligned ntohl(), or to pick individual bytes out of an array. It can be handy to override this decision, though, when turning on compiler flags that will complain about unaligned loads (such as -fsanitize=undefined). This patch adds a macro check to make this possible. There's no nice Makefile knob here; this is for prodding at Git's internals, and anybody using it can set "-DNO_UNALIGNED_LOADS" in the same place they are setting up "-fsanitize". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-04avoid shifting signed integers 31 bitsJeff King
We sometimes use 32-bit unsigned integers as bit-fields. It's fine to access the MSB, because it's unsigned. However, doing so as "1 << 31" is wrong, because the constant "1" is a signed int, and we shift into the sign bit, causing undefined behavior. We can fix this by using "1U" as the constant. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-03l10n: ko.po: Add Korean translationChangwoo Ryu
Signed-off-by: Changwoo Ryu <cwryu@debian.org> Signed-off-by: Hyunjun Kim <yoloseem@users.noreply.github.com>
2016-01-02Merge tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-poJunio C Hamano
l10n-2.7.0-rnd2+de * tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po: l10n: de.po: translate 68 new messages l10n: de.po: improve some translations
2015-12-30user-manual: add addition gitweb informationStephen P. Smith
Rework the section on gitweb to add information about the cgi script and the instaweb command. Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-30user-manual: add section documenting shallow clonesStephen P. Smith
Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-29glossary: define the term shallow cloneStephen P. Smith
There are several places in the documentation that the term shallow clone is used. Defining the term enables its use elsewhere with a known definition. Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-29l10n: de.po: translate 68 new messagesRalf Thielow
Translate 68 new messages came from git.pot update in f4f2c8f (l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)) and 2c0ca05 (l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
2015-12-29l10n: de.po: improve some translationsRalf Thielow
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Phillip Sz <phillip.szelat@gmail.com>
2015-12-28Git 2.7-rc3v2.7.0-rc3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-28Merge branch 'sh/p4-multi-depot'Junio C Hamano
"git p4" when interacting with multiple depots at the same time used to incorrectly drop changes. * sh/p4-multi-depot: git-p4: reduce number of server queries for fetches git-p4: support multiple depot paths in p4 submit git-p4: failing test case for skipping changes with multiple depots
2015-12-28Merge branch 'jk/pending-keep-tag-name'Junio C Hamano
History traversal with "git log --source" that starts with an annotated tag failed to report the tag as "source", due to an old regression in the command line parser back in v2.2 days. * jk/pending-keep-tag-name: revision.c: propagate tag names from pending array
2015-12-28Merge branch 'jk/symbolic-ref-maint'Junio C Hamano
"git symbolic-ref" forgot to report a failure with its exit status. * jk/symbolic-ref-maint: t1401: test reflog creation for git-symbolic-ref symbolic-ref: propagate error code from create_symref()
2015-12-28Merge tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-poJunio C Hamano
l10n-2.7.0-rnd2 * tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po: l10n: ru.po: update Russian translation l10n: Updated Bulgarian translation of git (2477t,0f,0u) l10n: ca.po: update translation l10n: zh_CN: for git v2.7.0 l10n round 2 l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: sv: Fix bad translation l10n: fr.po v2.7.0 round 2 (2477t) l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed) l10n: zh_CN: for git v2.7.0 l10n round 1 l10n: ca.po: update translation l10n: fr v2.7.0 round 1 (2477t) l10n: Updated Bulgarian translation of git (2477t,0f,0u) l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: vi.po: Updated translation (2477t) l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed) l10n: fr.po: Fix typo l10n: fr.po: Fix typo
2015-12-28user-manual: remove temporary branch entry from todo listStephen P. Smith
In the section on "How to check out a different version of a project" the "new" branch is used as a temporary branch. A detached HEAD was not used since it was a new feature introduced just a couple weeks prior. The section could be changed to use and explain a detached HEAD, except that would increase the learning curve early in the manual. Detached HEADs are discussed a couple sections later under "Examining an old version without creating a new branch". Let's declare that it is a bad idea to rewrite the example that uses a temporary branch to do the sightseeing on a detached HEAD. Signed-off-by: Stephen P. Smith <ischis2@cox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-28dir.c: clean the entire struct in clear_exclude_list()Nguyễn Thái Ngọc Duy
Make sure "el" can be reuseable again. The problem was el->alloc is not cleared and may cause segfaults next time because add_exclude() thinks el->excludes (being NULL) has enough space. Just clear the entire struct to be safe. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-28l10n: ru.po: update Russian translationDimitriy Ryazantcev
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2015-12-28Merge branch 'master' of git://github.com/alshopov/git-poJiang Xin
* 'master' of git://github.com/alshopov/git-po: l10n: Updated Bulgarian translation of git (2477t,0f,0u)