summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-22Merge branch 'tr/maint-show-walk' into maintLibravatar Junio C Hamano2-0/+94
"git show"'s auto-walking behaviour was an unreliable and unpredictable hack; it now behaves just like "git log" does when it walks. * tr/maint-show-walk: show: fix "range implies walking" Demonstrate git-show is broken with ranges
2012-07-22Merge branch 'jc/refactor-diff-stdin' into maintLibravatar Junio C Hamano4-50/+67
"git diff", "git status" and anything that internally uses the comparison machinery was utterly broken when the difference involved a file with "-" as its name. This was due to the way "git diff --no-index" was incorrectly bolted on to the system, making any comparison that involves a file "-" at the root level incorrectly read from the standard input. * jc/refactor-diff-stdin: diff-index.c: "git diff" has no need to read blob from the standard input diff-index.c: unify handling of command line paths diff-index.c: do not pretend paths are pathspecs
2012-07-22Merge branch 'mz/empty-rebase-test' into maintLibravatar Junio C Hamano1-0/+8
We did not have test to make sure "git rebase" without extra options filters out an empty commit in the original history. * mz/empty-rebase-test: add test case for rebase of empty commit
2012-07-22Merge branch 'js/fast-export-paths-with-spaces' into maintLibravatar Junio C Hamano2-1/+3
"git fast-export" produced an input stream for fast-import without properly quoting pathnames when they contain SPs in them. * js/fast-export-paths-with-spaces: fast-export: quote paths with spaces
2012-07-22Merge branch 'cw/no-detaching-an-unborn' into maintLibravatar Junio C Hamano2-0/+8
"git checkout --detach", when you are still on an unborn branch, should be forbidden, but it wasn't. * cw/no-detaching-an-unborn: git-checkout: disallow --detach on unborn branch
2012-07-22Merge branch 'vr/use-our-perl-in-tests' into maintLibravatar Junio C Hamano26-44/+65
Some implementations of Perl terminates "lines" with CRLF even when the script is operating on just a sequence of bytes. Make sure to use "$PERL_PATH", the version of Perl the user told Git to use, in our tests to avoid unnecessary breakages in tests. * vr/use-our-perl-in-tests: t/README: add a bit more Don'ts tests: enclose $PERL_PATH in double quotes t/test-lib.sh: export PERL_PATH for use in scripts t: Replace 'perl' by $PERL_PATH
2012-07-11Git 1.7.11.2Libravatar Junio C Hamano4-3/+57
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-11Merge branch 'jc/maint-blame-unique-abbrev' into maintLibravatar Junio C Hamano1-4/+21
"git blame" did not try to make sure that the abbreviated commit object names in its output are unique. * jc/maint-blame-unique-abbrev: blame: compute abbreviation width that ensures uniqueness
2012-07-11Merge branch 'rj/platform-pread-may-be-thread-unsafe' into maintLibravatar Junio C Hamano2-2/+10
On Cygwin, the platform pread(2) is not thread safe, just like our own compat/ emulation, and cannot be used in the index-pack program. Makefile variable NO_THREAD_SAFE_PREAD can be defined to avoid use of this function in a threaded program. * rj/platform-pread-may-be-thread-unsafe: index-pack: Disable threading on cygwin
2012-07-11Merge branch 'th/diff-no-index-fixes' into maintLibravatar Junio C Hamano5-24/+112
"git diff --no-index" did not correctly handle relative paths and did not correctly give exit codes when run under "--quiet" option. * th/diff-no-index-fixes: diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes diff: handle relative paths in no-index
2012-07-11Merge branch 'nd/clone-single-fix' into maintLibravatar Junio C Hamano2-3/+11
"git clone --single-branch" to clone a single branch did not limit the cloning to the specified branch. * nd/clone-single-fix: clone: fix ref selection in --single-branch --branch=xxx
2012-07-11Merge branch 'jc/rev-list-simplify-merges-first-parent' into maintLibravatar Junio C Hamano1-12/+29
When "git log" gets "--simplify-merges/by-decoration" together with "--first-parent", the combination of these options makes the simplification logic to use in-core commit objects that haven't been examined for relevance, either producing incorrect result or taking too long to produce any output. Teach the simplification logic to ignore commits that the first-parent traversal logic ignored when both are in effect to work around the issue. * jc/rev-list-simplify-merges-first-parent: revision: ignore side parents while running simplify-merges revision: note the lack of free() in simplify_merges() revision: "simplify" options imply topo-order sort
2012-07-11Merge branch 'hv/submodule-update-nuke-submodules' into maintLibravatar Junio C Hamano1-6/+0
"git add" allows adding a regular file to the path where a submodule used to exist, but "git update-index" did not allow an equivalent operation to Porcelain writers. * hv/submodule-update-nuke-submodules: update-index: allow overwriting existing submodule index entries
2012-07-11Merge branch 'jk/diff-no-index-pager' into maintLibravatar Junio C Hamano3-15/+22
"git diff --no-index" did not work with pagers correctly. * jk/diff-no-index-pager: do not run pager with diff --no-index --quiet fix pager.diff with diff --no-index
2012-07-11Merge branch 'mm/verify-filename-fix' into maintLibravatar Junio C Hamano8-10/+44
"git diff COPYING HEAD:COPYING" gave a nonsense error message that claimed that the treeish HEAD did not have COPYING in it. * mm/verify-filename-fix: verify_filename(): ask the caller to chose the kind of diagnosis sha1_name: do not trigger detailed diagnosis for file arguments
2012-07-11Merge branch 'cn/cherry-pick-range-docs' into maintLibravatar Junio C Hamano2-1/+13
The documentation for "git cherry-pick A B..C" was misleading. * cn/cherry-pick-range-docs: git-cherry-pick.txt: clarify the use of revision range notation Documentation: --no-walk is no-op if range is specified
2012-07-11Merge branch 'jc/ustar-checksum-is-unsigned' into maintLibravatar Junio C Hamano1-3/+3
"git archive" incorrectly computed the header checksum; the symptom was observed only when using pathnames with hi-bit set. * jc/ustar-checksum-is-unsigned: archive: ustar header checksum is computed unsigned
2012-07-11Merge branch 'jc/bundle-complete-notice' into maintLibravatar Junio C Hamano1-6/+10
Running "git bundle verify" on a bundle that records a complete history said "it requires these 0 commits". * jc/bundle-complete-notice: tweak "bundle verify" of a complete history
2012-07-11Merge branch 'jc/ls-files-i-dir' into maintLibravatar Junio C Hamano6-10/+109
"git ls-files --exclude=t -i" did not consider anything under t/ as excluded, as it did not pay attention to exclusion of leading paths while walking the index. Other two users of excluded() are also updated. * jc/ls-files-i-dir: dir.c: make excluded() file scope static unpack-trees.c: use path_excluded() in check_ok_to_remove() builtin/add.c: use path_excluded() path_excluded(): update API to less cache-entry centric ls-files -i: micro-optimize path_excluded() ls-files -i: pay attention to exclusion of leading paths
2012-07-11Merge branch 'jc/request-pull-match-tagname' into maintLibravatar Junio C Hamano1-7/+22
"git request-pull $url dev" when the tip of "dev" branch was tagged with "ext4-for-linus" used the contents from the tag in the output but still asked the "dev" branch to be pulled, not the tag. * jc/request-pull-match-tagname: request-pull: really favor a matching tag
2012-07-02Merge branch 'maint' of git://github.com/git-l10n/git-po into maintLibravatar Junio C Hamano1-562/+2270
Update Swedish translation (1066t0f0u)
2012-07-02blame: compute abbreviation width that ensures uniquenessLibravatar Junio C Hamano1-4/+21
Julia Lawall noticed that in linux-next repository the commit object 60d5c9f5 (shown with the default abbreviation width baked into "git blame") in output from $ git blame -L 3675,3675 60d5c9f5b -- \ drivers/staging/brcm80211/brcmfmac/wl_iw.c is no longer unique in the repository, which results in "short SHA1 60d5c9f5 is ambiguous". Compute the minimum abbreviation width that ensures uniqueness when the user did not specify the --abbrev option to avoid this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-01Update Swedish translation (1066t0f0u)Libravatar Peter Krefting1-562/+2270
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2012-06-28diff-index.c: "git diff" has no need to read blob from the standard inputLibravatar Junio C Hamano4-31/+55
Only "diff --no-index -" does. Bolting the logic into the low-level function diff_populate_filespec() was a layering violation from day one. Move populate_from_stdin() function out of the generic diff.c to its only user, diff-index.c. Also make sure "-" from the command line stays a special token "read from the standard input", even if we later decide to sanitize the result from prefix_filename() function in a few obvious ways, e.g. removing unnecessary "./" prefix, duplicated slashes "//" in the middle, etc. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-28diff-index.c: unify handling of command line pathsLibravatar Junio C Hamano1-16/+11
Regardless of where in the directory hierarchy you are, "-" on the command line means the standard input. The old code knew too much about how the low level machinery uses paths to read from the working tree and did not bother to have the same check for "-" when the command is run from the top-level. Unify the codepaths for subdirectory case and toplevel case into one and make it clearer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-28diff-index.c: do not pretend paths are pathspecsLibravatar Junio C Hamano1-7/+5
"git diff --no-index" takes exactly two paths, not pathspecs, and has its own way queue_diff() to populate the diff_queue. Do not call diff_tree_setup_paths(), pretending as it takes pathspecs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-27fast-export: quote paths with spacesLibravatar Jay Soffian2-1/+3
A path containing a space must be quoted when used as an argument to either the copy or rename commands (because unlike other commands, the path is not the final thing on the line for those commands). Commit 6280dfdc3b (fast-export: quote paths in output, 2011-08-05) previously attempted to fix fast-export's quoting by passing all paths through quote_c_style(). However, that function does not consider the space to be a character which requires quoting, so let's special-case the space inside print_path(). This will cause space-containing paths to also be quoted in other commands where such quoting is not strictly necessary, but it does not hurt to do so. The test from 6280dfdc3b did not detect this because, while it does introduce renames in the export stream, it does not actually turn on rename detection, so they were presented as pairs of deletions/adds. Using "-M" reveals the bug. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-27add test case for rebase of empty commitLibravatar Martin von Zweigbergk1-0/+8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-26index-pack: Disable threading on cygwinLibravatar Junio C Hamano2-2/+10
The Cygwin implementation of pread() is not thread-safe since, just like the emulation provided by compat/pread.c, it uses a sequence of seek-read-seek calls. In order to avoid failues due to thread-safety issues, commit b038a61 disables threading when NO_PREAD is defined. (ie when using the emulation code in compat/pread.c). We introduce a new build variable, NO_THREAD_SAFE_PREAD, which allows use to disable the threaded index-pack code on cygwin, in addition to the above NO_PREAD case. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-26git-checkout: disallow --detach on unborn branchLibravatar Chris Webb2-0/+8
abe199808c (git checkout -b: allow switching out of an unborn branch) introduced a bug demonstrated by git checkout --orphan foo git checkout --detach git symbolic-ref HEAD which gives 'refs/heads/(null)'. This happens because we strbuf_addf(&branch_ref, "refs/heads/%s", opts->new_branch) when opts->new_branch can be NULL for --detach. Catch and forbid this case, adding a test to t2017 to catch it in future. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-25git-submodule.sh: fix filename in comment.Libravatar Michał Górny1-1/+1
Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-25git-add--interactive.perl: Remove two unused variablesLibravatar Thomas Badie1-2/+0
The patch 8f0bef6 refactored this script and made the variable $fh unneeded in subs diff_applies and patch_update_file, but forgot to remove them. Signed-off-by: Thomas Badie <badie@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-24t/README: add a bit more Don'tsLibravatar Junio C Hamano1-3/+22
Add a few more advices that we often have to give to new test writers. Also update an example where a double quote pair is used to enclose a test body to use a single quote pair, which is more readable and more importantly gives saner semantics for variable substitution. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-24tests: enclose $PERL_PATH in double quotesLibravatar Junio C Hamano24-41/+41
Otherwise it will be split at a space after "Program" when it is set to "\\Program Files\perl" or something silly like that. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-24t/test-lib.sh: export PERL_PATH for use in scriptsLibravatar Junio C Hamano1-0/+2
Most notably, t4031 creates a small shell script that invokes perl and we want to use "$PERL_PATH" to name the version of Perl suitable for our use, read from GIT-BUILD-OPTS. The test would fail when it is directly run in t/ directory from the shell or "make" is run in t/ directory. This problem was hidden from "make test" run in the top-level directory, because its Makefile exports PERL_PATH. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-22Documentation: Fix misspellingsLibravatar Leila Muhtasib5-6/+6
Signed-off-by: Leila Muhtasib <muhtasib@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-22clone: fix ref selection in --single-branch --branch=xxxLibravatar Nguyễn Thái Ngọc Duy2-3/+11
- do not fetch HEAD - do not also fetch refs following "xxx" Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-22diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds ↵Libravatar Tim Henigan2-2/+73
changes When running 'git diff --quiet <file1> <file2>', if file1 or file2 is outside the repository, it will exit(0) even if the files differ. It should exit(1) when they differ. This happens because 'diff_no_index' looks at the 'found_changes' member from 'diff_options' to determine if changes were made. This is the wrong thing to do, since it is only set if xdiff is actually run and it finds a change (the diff machinery will optimize out the xdiff call when it is not necessary) and in that case HAS_CHANGED flag needs to be taken into account. Use diff_result_code() that knows all these details for the correct exit value instead. Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-22diff: handle relative paths in no-indexLibravatar Jeff King4-22/+39
When diff-no-index is given a relative path to a file outside the repository, it aborts with error. However, if the file is given using an absolute path, the diff runs as expected. The two cases should be treated the same. Tests and commit message by Tim Henigan. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Tim Henigan <tim.henigan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-21Git 1.7.11.1Libravatar Junio C Hamano4-3/+13
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-20docs: always define git-relative-html-prefix attributeLibravatar Jeff King1-0/+2
Commit fe77b41 introduced a new attribute to let the linkgit macro create cross-directory HTML references from the technical/ and howto/ subdirectories back to the main documentation. We define that attribute to "../" on the command-line when building inside those subdirectories, and otherwise leave it unset under the assumption that it would default to being blank. Instead, asciidoc omits the link entirely, leading to broken documentation. Fix this by defining git-relative-html-prefix to blank in asciidoc.conf (and an instance on the command-line, when present, will override it). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-19show: fix "range implies walking"Libravatar Junio C Hamano2-2/+5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-19Demonstrate git-show is broken with rangesLibravatar Thomas Rast1-0/+91
The logic of git-show has remained largely unchanged since around 5d7eeee (git-show: grok blobs, trees and tags, too, 2006-12-14): start a revision walker with no_walk=1, look at its pending objects and handle them one-by-one. For commits, this means stuffing them into a new queue all alone, and running the walker. Then Linus's f222abd (Make 'git show' more useful, 2009-07-13) came along and set no_walk=0 whenever the user specifies a range. Which appears to work fine, until you actually prod it hard enough, as the preceding commit shows: UNINTERESTING commits will be marked as such, but not walked further to propagate the marks. Demonstrate this with the main tests of this patch: 'showing a range walks (Y shape)'. The Y shape of history ensures that propagating the UNINTERESTING marks is necessary to correctly exclude the main1 commit. The only example I could find actually requires that the negative revisions are listed later, and in this scenario a dotted range actually works. However, it is easy to find examples in git.git where a dotted range is wrong, e.g. $ git show v1.7.0..v1.7.1 | grep ^commit | wc -l 1297 $ git rev-list v1.7.0..v1.7.1 | wc -l 702 While there, also test a few other things that are not covered so far: the -N way of triggering a range (added in 5853cae, DWIM 'git show -5' to 'git show --do-walk -5', 2010-06-01), and the interactions of tags, commits and ranges. Pointed out by Dr_Memory on #git. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-19git-commit-tree(1): update synopsisLibravatar Junio C Hamano1-1/+1
Even with many new kinds of options, the command still takes the single <tree> as the first argument. Probably we would want to update the command to allow it to take <tree>-ish at the end for consistency. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-19Documentation: spelling fixesLibravatar Miklos Vajna6-6/+6
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-18verify_filename(): ask the caller to chose the kind of diagnosisLibravatar Matthieu Moy7-10/+33
verify_filename() can be called in two different contexts. Either we just tried to interpret a string as an object name, and it fails, so we try looking for a working tree file (i.e. we finished looking at revs that come earlier on the command line, and the next argument must be a pathname), or we _know_ that we are looking for a pathname, and shouldn't even try interpreting the string as an object name. For example, with this change, we get: $ git log COPYING HEAD:inexistant fatal: HEAD:inexistant: no such path in the working tree. Use '-- <path>...' to specify paths that do not exist locally. $ git log HEAD:inexistant fatal: Path 'inexistant' does not exist in 'HEAD' Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-18sha1_name: do not trigger detailed diagnosis for file argumentsLibravatar Matthieu Moy2-1/+12
diagnose_invalid_sha1_path() is meant to be called to diagnose a misspelt <treeish>:<pathname> when <pathname> does not exist in <treeish>. However, the code may call it if <treeish>:<pathname> is invalid (which triggers another call with only_to_die == 1), but for another reason. This happens when calling e.g. git log existing-file HEAD:existing-file because existing-file is a path and not a revision, the code verifies that the arguments that follow to be paths. This leads to an incorrect message like "existing-file does not exist in HEAD", even though the path exists in HEAD. Check that the search for <pathname> in <treeish> fails before triggering the diagnosis. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-17Git 1.7.11Libravatar Junio C Hamano3-10/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-06-17Sync with 1.7.10.5Libravatar Junio C Hamano2-1/+14
2012-06-17Git 1.7.10.5Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>