summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* contrib: add credential helper for OS X Keychainjk/git-promptJeff King2011-12-123-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | With this installed in your $PATH, you can store git-over-http passwords in your keychain by doing: git config credential.helper osxkeychain The code is based in large part on the work of Jay Soffian, who wrote the helper originally for the initial, unpublished version of the credential helper protocol. This version will pass t0303 if you do: GIT_TEST_CREDENTIAL_HELPER=osxkeychain \ GIT_TEST_CREDENTIAL_HELPER_SETUP="export HOME=$HOME" \ ./t0303-credential-external.sh The "HOME" setup is unfortunately necessary. The test scripts set HOME to the trash directory, but this causes the keychain API to complain. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Makefile: OS X has /dev/ttyJeff King2011-12-121-0/+1
| | | | | | | We can use our enhanced getpass(). Tested by me. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Makefile: linux has /dev/ttyJeff King2011-12-121-0/+1
| | | | | | | | Therefore we can turn on our custom prompt function instead of relying on getpass. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: use git_prompt instead of git_getpassJeff King2011-12-121-8/+7
| | | | | | | | | | | We use git_getpass to retrieve the username and password from the terminal. However, git_getpass will not echo the username as the user types. We can fix this by using the more generic git_prompt, which underlies git_getpass but lets us specify an "echo" option. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* prompt: use git_terminal_promptJeff King2011-12-122-1/+3
| | | | | | | | | | | | Our custom implementation of git_terminal_prompt has many advantages over regular getpass(), as described in the prior commit. This also lets us implement a PROMPT_ECHO flag for callers who want it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add generic terminal prompt functionJeff King2011-12-123-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we need to prompt the user for input interactively, we want to access their terminal directly. We can't rely on stdio because it may be connected to pipes or files, rather than the terminal. Instead, we use "getpass()", because it abstracts the idea of prompting and reading from the terminal. However, it has some problems: 1. It never echoes the typed characters, which makes it OK for passwords but annoying for other input (like usernames). 2. Some implementations of getpass() have an extremely small input buffer (e.g., Solaris 8 is reported to support only 8 characters). 3. Some implementations of getpass() will fall back to reading from stdin (e.g., glibc). We explicitly don't want this, because our stdin may be connected to a pipe speaking a particular protocol, and reading will disrupt the protocol flow (e.g., the remote-curl helper). 4. Some implementations of getpass() turn off signals, so that hitting "^C" on the terminal does not break out of the password prompt. This can be a mild annoyance. Instead, let's provide an abstract "git_terminal_prompt" function that addresses these concerns. This patch includes an implementation based on /dev/tty, enabled by setting HAVE_DEV_TTY. The fallback is to use getpass() as before. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refactor git_getpass into generic prompt functionJeff King2011-12-122-16/+33
| | | | | | | | | This will allow callers to specify more options (e.g., leaving echo on). The original git_getpass becomes a slim wrapper around the new function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* move git_getpass to its own source fileJeff King2011-12-127-45/+58
| | | | | | | | | | This is currently in connect.c, but really has nothing to do with the git protocol itself. Let's make a new source file all about prompting the user, which will make it cleaner to refactor. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* imap-send: don't check return value of git_getpassJeff King2011-12-121-4/+0
| | | | | | | | git_getpass will always die() if we weren't able to get input, so there's no point looking for NULL. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* imap-send: avoid buffer overflowJeff King2011-12-121-3/+4
| | | | | | | | | | | We format the password prompt in an 80-character static buffer. It contains the remote host and username, so it's unlikely to overflow (or be exploitable by a remote attacker), but there's no reason not to be careful and use a strbuf. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t: add test harness for external credential helpersJeff King2011-12-121-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | We already have tests for the internal helpers, but it's nice to give authors of external tools an easy way to sanity-check their helpers. If you have written the "git-credential-foo" helper, you can do so with: GIT_TEST_CREDENTIAL_HELPER=foo \ make t0303-credential-external.sh This assumes that your helper is capable of both storing and retrieving credentials (some helpers may be read-only, and they will fail these tests). If your helper supports time-based expiration with a configurable timeout, you can test that feature like this: GIT_TEST_CREDENTIAL_HELPER_TIMEOUT="foo --timeout=1" \ make t0303-credential-external.sh Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credentials: add "store" helperJeff King2011-12-126-0/+248
| | | | | | | | | | | | | | | This is like "cache", except that we actually put the credentials on disk. This can be terribly insecure, of course, but we do what we can to protect them by filesystem permissions, and we warn the user in the documentation. This is not unlike using .netrc to store entries, but it's a little more user-friendly. Instead of putting credentials in place ahead of time, we transparently store them after prompting the user for them once. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: add strbuf_add*_urlencodeJeff King2011-12-122-0/+42
| | | | | | | | This just follows the rfc3986 rules for percent-encoding url data into a strbuf. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Makefile: unix sockets may not available on some platformsJohannes Sixt2011-12-122-3/+16
| | | | | | | | | | | Introduce a configuration option NO_UNIX_SOCKETS to exclude code that depends on Unix sockets and use it in MSVC and MinGW builds. Notice that unix-socket.h was missing from LIB_H before; fix that, too. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credentials: add "cache" helperJeff King2011-12-1112-5/+812
| | | | | | | | | | | | | | | If you access repositories over smart-http using http authentication, then it can be annoying to have git ask you for your password repeatedly. We cache credentials in memory, of course, but git is composed of many small programs. Having to input your password for each one can be frustrating. This patch introduces a credential helper that will cache passwords in memory for a short period of time. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* docs: end-user documentation for the credential subsystemJeff King2011-12-113-0/+195
| | | | | | | | | The credential API and helper format is already defined in technical/api-credentials.txt. This presents the end-user view. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: make relevance of http path configurableJeff King2011-12-114-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing a URL into a credential struct, we carefully record each part of the URL, including the path on the remote host, and use the result as part of the credential context. This had two practical implications: 1. Credential helpers which store a credential for later access are likely to use the "path" portion as part of the storage key. That means that a request to https://example.com/foo.git would not use the same credential that was stored in an earlier request for: https://example.com/bar.git 2. The prompt shown to the user includes all relevant context, including the path. In most cases, however, users will have a single password per host. The behavior in (1) will be inconvenient, and the prompt in (2) will be overly long. This patch introduces a config option to toggle the relevance of http paths. When turned on, we use the path as before. When turned off, we drop the path component from the context: helpers don't see it, and it does not appear in the prompt. This is nothing you couldn't do with a clever credential helper at the start of your stack, like: [credential "http://"] helper = "!f() { grep -v ^path= ; }; f" helper = your_real_helper But doing this: [credential] useHttpPath = false is way easier and more readable. Furthermore, since most users will want the "off" behavior, that is the new default. Users who want it "on" can set the variable (either for all credentials, or just for a subset using credential.*.useHttpPath). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: add credential.*.usernameJeff King2011-12-113-0/+33
| | | | | | | | | | | | Credential helpers can help users avoid having to type their username and password over and over. However, some users may not want a helper for their password, or they may be running a helper which caches for a short time. In this case, it is convenient to provide the non-secret username portion of their credential via config. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: apply helper configJeff King2011-12-114-1/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functionality for credential storage helpers is already there; we just need to give the users a way to turn it on. This patch provides a "credential.helper" configuration variable which allows the user to provide one or more helper strings. Rather than simply matching credential.helper, we will also compare URLs in subsection headings to the current context. This means you can apply configuration to a subset of credentials. For example: [credential "https://example.com"] helper = foo would match a request for "https://example.com/foo.git", but not one for "https://kernel.org/foo.git". This is overkill for the "helper" variable, since users are unlikely to want different helpers for different sites (and since helpers run arbitrary code, they could do the matching themselves anyway). However, future patches will add new config variables where this extra feature will be more useful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* http: use credential API to get passwordsJeff King2011-12-112-99/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the http code to use the new credential API, both for http authentication as well as for getting certificate passwords. Most of the code change is simply variable naming (the passwords are now contained inside the credential struct) or deletion of obsolete code (the credential code handles URL parsing and prompting for us). The behavior should be the same, with one exception: the credential code will prompt with a description based on the credential components. Therefore, the old prompt of: Username for 'example.com': Password for 'example.com': now looks like: Username for 'https://example.com/repo.git': Password for 'https://user@example.com/repo.git': Note that we include more information in each line, specifically: 1. We now include the protocol. While more noisy, this is an important part of knowing what you are accessing (especially if you care about http vs https). 2. We include the username in the password prompt. This is not a big deal when you have just been prompted for it, but the username may also come from the remote's URL (and after future patches, from configuration or credential helpers). In that case, it's a nice reminder of the user for which you're giving the password. 3. We include the path component of the URL. In many cases, the user won't care about this and it's simply noise (i.e., they'll use the same credential for a whole site). However, that is part of a larger question, which is whether path components should be part of credential context, both for prompting and for lookup by storage helpers. That issue will be addressed as a whole in a future patch. Similarly, for unlocking certificates, we used to say: Certificate Password for 'example.com': and we now say: Password for 'cert:///path/to/certificate': Showing the path to the client certificate makes more sense, as that is what you are unlocking, not "example.com". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* credential: add function for parsing url componentsJeff King2011-12-113-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the components of a credential struct can be found in a URL. For example, the URL: http://foo:bar@example.com/repo.git contains: protocol=http host=example.com path=repo.git username=foo password=bar We want to be able to turn URLs into broken-down credential structs so that we know two things: 1. Which parts of the username/password we still need 2. What the context of the request is (for prompting or as a key for storing credentials). This code is based on http_auth_init in http.c, but needed a few modifications in order to get all of the components that the credential object is interested in. Once the http code is switched over to the credential API, then http_auth_init can just go away. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* introduce credentials APIJeff King2011-12-118-0/+773
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few places in git that need to get a username and password credential from the user; the most notable one is HTTP authentication for smart-http pushing. Right now the only choices for providing credentials are to put them plaintext into your ~/.netrc, or to have git prompt you (either on the terminal or via an askpass program). The former is not very secure, and the latter is not very convenient. Unfortunately, there is no "always best" solution for password management. The details will depend on the tradeoff you want between security and convenience, as well as how git can integrate with other security systems (e.g., many operating systems provide a keychain or password wallet for single sign-on). This patch provides an abstract notion of credentials as a data item, and provides three basic operations: - fill (i.e., acquire from external storage or from the user) - approve (mark a credential as "working" for further storage) - reject (mark a credential as "not working", so it can be removed from storage) These operations can be backed by external helper processes that interact with system- or user-specific secure storage. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t5550: fix typoJeff King2011-12-111-1/+1
| | | | | | | | | This didn't have an impact, because it was just setting up an "expect" file that happened to be identical to the one in the test before it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test-lib: add test_config_global variantJeff King2011-12-111-0/+5
| | | | | | | | | | | | | | | | | | | | The point of test_config is to simultaneously set a config variable and register its cleanup handler, like: test_config core.foo bar However, it stupidly assumes that $1 contained the name of the variable, which means it won't work for: test_config --global core.foo bar We could try to parse the command-line ourselves and figure out which parts need to be fed to test_unconfig. But since this is likely the most common variant, it's much simpler and less error-prone to simply add a new function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update 1.7.8 draft release notes in preparation for rc4Junio C Hamano2011-11-221-1/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jn/revert-quit'Junio C Hamano2011-11-2210-54/+314
|\ | | | | | | | | | | | | | | | | | | * jn/revert-quit: revert: remove --reset compatibility option revert: introduce --abort to cancel a failed cherry-pick revert: write REVERT_HEAD pseudoref during conflicted revert revert: improve error message for cherry-pick during cherry-pick revert: rearrange pick_revisions() for clarity revert: rename --reset option to --quit
| * revert: remove --reset compatibility optionjn/revert-quitJonathan Nieder2011-11-222-5/+2
| | | | | | | | | | | | | | | | | | Remove the "git cherry-pick --reset" option, which has a different preferred spelling nowadays ("--quit"). Luckily the old --reset name was not around long enough for anyone to get used to it. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * revert: introduce --abort to cancel a failed cherry-pickJonathan Nieder2011-11-225-3/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After running some ill-advised command like "git cherry-pick HEAD..linux-next", the bewildered novice may want to return to more familiar territory. Introduce a "git cherry-pick --abort" command that rolls back the entire cherry-pick sequence and places the repository back on solid ground. Just like "git merge --abort", this internally uses "git reset --merge", so local changes not involved in the conflict resolution are preserved. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * revert: write REVERT_HEAD pseudoref during conflicted revertJonathan Nieder2011-11-224-3/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When conflicts are encountered while reverting a commit, it can be handy to have the name of that commit easily available. For example, to produce a copy of the patch to refer to while resolving conflicts: $ git revert 2eceb2a8 error: could not revert 2eceb2a8... awesome, buggy feature $ git show -R REVERT_HEAD >the-patch $ edit $(git diff --name-only) Set a REVERT_HEAD pseudoref when "git revert" does not make a commit, for cases like this. This also makes it possible for scripts to distinguish between a revert that encountered conflicts and other sources of an unmerged index. After successfully committing, resetting with "git reset", or moving to another commit with "git checkout" or "git reset", the pseudoref is no longer useful, so remove it. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * revert: improve error message for cherry-pick during cherry-pickJonathan Nieder2011-11-221-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the spirit of v1.6.3.3~3^2 (refuse to merge during a merge, 2009-07-01), "git cherry-pick" refuses to start a new cherry-pick when in the middle of an existing conflicted cherry-pick in the following sequence: 1. git cherry-pick HEAD..origin 2. resolve conflicts 3. git cherry-pick HEAD..origin (instead of "git cherry-pick --continue", by mistake) Good. However, the error message on attempting step 3 is more convoluted than necessary: $ git cherry-pick HEAD..origin error: .git/sequencer already exists. error: A cherry-pick or revert is in progress. hint: Use --continue to continue the operation hint: or --quit to forget about it fatal: cherry-pick failed Clarify by removing the redundant first "error:" message, simplifying the advice, and using lower-case and no full stops to be consistent with other commands that prefix their messages with "error:", so it becomes error: a cherry-pick or revert is already in progress hint: try "git cherry-pick (--continue | --quit)" fatal: cherry-pick failed The "fatal: cherry-pick failed" line seems unnecessary, too, but that can be fixed some other day. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * revert: rearrange pick_revisions() for clarityJonathan Nieder2011-11-221-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | Deal completely with "cherry-pick --quit" and --continue at the beginning of pick_revisions(), leaving the rest of the function for the more interesting "git cherry-pick <commits>" case. No functional change intended. The impact is just to unindent the code a little. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * revert: rename --reset option to --quitJonathan Nieder2011-11-227-25/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option to "git cherry-pick" and "git revert" to discard the sequencer state introduced by v1.7.8-rc0~141^2~6 (revert: Introduce --reset to remove sequencer state, 2011-08-04) has a confusing name. Change it now, while we still have the time. The new name for "cherry-pick, please get out of my way, since I've long forgotten about the sequence of commits I was cherry-picking when you wrote that old .git/sequencer directory" is --quit. Mnemonic: this is analagous to quiting a program the user is no longer using --- we just want to get out of the multiple-command cherry-pick procedure and not to reset HEAD or rewind any other old state. The "--reset" option is kept as a synonym to minimize the impact. We might consider dropping it for simplicity in a separate patch, though. Adjust documentation and tests to use the newly preferred name (--quit) instead of --reset. While at it, let's clarify the short descriptions of these operations in "-h" output. Before: --reset forget the current operation --continue continue the current operation After: --quit end revert or cherry-pick sequence --continue resume revert or cherry-pick sequence Noticed-by: Phil Hord <phil.hord@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2011-11-211-1/+1
|\ \ | |/ |/| | | | | * maint: documentation fix: git difftool uses diff tools, not merge tools.
| * documentation fix: git difftool uses diff tools, not merge tools.Thomas Hochstein2011-11-211-1/+1
| | | | | | | | | | | | | | | | Let the documentation for -t list valid *diff* tools, not valid *merge* tools. Signed-off-by: Thomas Hochstein <thh@inter.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rr/misc-fixes'Junio C Hamano2011-11-211-1/+1
|\ \ | | | | | | | | | | | | * rr/misc-fixes: convert.c: Fix return type of git_path_check_eol()
| * | convert.c: Fix return type of git_path_check_eol()rr/misc-fixesRamsay Jones2011-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git_path_check_eol() function converts a string value to the corresponding 'enum eol' value. However, the function is currently declared to return an 'enum crlf_action', which causes sparse to complain thus: SP convert.c convert.c:736:50: warning: mixing different enum types convert.c:736:50: int enum crlf_action versus convert.c:736:50: int enum eol In order to suppress the warning, we simply correct the return type in the function declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | config.c: Fix a static buffer overwrite bug by avoiding mkpath()Ramsay Jones2011-11-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On cygwin, test number 21 of t3200-branch.sh (git branch -m q q2 without config should succeed) fails. The failure involves the functions from path.c which parcel out internal static buffers from the git_path() and mkpath() functions. In particular, the rename_ref() function calls safe_create_leading\ _directories() with a filename returned by git_path("logs/%s", ref). safe_create_leading_directories(), in turn, calls stat() on each element of the path it is given. On cygwin, this leads to a call to git_config() for each component of the path, since this test explicitly removes the config file. git_config() calls mkpath(), so on the fourth component of the path, the original buffer passed into the function is overwritten with the config filename. Note that this bug is specific to cygwin and it's schizophrenic stat() functions (see commits adbc0b6, 7faee6b and 7974843). The lack of a config file and a path with at least four elements is also important to trigger the bug. In order to fix the problem, we replace the call to mkpath() with a call to mksnpath() and provide our own buffer. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | t5501-*.sh: Fix url passed to clone in setup testRamsay Jones2011-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, the url passed to git-clone has an extra '/' given after the 'file://' schema prefix, thus: git clone --reference=original "file:///$(pwd)/original one Once the prefix is removed, the remainder of the url looks something like "//home/ramsay/git/t/...", which is then interpreted as an network path. This then results in a "Permission denied" error, like so: ramsay $ ls //home ls: cannot access //home: No such host or network path ramsay $ ls //home/ramsay ls: cannot access //home/ramsay: Permission denied ramsay $ In order to fix the problem, we simply remove the extraneous '/' character from the url. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Hopefully final update of release notes before 1.7.8 finalJunio C Hamano2011-11-181-1/+1
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rr/misc-fixes'Junio C Hamano2011-11-184-13/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * rr/misc-fixes: git-compat-util: don't assume value for undefined variable sha1_file: don't mix enum with int convert: don't mix enum with int http: remove unused function hex()
| * | git-compat-util: don't assume value for undefined variableRamkumar Ramachandra2011-11-151-1/+1
| | | | | | | | | | | | | | | | | | Suggested-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | sha1_file: don't mix enum with intRamkumar Ramachandra2011-11-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | convert: don't mix enum with intRamkumar Ramachandra2011-11-151-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | http: remove unused function hex()Ramkumar Ramachandra2011-11-151-8/+0
| | | | | | | | | | | | | | | Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Makefile: add option to disable automatic dependency generationJonathan Nieder2011-11-181-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the COMPUTE_HEADER_DEPENDENCIES feature is turned on automatically for compilers that support it (see v1.7.8-rc0~142^2~1, 2011-08-18), there is no easy way to force it off. For example, setting COMPUTE_HEADER_DEPENDENCIES to the empty string in config.mak just tells the makefile to treat it as undefined and run a test command to see if the -MMD option is supported. So allow setting COMPUTE_HEADER_DEPENDENCIES=no to explicitly force the feature off. The new semantics: - "yes" means to explicitly enable the feature - "no" means to disable it - "auto" means to autodetect The default is still "auto". Any value other than these three will cause the build to error out with a descriptive message so typos and stale settings in config.mak don't result in mysterious behavior. Makefile:1278: *** please set COMPUTE_HEADER_DEPENDENCIES to yes, no, or auto (not "1"). Stop. So now when someone using a compiler without -MMD support reports trouble building git, you can reproduce it by running "make COMPUTE_HEADER_DEPENDENCIES=no". Suggested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Improved-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Tested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Sync with 1.7.7.4Junio C Hamano2011-11-185-49/+81
|\ \ \ | | |/ | |/|
| * | Git 1.7.7.4v1.7.7.4Junio C Hamano2011-11-183-2/+16
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Merge branch 'jc/maint-name-rev-all' into maintJunio C Hamano2011-11-181-1/+1
| |\ \ | | | | | | | | | | | | | | | | * jc/maint-name-rev-all: name-rev --all: do not even attempt to describe non-commit object
| | * | name-rev --all: do not even attempt to describe non-commit objectjc/maint-name-rev-allJunio C Hamano2011-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This even dates back to the very beginning of "git name-rev"; it does not make much sense to dump all objects in the repository and label non-commits as "undefined". Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'ml/mailmap' into maintJunio C Hamano2011-11-181-3/+2
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ml/mailmap: mailmap: xcalloc mailmap_info Conflicts: mailmap.c