summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test-sha1-array: read command stream with strbuf_getline()jc/strbuf-gets-2Junio C Hamano2016-01-141-1/+1
| | | | | | | | The input to this command comes from a pipeline in t0064, whose upstream has bunch of "echo"s. It is not unreasonable to expect that it may be fed CRLF lines on DOSsy systems. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* grep: read -f file with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | | | | | List of patterns file could come from a DOS editor. This is iffy; you may actually be trying to find a line with ^M in it on a system whose line ending is LF. You can of course work it around by having a line that has "^M^M^J", let the strbuf_getline() eat the last "^M^J", leaving just the single "^M" as the pattern. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* send-pack: read list of refs with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* column: read lines with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | | Multiple lines read here are concatenated on a single line to form a multi-column output line. We do not want to have a CR at the end, even if the input file consists of CRLF terminated lines. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* cat-file: read batch stream with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | It is possible to prepare a text file with a DOS editor and feed it as a batch command stream to the command. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* transport-helper: read helper response with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | | | | | Our implementation of helpers never use CRLF line endings, and they do not depend on the ability to place a CR as payload at the end of the line, so this is essentially a no-op for in-tree users. However, this allows third-party implementation of helpers to give us their line with CRLF line ending (they cannot expect us to feed CRLF to them, though). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* clone/sha1_file: read info/alternates with strbuf_getline()Junio C Hamano2016-01-142-2/+2
| | | | | | | | $GIT_OBJECT_DIRECTORY/info/alternates is a text file that can be edited with a DOS editor. We do not want to use the real path with CR appeneded at the end. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote.c: read $GIT_DIR/remotes/* with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | These files can be edited with a DOS editor, leaving CR at the end of the line if read with strbuf_getline(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ident.c: read /etc/mailname with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | | | | | | | Just in case /etc/mailname file was edited with a DOS editor, read it with strbuf_getline() so that a stray CR is not included as the last character of the mail hostname. We _might_ want to more aggressively discard whitespace characters around the line with strbuf_trim(), but that is a bit outside the scope of this series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-parse: read parseopt spec with strbuf_getline()Junio C Hamano2016-01-141-2/+2
| | | | | | | "rev-parse --parseopt" specification is clearly text and we should anticipate that we may be fed CRLF lines. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* revision: read --stdin with strbuf_getline()Junio C Hamano2016-01-141-7/+2
| | | | | | | | | | | | | | Reading with getwholeline() and manually stripping the terminating '\n' would leave CR at the end of the line if the input comes from a DOS editor. Constrasting this with the previous few changes, one may realize that the way "log" family of commands read the paths with --stdin looks inconsistent and sloppy. It does not allow us to C-quote a textual input, and it does not accept NUL-terminated records. These are unfortunately way too late to fix X-<. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* hash-object: read --stdin-paths with strbuf_getline()Junio C Hamano2016-01-141-1/+1
| | | | | | The list of paths could have been written with a DOS editor. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: give strbuf_getline() to the "most text friendly" variantJunio C Hamano2016-01-144-20/+24
| | | | | | | | | | | | Now there is no direct caller to strbuf_getline(), we can demote it to file-scope static private to strbuf.c implementation and rename it to strbuf_getdelim(). Rename strbuf_getline_crlf(), which is designed to be the most "text friendly" variant, and allow it to take over this simplest name, strbuf_getline(), so we can add more uses of it without having to type _crlf over and over again in the coming steps. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* checkout-index: there are only two possible line terminationsJunio C Hamano2016-01-141-8/+8
| | | | | | | | | | The program by default reads LF terminated lines, with an option to use NUL terminated records. Instead of pretending that there can be other useful values for line_termination, use a boolean variable, nul_term_line, to tell if NUL terminated records are used, and switch between strbuf_getline_{lf,nul} based on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* update-index: there are only two possible line terminationsJunio C Hamano2016-01-141-11/+16
| | | | | | | | | | The program by default reads LF terminated lines, with an option to use NUL terminated records. Instead of pretending that there can be other useful values for line_termination, use a boolean variable, nul_term_line, to tell if NUL terminated records are used, and switch between strbuf_getline_{lf,nul} based on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* check-ignore: there are only two possible line terminationsJunio C Hamano2016-01-141-3/+4
| | | | | | | | | | The program by default reads LF terminated lines, with an option to use NUL terminated records. Instead of pretending that there can be other useful values for line_termination, use a boolean variable, nul_term_line, to tell if NUL terminated records are used, and switch between strbuf_getline_{lf,nul} based on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* check-attr: there are only two possible line terminationsJunio C Hamano2016-01-141-3/+4
| | | | | | | | | | The program by default reads LF terminated lines, with an option to use NUL terminated records. Instead of pretending that there can be other useful values for line_termination, use a boolean variable, nul_term_line, to tell if NUL terminated records are used, and switch between strbuf_getline_{lf,nul} based on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mktree: there are only two possible line terminationsJunio C Hamano2016-01-141-6/+8
| | | | | | | | | | The program by default reads LF terminated lines, with an option to use NUL terminated records. Instead of pretending that there can be other useful values for line_termination, use a boolean variable, nul_term_line, to tell if NUL terminated records are used, and switch between strbuf_getline_{lf,nul} based on it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: introduce strbuf_getline_{lf,nul}()Junio C Hamano2016-01-1336-56/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The strbuf_getline() interface allows a byte other than LF or NUL as the line terminator, but this is only because I wrote these codepaths anticipating that there might be a value other than NUL and LF that could be useful when I introduced line_termination long time ago. No useful caller that uses other value has emerged. By now, it is clear that the interface is overly broad without a good reason. Many codepaths have hardcoded preference to read either LF terminated or NUL terminated records from their input, and then call strbuf_getline() with LF or NUL as the third parameter. This step introduces two thin wrappers around strbuf_getline(), namely, strbuf_getline_lf() and strbuf_getline_nul(), and mechanically rewrites these call sites to call either one of them. The changes contained in this patch are: * introduction of these two functions in strbuf.[ch] * mechanical conversion of all callers to strbuf_getline() with either '\n' or '\0' as the third parameter to instead call the respective thin wrapper. After this step, output from "git grep 'strbuf_getline('" would become a lot smaller. An interim goal of this series is to make this an empty set, so that we can have strbuf_getline_crlf() take over the shorter name strbuf_getline(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: make strbuf_getline_crlf() globalJunio C Hamano2016-01-133-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | Often we read "text" files that are supplied by the end user (e.g. commit log message that was edited with $GIT_EDITOR upon 'git commit -e'), and in some environments lines in a text file are terminated with CRLF. Existing strbuf_getline() knows to read a single line and then strip the terminating byte from the result, but it is handy to have a version that is more tailored for a "text" input that takes both '\n' and '\r\n' as line terminator (aka <newline> in POSIX lingo) and returns the body of the line after stripping <newline>. Recently reimplemented "git am" uses such a function implemented privately; move it to strbuf.[ch] and make it available for others. Note that we do not blindly replace calls to strbuf_getline() that uses LF as the line terminator with calls to strbuf_getline_crlf() and this is very much deliberate. Some callers may want to treat an incoming line that ends with CR (and terminated with LF) to have a payload that includes the final CR, and such a blind replacement will result in misconversion when done without code audit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* strbuf: miniscule style fixJunio C Hamano2016-01-131-2/+2
| | | | | | | We write one SP on each side of an operator, even inside an [] pair that computes the array index. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Seventh batch for 2.7Junio C Hamano2015-10-261-1/+36
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'dk/p4-import-ctypes'Junio C Hamano2015-10-261-0/+1
|\ | | | | | | | | | | | | | | "git-p4" tried to use from ctypes module without first importing it. * dk/p4-import-ctypes: git-p4: import the ctypes module
| * git-p4: import the ctypes moduledk/p4-import-ctypesDennis Kaarsemaker2015-10-201-0/+1
| | | | | | | | | | | | | | | | | | | | The ctypes module is used on windows to calculate free disk space, so it must be imported. We won't need it on other platforms, but the module is available in Python 2.5 and newer, so importing it unconditionally is harmless. Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/repository-extension'Junio C Hamano2015-10-268-12/+209
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare for Git on-disk repository representation to undergo backward incompatible changes by introducing a new repository format version "1", with an extension mechanism. * jk/repository-extension: introduce "preciousObjects" repository extension introduce "extensions" form of core.repositoryformatversion
| * | introduce "preciousObjects" repository extensionjk/repository-extensionJeff King2015-06-248-9/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If this extension is used in a repository, then no operations should run which may drop objects from the object storage. This can be useful if you are sharing that storage with other repositories whose refs you cannot see. For instance, if you do: $ git clone -s parent child $ git -C parent config extensions.preciousObjects true $ git -C parent config core.repositoryformatversion 1 you now have additional safety when running git in the parent repository. Prunes and repacks will bail with an error, and `git gc` will skip those operations (it will continue to pack refs and do other non-object operations). Older versions of git, when run in the repository, will fail on every operation. Note that we do not set the preciousObjects extension by default when doing a "clone -s", as doing so breaks backwards compatibility. It is a decision the user should make explicitly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | introduce "extensions" form of core.repositoryformatversionJeff King2015-06-244-3/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally we try to avoid bumps of the whole-repository core.repositoryformatversion field. However, it is unavoidable if we want to safely change certain aspects of git in a backwards-incompatible way (e.g., modifying the set of ref tips that we must traverse to generate a list of unreachable, safe-to-prune objects). If we were to bump the repository version for every such change, then any implementation understanding version `X` would also have to understand `X-1`, `X-2`, and so forth, even though the incompatibilities may be in orthogonal parts of the system, and there is otherwise no reason we cannot implement one without the other (or more importantly, that the user cannot choose to use one feature without the other, weighing the tradeoff in compatibility only for that particular feature). This patch documents the existing repositoryformatversion strategy and introduces a new format, "1", which lets a repository specify that it must run with an arbitrary set of extensions. This can be used, for example: - to inform git that the objects should not be pruned based only on the reachability of the ref tips (e.g, because it has "clone --shared" children) - that the refs are stored in a format besides the usual "refs" and "packed-refs" directories Because we bump to format "1", and because format "1" requires that a running git knows about any extensions mentioned, we know that older versions of the code will not do something dangerous when confronted with these new formats. For example, if the user chooses to use database storage for refs, they may set the "extensions.refbackend" config to "db". Older versions of git will not understand format "1" and bail. Versions of git which understand "1" but do not know about "refbackend", or which know about "refbackend" but not about the "db" backend, will refuse to run. This is annoying, of course, but much better than the alternative of claiming that there are no refs in the repository, or writing to a location that other implementations will not read. Note that we are only defining the rules for format 1 here. We do not ever write format 1 ourselves; it is a tool that is meant to be used by users and future extensions to provide safety with older implementations. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'dt/t7063-fix-flaky-test'Junio C Hamano2015-10-261-1/+3
|\ \ \ | | | | | | | | | | | | | | | | * dt/t7063-fix-flaky-test: t7063: fix flaky untracked-cache test
| * | | t7063: fix flaky untracked-cache testdt/t7063-fix-flaky-testDavid Turner2015-10-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dirty the test worktree's root directory, as the test expects. When testing the untracked-cache, we previously assumed that checking out master would be sufficient to mark the mtime of the worktree's root directory as racily-dirty. But sometimes, the checkout would happen at 12345.999 seconds and the status at 12346.001 seconds, meaning that the worktree's root directory would not be racily-dirty. And since it was not truly dirty, occasionally the test would fail. By making the root truly dirty, the test will always succeed. Tested by running a few hundred times. Signed-off-by: David Turner <dturner@twopensource.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'kn/for-each-tag'Junio C Hamano2015-10-261-0/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent update to "git tag --contains" caused a performance regression. * kn/for-each-tag: tag.c: use the correct algorithm for the '--contains' option
| * | | | tag.c: use the correct algorithm for the '--contains' optionkn/for-each-tagKarthik Nayak2015-10-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In b7cc53e9 (tag.c: use 'ref-filter' APIs, 2015-09-11) we port tag.c to use the ref-filter APIs for filtering and printing refs. In ref-filter we have two implementations for filtering refs when the '--contains' option is used. Although they do the same thing, one is optimized for filtering branches and the other for tags (borrowed from branch.c and tag.c respectively) and the 'filter->with_commit_tag_algo' bit decides which algorithm must be used. We should unify these. When we ported tag.c to use ref-filter APIs we missed out on setting the 'filter->with_commit_tag_algo' bit. As reported by Jerry Snitselaar, this causes "git tag --contains" to work way slower than expected, fix this by setting 'filter->with_commit_tag_algo' in tag.c before calling 'filter_refs()'. Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Tested-by: Jerry Snitselaar <jsnitsel@redhat.com> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'es/worktree-add'Junio C Hamano2015-10-261-1/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * es/worktree-add: worktree: usage: denote <branch> as optional with 'add'
| * | | | | worktree: usage: denote <branch> as optional with 'add'es/worktree-addSidhant Sharma2015-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although 1eb07d8 (worktree: add: auto-vivify new branch when <branch> is omitted, 2015-07-06) updated the documentation when <branch> became optional, it neglected to update the in-code usage message. Fix this oversight. Reported-by: ch3cooli@gmail.com Signed-off-by: Sidhant Sharma <tigerkid001@gmail.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'tk/stripspace'Junio C Hamano2015-10-269-103/+118
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal stripspace() function has been moved to where it logically belongs to, i.e. strbuf API, and the command line parser of "git stripspace" has been updated to use the parse_options API. * tk/stripspace: stripspace: use parse-options for command-line parsing strbuf: make stripspace() part of strbuf
| * | | | | | stripspace: use parse-options for command-line parsingtk/stripspaceTobias Klauser2015-10-161-26/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use parse-options to parse command-line options instead of a hand-crafted implementation. The users can now use a unique prefix of the long option to say e.g. "git stripspace --strip". Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | strbuf: make stripspace() part of strbufTobias Klauser2015-10-169-78/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is also used in other builtins than stripspace, so it makes sense to have it in a more generic place. Since it operates on an strbuf and the function is declared in strbuf.h, move it to strbuf.c and add the corresponding prefix to its name, just like other API functions in the strbuf_* family. Also switch all current users of stripspace() to the new function name and keep a temporary wrapper inline function for any topic branches still using stripspace(). Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'rt/placeholder-in-usage'Junio C Hamano2015-10-262-3/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of commands still showed "[options]" in their usage string to note where options should come on their command line, but we spell that "[<options>]" in most places these days. * rt/placeholder-in-usage: am, credential-cache: add angle brackets to usage string
| * | | | | | | am, credential-cache: add angle brackets to usage stringrt/placeholder-in-usageRalf Thielow2015-10-162-3/+3
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'jc/usage-stdin'Junio C Hamano2015-10-2625-41/+64
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The synopsis text and the usage string of subcommands that read list of things from the standard input are often shown as if they only take input from a file on a filesystem, which was misleading. * jc/usage-stdin: usage: do not insist that standard input must come from a file
| * | | | | | | usage: do not insist that standard input must come from a filejc/usage-stdinJunio C Hamano2015-10-1625-41/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The synopsys text and the usage string of subcommands that read list of things from the standard input are often shown like this: git gostak [--distim] < <list-of-doshes> This is problematic in a number of ways: * The way to use these commands is more often to feed them the output from another command, not feed them from a file. * Manual pages outside Git, commands that operate on the data read from the standard input, e.g "sort", "grep", "sed", etc., are not described with such a "< redirection-from-file" in their synopsys text. Our doing so introduces inconsistency. * We do not insist on where the output should go, by saying git gostak [--distim] < <list-of-doshes> > <output> * As it is our convention to enclose placeholders inside <braket>, the redirection operator followed by a placeholder filename becomes very hard to read, both in the documentation and in the help text. Let's clean them all up, after making sure that the documentation clearly describes the modes that take information from the standard input and what kind of things are expected on the input. [jc: stole example for fmt-merge-msg from Jonathan] Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'mr/worktree-list'Junio C Hamano2015-10-269-88/+485
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the "list" subcommand to "git worktree". * mr/worktree-list: worktree: add 'list' command worktree: add details to the worktree struct worktree: add a function to get worktree details worktree: refactor find_linked_symref function worktree: add top-level worktree.c
| * | | | | | | | worktree: add 'list' commandmr/worktree-listMichael Rappazzo2015-10-083-1/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'git worktree list' iterates through the worktree list, and outputs details of the worktree including the path to the worktree, the currently checked out revision and branch, and if the work tree is bare. There is also porcelain format option available. Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | worktree: add details to the worktree structMichael Rappazzo2015-10-082-11/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to the absolute path in the worktree struct, add the location of the git dir, the head ref (if not detached), the head revision sha1, whether or not head is detached, and whether or not the worktree is a bare repo. Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | worktree: add a function to get worktree detailsMichael Rappazzo2015-10-082-46/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The worktree structure provided for an individual worktree includes the absolute path of the worktree. The fuction to get the worktree details is a refactor of the find main/linked symref functions. Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | worktree: refactor find_linked_symref functionMichael Rappazzo2015-10-081-27/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring will help transition this code to provide additional useful worktree functions. Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | worktree: add top-level worktree.cMichael Rappazzo2015-10-026-87/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | worktree.c contains functions to work with and get information from worktrees. This introduction moves functions related to worktrees from branch.c into worktree.c Signed-off-by: Michael Rappazzo <rappazzo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Merge branch 'jc/am-3-fallback-regression-fix'Junio C Hamano2015-10-261-16/+33
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git am -3" had a small regression where it is aborted in its error handling codepath when underlying merge-recursive failed in certain ways, as it assumed that the internal call to merge-recursive will never die, which is not the case (yet). * jc/am-3-fallback-regression-fix: am -3: do not let failed merge from completing the error codepath
| * | | | | | | | | am -3: do not let failed merge from completing the error codepathjc/am-3-fallback-regression-fixJunio C Hamano2015-10-091-16/+33
| | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When "am" was rewritten in C, the codepath for falling back to three-way merge was mistakenly made to make an internal call to merge-recursive, disabling the error reporting code for certain types of errors merge-recursive detects and reports by calling die(). This is a quick-fix for correctness. The ideal endgame would be to replace run_command() in run_fallback_merge_recursive() with a direct call after making sure that internal call to merge-recursive does not die(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | Sync with maintJunio C Hamano2015-10-200-0/+0
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint:
| * \ \ \ \ \ \ \ \ Merge branch 'js/gc-with-stale-symref' into maintJunio C Hamano2015-10-202-1/+20
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git gc" used to barf when a symbolic ref has gone dangling (e.g. the branch that used to be your upstream's default when you cloned from it is now gone, and you did "fetch --prune"). * js/gc-with-stale-symref: pack-objects: do not get distracted by broken symrefs gc: demonstrate failure with stale remote HEAD