summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-10Merge branch 'jk/oi-delta-base'Libravatar Junio C Hamano5-3/+103
Teach "cat-file --batch" to show delta-base object name for a packed object that is represented as a delta. * jk/oi-delta-base: cat-file: provide %(deltabase) batch format sha1_object_info_extended: provide delta base sha1s
2014-01-10Merge branch 'jk/sha1write-void'Libravatar Junio C Hamano4-7/+3
Code clean-up. * jk/sha1write-void: do not pretend sha1write returns errors
2014-01-10Merge branch 'nd/add-empty-fix'Libravatar Junio C Hamano2-1/+20
"git add -A" (no other arguments) in a totally empty working tree used to emit an error. * nd/add-empty-fix: add: don't complain when adding empty project root
2014-01-10Merge branch 'nd/daemon-informative-errors-typofix'Libravatar Junio C Hamano1-2/+2
* nd/daemon-informative-errors-typofix: daemon: be strict at parsing parameters --[no-]informative-errors
2014-01-10Merge branch 'tm/fetch-prune'Libravatar Junio C Hamano2-10/+58
Fetching 'frotz' branch with "git fetch", while having 'frotz/nitfol' remote-tracking branch from an earlier fetch, would error out, primarily because the command has not been told to remove anything on our side. In such a case, "git fetch --prune" can be used to remove 'frotz/nitfol' to make room to fetch and store 'frotz' remote-tracking branch. * tm/fetch-prune: fetch --prune: Run prune before fetching fetch --prune: always print header url
2014-01-10Merge branch 'sb/diff-orderfile-config'Libravatar Junio C Hamano5-15/+125
Allow "git diff -O<file>" to be configured with a new configuration variable. * sb/diff-orderfile-config: diff: add diff.orderfile configuration variable diff: let "git diff -O" read orderfile from any file and fail properly t4056: add new tests for "git diff -O"
2014-01-10Merge branch 'bc/log-decoration'Libravatar Junio C Hamano2-0/+17
"git log --decorate" did not handle a tag pointed by another tag nicely. * bc/log-decoration: log: properly handle decorations with chained tags
2014-01-10Merge branch 'jh/rlimit-nofile-fallback'Libravatar Junio C Hamano1-7/+30
When we figure out how many file descriptors to allocate for keeping packfiles open, a system with non-working getrlimit() could cause us to die(), but because we make this call only to get a rough estimate of how many is available and we do not even attempt to use up all file descriptors available ourselves, it is nicer to fall back to a reasonable low value rather than dying. * jh/rlimit-nofile-fallback: get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure
2014-01-10Merge branch 'rt/bfg-ad-in-filter-branch-doc'Libravatar Junio C Hamano1-1/+32
* rt/bfg-ad-in-filter-branch-doc: docs: add filter-branch notes on The BFG
2014-01-10Merge branch 'mh/path-max'Libravatar Junio C Hamano2-31/+45
A few places where we relied on a fixed length buffer to hold pathnames in these two programs have been converted to use strbuf. * mh/path-max: builtin/prune.c: use strbuf to avoid having to worry about PATH_MAX prune-packed: use strbuf to avoid having to worry about PATH_MAX
2014-01-10Merge branch 'ap/path-max'Libravatar Junio C Hamano3-36/+42
* ap/path-max: Prevent buffer overflows when path is too long
2014-01-10Merge branch 'cc/replace-object-info'Libravatar Junio C Hamano8-26/+141
read_sha1_file() that is the workhorse to read the contents given an object name honoured object replacements, but there is no corresponding mechanism to sha1_object_info() that is used to obtain the metainfo (e.g. type & size) about the object, leading callers to weird inconsistencies. * cc/replace-object-info: replace info: rename 'full' to 'long' and clarify in-code symbols Documentation/git-replace: describe --format option builtin/replace: unset read_replace_refs t6050: add tests for listing with --format builtin/replace: teach listing using short, medium or full formats sha1_file: perform object replacement in sha1_object_info_extended() t6050: show that git cat-file --batch fails with replace objects sha1_object_info_extended(): add an "unsigned flags" parameter sha1_file.c: add lookup_replace_object_extended() to pass flags replace_object: don't check read_replace_refs twice rename READ_SHA1_FILE_REPLACE flag to LOOKUP_REPLACE_OBJECT
2014-01-10Merge branch 'nd/negative-pathspec'Libravatar Junio C Hamano7-40/+354
Introduce "negative pathspec" magic, to allow "git log -- . ':!dir'" to tell us "I am interested in everything but 'dir' directory". * nd/negative-pathspec: pathspec.c: support adding prefix magic to a pathspec with mnemonic magic Support pathspec magic :(exclude) and its short form :! glossary-content.txt: rephrase magic signature part
2014-01-06Merge branch 'maint'Libravatar Junio C Hamano2-8/+10
* maint: Documentation/gitmodules: Only 'update' and 'url' are required l10n: de.po: fix translation of 'prefix'
2014-01-06Merge branch 'maint' of git://github.com/git-l10n/git-po into maintLibravatar Junio C Hamano1-8/+8
* 'maint' of git://github.com/git-l10n/git-po: l10n: de.po: fix translation of 'prefix'
2014-01-06Documentation/gitmodules: Only 'update' and 'url' are requiredLibravatar W. Trevor King1-0/+2
Descriptions for all the settings fell under the initial "Each submodule section also contains the following required keys:". The example shows sections with just 'path' and 'url' entries, which are indeed required, but we should still make the required/optional distinction explicit to clarify that the rest of them are optional. Signed-off-by: W. Trevor King <wking@tremily.us> Reviewed-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-03fetch --prune: Run prune before fetchingLibravatar Tom Miller2-5/+19
When we have a remote-tracking branch named "frotz/nitfol" from a previous fetch, and the upstream now has a branch named "frotz", fetch would fail to remove "frotz/nitfol" with a "git fetch --prune" from the upstream. git would inform the user to use "git remote prune" to fix the problem. Change the way "fetch --prune" works by moving the pruning operation before the fetching operation. This way, instead of warning the user of a conflict, it autmatically fixes it. Signed-off-by: Tom Miller <jackerran@gmail.com> Tested-by: Thomas Rast <tr@thomasrast.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-03fetch --prune: always print header urlLibravatar Tom Miller2-5/+39
If "fetch --prune" is run with no new refs to fetch, but it has refs to prune. Then, the header url is not printed as it would if there were new refs to fetch. Output before this patch: $ git fetch --prune remote-with-no-new-refs x [deleted] (none) -> origin/world Output after this patch: $ git fetch --prune remote-with-no-new-refs From https://github.com/git/git x [deleted] (none) -> origin/test Signed-off-by: Tom Miller <jackerran@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-03l10n: de.po: fix translation of 'prefix'Libravatar Ralf Thielow1-8/+8
The word 'prefix' is currently translated as 'Prefix' which is not a German word. It should be translated as 'Präfix'. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2013-12-30replace info: rename 'full' to 'long' and clarify in-code symbolsLibravatar Christian Couder3-14/+18
Enum names SHORT/MEDIUM/FULL were too broad to be descriptive. And they clashed with built-in symbols on platforms like Windows. Clarify by giving them REPLACE_FORMAT_ prefix. Rename 'full' format in "git replace --format=<name>" to 'long', to match others (i.e. 'short' and 'medium'). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-30Merge branch 'maint'Libravatar Junio C Hamano1-2/+1
* maint: for-each-ref: remove unused variable
2013-12-30for-each-ref: remove unused variableLibravatar Ramkumar Ramachandra1-2/+1
No code ever used this symbol since the command was introduced at 9f613ddd (Add git-for-each-ref: helper for language bindings, 2006-09-15). Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-27Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano1-2/+8
* git://git.bogomips.org/git-svn: git-svn: workaround for a bug in svn serf backend
2013-12-27Merge branch 'fc/remote-helper-fixes'Libravatar Junio C Hamano3-9/+103
* fc/remote-helper-fixes: remote-hg: test 'shared_path' in a moved clone remote-hg: add tests for special filenames remote-hg: fix 'shared path' path remote-helpers: add extra safety checks remote-hg: avoid buggy strftime()
2013-12-27Merge branch 'js/gnome-keyring'Libravatar Junio C Hamano1-46/+39
Style fix. * js/gnome-keyring: contrib/git-credential-gnome-keyring.c: small stylistic cleanups
2013-12-27Merge branch 'jk/name-pack-after-byte-representation'Libravatar Junio C Hamano6-16/+9
Two packfiles that contain the same set of objects have traditionally been named identically, but that made repacking a repository that is already fully packed without any cruft with a different packing parameter cumbersome. Update the convention to name the packfile after the bytestream representation of the data, not after the set of objects in it. * jk/name-pack-after-byte-representation: pack-objects doc: treat output filename as opaque pack-objects: name pack files after trailer hash sha1write: make buffer const-correct
2013-12-27Merge branch 'tg/diff-no-index-refactor'Libravatar Junio C Hamano5-49/+103
"git diff ../else/where/A ../else/where/B" when ../else/where is clearly outside the repository, and "git diff --no-index A B", do not have to look at the index at all, but we used to read the index unconditionally. * tg/diff-no-index-refactor: diff: avoid some nesting diff: add test for --no-index executed outside repo diff: don't read index when --no-index is given diff: move no-index detection to builtin/diff.c
2013-12-27Merge branch 'zk/difftool-counts'Libravatar Junio C Hamano5-4/+43
Show the total number of paths and the number of paths shown so far when "git difftool" prompts to launch an external diff tool, which would give users some sense of progress. * zk/difftool-counts: diff.c: fix some recent whitespace style violations difftool: display the number of files in the diff queue in the prompt
2013-12-27Merge branch 'jk/cat-file-regression-fix'Libravatar Junio C Hamano2-10/+42
"git cat-file --batch=", an admittedly useless command, did not behave very well. * jk/cat-file-regression-fix: cat-file: handle --batch format with missing type/size cat-file: pass expand_data to print_object_or_die
2013-12-27Merge branch 'jk/pull-rebase-using-fork-point'Libravatar Junio C Hamano4-11/+34
* jk/pull-rebase-using-fork-point: rebase: use reflog to find common base with upstream pull: use merge-base --fork-point when appropriate
2013-12-27Merge branch 'jk/rev-parse-double-dashes'Libravatar Junio C Hamano2-1/+39
"git rev-parse <revs> -- <paths>" did not implement the usual disambiguation rules the commands in the "git log" family used in the same way. * jk/rev-parse-double-dashes: rev-parse: be more careful with munging arguments rev-parse: correctly diagnose revision errors before "--"
2013-12-27Merge branch 'jc/push-refmap'Libravatar Junio C Hamano5-28/+150
Make "git push origin master" update the same ref that would be updated by our 'master' when "git push origin" (no refspecs) is run while the 'master' branch is checked out, which makes "git push" more symmetric to "git fetch" and more usable for the triangular workflow. * jc/push-refmap: push: also use "upstream" mapping when pushing a single ref push: use remote.$name.push as a refmap builtin/push.c: use strbuf instead of manual allocation
2013-12-27git-svn: workaround for a bug in svn serf backendLibravatar Roman Kagan1-2/+8
Subversion serf backend in versions 1.8.5 and below has a bug(*) that the function creating the descriptor of a file change -- add_file() -- doesn't make a copy of its third argument when storing it on the returned descriptor. As a result, by the time this field is used (in transactions of file copying or renaming) it may well be released, and the memory reused. One of its possible manifestations is the svn assertion triggering on an invalid path, with a message svn_fspath__skip_ancestor: Assertion `svn_fspath__is_canonical(child_fspath)' failed. This patch works around this bug, by storing the value to be passed as the third argument to add_file() in a local variable with the same scope as the file change descriptor, making sure their lifetime is the same. * [ew: fixed in Subversion r1553376 as noted by Jonathan Nieder] Cc: Benjamin Pabst <benjamin.pabst85@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Roman Kagan <rkagan@mail.ru>
2013-12-26cat-file: provide %(deltabase) batch formatLibravatar Jeff King3-3/+49
It can be useful for debugging or analysis to see which objects are stored as delta bases on top of others. This information is available by running `git verify-pack`, but that is extremely expensive (and is harder than necessary to parse). Instead, let's make it available as a cat-file query format, which makes it fast and simple to get the bases for a subset of the objects. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-26sha1_object_info_extended: provide delta base sha1sLibravatar Jeff King2-0/+54
A caller of sha1_object_info_extended technically has enough information to determine the base sha1 from the results of the call. It knows the pack, offset, and delta type of the object, which is sufficient to find the base. However, the functions to do so are not publicly available, and the code itself is intimate enough with the pack details that it should be abstracted away. We could add a public helper to allow callers to query the delta base separately, but it is simpler and slightly more efficient to optionally grab it along with the rest of the object_info data. For cases where the object is not stored as a delta, we write the null sha1 into the query field. A careful caller could check "oi.whence == OI_PACKED && oi.u.packed.is_delta" before looking at the base sha1, but using the null sha1 provides a simple alternative (and gives a better sanity check for a non-careful caller than simply returning random bytes). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-26do not pretend sha1write returns errorsLibravatar Jeff King4-7/+3
The sha1write function returns an int, but it will always be "0". The failure-prone parts of the function happen in the "flush" callback, which cannot pass an error back to us. So we just end up calling die() during the flush. Let's just drop the return value altogether, as it only confuses callers into thinking that it might be useful. Only one call site actually checked the return value. We can drop that check, since it just led to a die() anyway. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-26add: don't complain when adding empty project rootLibravatar Nguyễn Thái Ngọc Duy2-1/+20
This behavior was added in 07d7bed (add: don't complain when adding empty project root - 2009-04-28) then broken by 84b8b5d (remove match_pathspec() in favor of match_pathspec_depth() - 2013-07-14). Reinstate it. Noticed-by: Thomas Ferris Nicolaisen <tfnico@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-26remote-hg: test 'shared_path' in a moved cloneLibravatar Antoine Pelisse1-0/+11
Since e71d1378 (remote-hg: fix 'shared path' path, 2013-12-07), Mercurial 'shared_path' file is correctly updated whenever a clone is moved. Make sure it keeps working, especially as this is depending on a private Mercurial file. Signed-off-by: Antoine Pelisse <apelisse@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-20log: properly handle decorations with chained tagsLibravatar brian m. carlson2-0/+17
git log did not correctly handle decorations when a tag object referenced another tag object that was no longer a ref, such as when the second tag was deleted. The commit would not be decorated correctly because parse_object had not been called on the second tag and therefore its tagged field had not been filled in, resulting in none of the tags being associated with the relevant commit. Call parse_object to fill in this field if it is absent so that the chain of tags can be dereferenced and the commit can be properly decorated. Include tests as well to prevent future regressions. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-20daemon: be strict at parsing parameters --[no-]informative-errorsLibravatar Nguyễn Thái Ngọc Duy1-2/+2
Use strcmp() instead of starts_with()/!prefixcmp() to stop accepting --informative-errors-just-a-little Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18diff: add diff.orderfile configuration variableLibravatar Samuel Bronson4-0/+23
diff.orderfile acts as a default for the -O command line option. [sb: split up aw's original patch; rework tests and docs, treat option as pathname] Signed-off-by: Anders Waldenborg <anders@0x63.nu> Signed-off-by: Samuel Bronson <naesten@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18diff: let "git diff -O" read orderfile from any file and fail properlyLibravatar Samuel Bronson2-15/+34
The -O flag really shouldn't silently fail to do anything when given a path that it can't read from. However, it should be able to read from un-mmappable files, such as: * pipes/fifos * /dev/null: It's a character device (at least on Linux) * ANY empty file: Quoting Linux mmap(2), "SUSv3 specifies that mmap() should fail if length is 0. However, in kernels before 2.6.12, mmap() succeeded in this case: no mapping was created and the call returned addr. Since kernel 2.6.12, mmap() fails with the error EINVAL for this case." We especially want "-O/dev/null" to work, since we will be documenting it as the way to cancel "diff.orderfile" when we add that. (Note: "-O/dev/null" did have the right effect, since the existing error handling essentially worked out to "silently ignore the orderfile". But this was probably more coincidence than anything else.) So, lets toss all of that logic to get the file mmapped and just use strbuf_read_file() instead, which gives us decent error handling practically for free. Signed-off-by: Samuel Bronson <naesten@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18t4056: add new tests for "git diff -O"Libravatar Samuel Bronson1-0/+68
Adapted from $gmane/236427 by Anders Waldenborg, "diff: Add diff.orderfile configuration variable". Signed-off-by: Anders Waldenborg <anders@0x63.nu> Signed-off-by: Samuel Bronson <naesten@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18builtin/prune.c: use strbuf to avoid having to worry about PATH_MAXLibravatar Jeff King1-14/+24
While at it, rename prune_tmp_object(), which used to be a helper to remove temporary files that were created to become loose object files, to prune_tmp_file(), as the function is also used to remove any random cruft whose name begins with tmp_ directly in .git/object or .git/object/pack directories these days. Noticed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failureLibravatar Junio C Hamano1-7/+30
On broken systems where RLIMIT_NOFILE is visible by the compliers but underlying getrlimit() system call does not behave, we used to simply die() when we are trying to decide how many file descriptors to allocate for keeping packfiles open. Instead, allow the fallback codepath to take over when we get such a failure from getrlimit(). The same issue exists with _SC_OPEN_MAX and sysconf(); restructure the code in a similar way to prepare for a broken sysconf() as well. Noticed-by: Joey Hess <joey@kitenet.net> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-18docs: add filter-branch notes on The BFGLibravatar Roberto Tyley1-1/+32
The BFG is a tool specifically designed for the task of removing unwanted data from Git repository history - a common use-case for which git-filter-branch has been the traditional workhorse. It's beneficial to let users know that filter-branch has an alternative here: * speed : The BFG is 10-50x faster http://rtyley.github.io/bfg-repo-cleaner/#speed * complexity of configuration : filter-branch is a very flexible tool, but demands very careful usage in order to get the desired results http://rtyley.github.io/bfg-repo-cleaner/#examples Obviously, filter-branch has it's advantages too - it permits very complex rewrites, and doesn't require a JVM - but for the common use-case of deleting unwanted data, it's helpful to users to be aware that an alternative exists. The BFG was released under the GPL in February 2013, and has since seen widespread production use (The Guardian, RedHat, Google, UK Government Digital Service), been tested against large repos (~300K commits, ~5GB packfiles) and received significant positive feedback from users: http://rtyley.github.io/bfg-repo-cleaner/#feedback Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-17Sync with 1.8.5.2Libravatar Junio C Hamano3-5/+24
* maint: Git 1.8.5.2 cmd_repack(): remove redundant local variable "nr_packs"
2013-12-17Update draft release notes to 1.9Libravatar Junio C Hamano1-0/+37
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-17Merge branch 'kn/gitweb-extra-branch-refs'Libravatar Junio C Hamano2-46/+175
Allow gitweb to be configured to show refs out of refs/heads/ as if they were branches. * kn/gitweb-extra-branch-refs: gitweb: Denote non-heads, non-remotes branches gitweb: Add a feature for adding more branch refs gitweb: Return 1 on validation success instead of passed input gitweb: Move check-ref-format code into separate function
2013-12-17Merge branch 'tb/clone-ssh-with-colon-for-port'Libravatar Junio C Hamano7-147/+350
Be more careful when parsing remote repository URL given in the scp-style host:path notation. * tb/clone-ssh-with-colon-for-port: git_connect(): use common return point connect.c: refactor url parsing git_connect(): refactor the port handling for ssh git fetch: support host:/~repo t5500: add test cases for diag-url git fetch-pack: add --diag-url git_connect: factor out discovery of the protocol and its parts git_connect: remove artificial limit of a remote command t5601: add tests for ssh t5601: remove clear_ssh, refactor setup_ssh_wrapper