summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-06-02Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maintJunio C Hamano
* cb/maint-1.6.0-xdl-merge-fix: Change xdl_merge to generate output even for null merges t6023: merge-file fails to output anything for a degenerate merge Conflicts: xdiff/xmerge.c
2009-06-02Merge branch 'rs/maint-grep-word-regexp-fix' into maintJunio C Hamano
* rs/maint-grep-word-regexp-fix: grep: fix colouring of matches with zero length grep: fix word-regexp at the beginning of lines
2009-06-02Merge branch 'sb/maint-1.6.2-opt-filename-fix' into maintJunio C Hamano
* sb/maint-1.6.2-opt-filename-fix: apply, fmt-merge-msg: use relative filenames commit: -F overrides -t
2009-06-02Merge branch 'jc/maint-add-p-coalesce-fix' into maintJunio C Hamano
* jc/maint-add-p-coalesce-fix: t3701: ensure correctly set up repository after skipped tests Revert "git-add--interactive: remove hunk coalescing" Splitting a hunk that adds a line at the top fails in "add -p"
2009-06-02Merge branch 'tr/maint-doc-stash-pop' into maintJunio C Hamano
* tr/maint-doc-stash-pop: Documentation: teach stash/pop workflow instead of stash/apply
2009-06-02grep: fix colouring of matches with zero lengthRené Scharfe
If a zero-length match is encountered, break out of loop and show the rest of the line uncoloured. Otherwise we'd be looping forever, trying to make progress by advancing the pointer by zero characters. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-29Documentation: teach stash/pop workflow instead of stash/applyThomas Rast
Recent discussion on the list showed some comments in favour of a stash/pop workflow: http://marc.info/?l=git&m=124234911423358&w=2 http://marc.info/?l=git&m=124235348327711&w=2 Change the stash documentation and examples to document pop in its own right (and apply in terms of pop), and use stash/pop in the examples. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-28fix segfault showing an empty remoteClemens Buchacher
In case of an empty list, the search for its tail caused a NULL-pointer dereference. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Reported-by: Erik Faye-Lund <kusmabite@googlemail.com> Acked-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-26Prepare for 1.6.3.2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-26Merge branch 'js/maint-no-ln-across-libexec-and-bin' into maintJunio C Hamano
* js/maint-no-ln-across-libexec-and-bin: Add NO_CROSS_DIRECTORY_HARDLINKS support to the Makefile Conflicts: Makefile
2009-05-26Merge branch 'lt/maint-diff-reduce-lstat' into maintJunio C Hamano
* lt/maint-diff-reduce-lstat: Teach 'git checkout' to preload the index contents Avoid unnecessary 'lstat()' calls in 'get_stat_data()'
2009-05-26Merge branch 'jm/format-patch-no-auto-n-when-k-is-given' into maintJunio C Hamano
* jm/format-patch-no-auto-n-when-k-is-given: format-patch let -k override a config-specified format.numbered
2009-05-26Merge branch 'do/maint-merge-recursive-fix' into maintJunio C Hamano
* do/maint-merge-recursive-fix: merge-recursive: never leave index unmerged while recursing
2009-05-26Merge branch 'jk/maint-1.6.0-trace-argv' into maintJunio C Hamano
* jk/maint-1.6.0-trace-argv: fix GIT_TRACE segfault with shell-quoted aliases Conflicts: alias.c
2009-05-26Merge branch 'np/push-delta' into maintJunio C Hamano
* np/push-delta: allow OFS_DELTA objects during a push
2009-05-26Merge branch 'ar/merge-one-file-diag' into maintJunio C Hamano
* ar/merge-one-file-diag: Clarify kind of conflict in merge-one-file helper
2009-05-26Merge branch 'ar/unlink-err' into maintJunio C Hamano
* ar/unlink-err: print unlink(2) errno in copy_or_link_directory replace direct calls to unlink(2) with unlink_or_warn Introduce an unlink(2) wrapper which gives warning if unlink failed
2009-05-26Merge branch 'jk/maint-add-empty' into maintJunio C Hamano
* jk/maint-add-empty: add: don't complain when adding empty project root
2009-05-25fix cat-file usage message and documentationJeff King
cat-file with an object on the command line requires an option to tell it what to output (type, size, pretty-print, etc). However, the square brackets in the usage imply that those options are not required. This patch switches them to parentheses to indicate "required but grouped-OR" (curly braces might also work, but this follows the convention used already by "git stash"). While we're at it, let's change the <sha1> specifier in the usage to <object>. That's what the documentation uses, and it does actually use the regular object lookup. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25fetch: report ref storage DF errors more accuratelyJeff King
When we fail to store a fetched ref, we recommend that the user try running "git prune" to remove up any old refs that have been deleted by the remote, which would clear up any DF conflicts. However, ref storage might fail for other reasons (e.g., permissions problems) in which case the advice is useless and misleading. This patch detects when there is an actual DF situation and only issues the advice when one is found. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25lock_ref: inform callers of unavailable refJeff King
One of the ways that locking might fail is that there is a DF conflict between two refs (e.g., you want to lock "foo/bar" but "foo" already exists). In this case, we return an error, but there is no way for the caller to know the specific problem. This patch sets errno to ENOTDIR, which is the most sensible code. It's what we would see if the refs were stored purely in the filesystem (but these days we must check the namespace manually due to packed refs). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25t3701: ensure correctly set up repository after skipped testsJohannes Sixt
There are two tests that are skipped if file modes are not obeyed by the file system. In this case, the subsequent test failed because the repository was in an unexpected state. This corrects it. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25merge-options.txt: Clarify merge --squashMichael J Gruber
With the --squash option, merge sets up the index just like for a real merge, but without the merge info (stages). Say so. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25Change xdl_merge to generate output even for null mergesCharles Bailey
xdl_merge used to have a check to ensure that there was at least some change in one or other side being merged but this suppressed output for the degenerate case when base, local and remote contents were all identical. Removing this check enables correct output in the degenerate case and xdl_free_script handles freeing NULL scripts so there is no need to have the check for these calls. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-25t6023: merge-file fails to output anything for a degenerate mergeCharles Bailey
In the case that merge-file is passed three files with identical contents it wipes the contents of the output file instead of leaving it unchanged. Althought merge-file is porcelain and this will never happen in normal usage, it is still wrong. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-24Merge branch 'maint-1.6.2' into maintJunio C Hamano
* maint-1.6.2: http-push.c::remove_locks(): fix use after free
2009-05-24Merge branch 'maint-1.6.1' into maint-1.6.2Junio C Hamano
* maint-1.6.1: http-push.c::remove_locks(): fix use after free
2009-05-24Merge branch 'maint-1.6.0' into maint-1.6.1Junio C Hamano
* maint-1.6.0: http-push.c::remove_locks(): fix use after free
2009-05-24http-push.c::remove_locks(): fix use after freeAlex Riesen
Noticed and reported by Serhat Şevki Dinçer. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Acked-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-23grep: fix word-regexp at the beginning of linesRené Scharfe
After bol is forwarded, it doesn't represent the beginning of the line any more. This means that the beginning-of-line marker (^) mustn't match, i.e. the regex flag REG_NOTBOL needs to be set. This bug was introduced by fb62eb7fab97cea880ea7fe4f341a4dfad14ab48 ("grep -w: forward to next possible position after rejected match"). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-23apply, fmt-merge-msg: use relative filenamesStephen Boyd
Commit dbd0f5c7 (Files given on the command line are relative to $cwd, 2008-08-06) only fixed git-commit and git-tag. But, git-apply and git-fmt-merge-msg didn't get the update and exhibit the same behavior. Fix them and add tests for "apply --build-fake-ancestor" and "fmt-merge-msg -F". Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-23commit: -F overrides -tStephen Boyd
Commit dbd0f5c7 (Files given on the command line are relative to $cwd, 2008-08-06) introduced parse_options_fix_filename() as a quick fix for filename arguments used in the parse options API. git-commit was still broken. This means git commit -F log -t temp in a subdirectory would make git think the log message should be taken from temp instead of log. This is because parse_options_fix_filename() calls prefix_filename() which uses a single static char buffer to do its work. Making two calls with two char pointers causes the pointers to alias. To prevent aliasing, we duplicate the string returned by parse_options_fix_filename(). Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21grep: fix word-regexp colouringRené Scharfe
As noticed by Dmitry Gryazin: When a pattern is found but it doesn't start and end at word boundaries, bol is forwarded to after the match and the pattern is searched again. When a pattern is finally found between word boundaries, the match offsets are off by the number of characters that have been skipped. This patch corrects the offsets to be relative to the value of bol as passed to match_one_pattern() by its caller. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21completion: use git rev-parse to detect bare reposGiuseppe Bilotta
Its check is more robust than a config check for core.bare Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-21Cope better with a _lot_ of packsJohannes Schindelin
You might end up with a situation where you have tons of pack files, e.g. when using hg2git. In this situation, all kinds of operations may end up with a "too many files open" error. Let's recover gracefully from that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Looks-right-to-me-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-20for-each-ref: fix segfault in copy_emailJeff King
You can trigger a segfault in git.git by doing: git for-each-ref --format='%(taggeremail)' refs/tags/v0.99 The v0.99 tag is special in that it contains no "tagger" header. The bug is obvious in copy_email, which carefully checks to make sure the result of a strchr is non-NULL, but only after already having used it to perform other work. The fix is to move the check up. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17show-branch: Fix die message in parse_reflog_param()Stephen Boyd
Commit 76a44c5 (show-branch --reflog: show the reflog message at the top, 2007-01-19) introduced parse_reflog_param(). The die() call was incorrectly passed arg + 9, when it should have been passed arg. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17completion: add missing options to show-branch and showStephen Boyd
Add --oneline and --abbrev-commit to show and --sparse to show-branch. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17dir.c: clean up handling of 'path' parameter in read_directory_recursive()Linus Torvalds
Right now we pass two different pathnames ('path' and 'base') down to read_directory_recursive(), and the only real reason for that is that we want to allow an empty 'base' parameter, but when we do so, we need the pathname to "opendir()" to be "." rather than the empty string. And rather than handle that confusion in the caller, we can just fix read_directory_recursive() to handle the case of an empty path itself, by just passing opendir() a "." ourselves if the path is empty. This would allow us to then drop one of the pathnames entirely from the calling convention, but rather than do that, we'll start separating them out as a "filesystem pathname" (the one we use for filesystem accesses) and a "git internal base name" (which is the name that we use for git internally). That will eventually allow us to do things like handle different encodings (eg the filesystem pathnames might be Latin1, while git itself would use UTF-8 for filename information). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17Fix type-punning issuesDan McGee
In these two places we are casting part of our unsigned char sha1 array into an unsigned int, which violates GCCs strict-aliasing rules (and probably other compilers). Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17test: checkout shouldn't say that HEAD has moved if it didn'tNanako Shiraishi
Signed-off-by: しらいしななこ <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17completion: enhance "current branch" displayJunio C Hamano
Introduce GIT_PS1_DESCRIBE option you can set to "contains", "branch", or "describe" to tweak the way how a detached HEAD is described. The default behaviour is to describe only exact match with some tag (otherwise use the first 7 hexdigits) as before. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17completion: simplify "current branch" in __git_ps1()Junio C Hamano
As I very often work on a detached HEAD, I found it pretty confusing when __git_ps1() said 'some-name'. Did I create a branch with that name by mistake, or do I happen to be on a commit with that exact tag? This patch fixes the issue by enclosing non branch names in a pair of parentheses when used to substitute %s token in __git_ps1() argument. It also fixes a small bug where the branch part is left empty when .git/HEAD is unreadable for whatever reason. The output now says "(unknown)". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17completion: fix PS1 display during a merge on detached HEADJunio C Hamano
If your merge stops in a conflict while on a detached HEAD, recent completion code fails to show anything. This was because various cases added to support the operation-in-progress markers (e.g. REBASE, MERGING) forgot that they need to set the variable "b" to something for the result they computed to be displayed at all. Probably not many people make trial merges on a detached HEAD (which is tremendously useful feature of git, by the way), and that may be why this was not noticed for a long time. Acked-By: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17Revert "git-add--interactive: remove hunk coalescing"Junio C Hamano
This reverts commit 0beee4c6dec15292415e3d56075c16a76a22af54 but with a bit of twist, as we have added "edit hunk manually" hack and we cannot rely on the original line numbers of the hunks that were manually edited. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-17Splitting a hunk that adds a line at the top fails in "add -p"Matt Graham
Splitting a hunk into two in add -p doesn't work for a diff that adds a new line at the top of the file with other add in the same hunk. Signed-off-by: Matthew Graham <mdg149@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16builtin-checkout: Don't tell user that HEAD has moved before it hasDaniel Cordero
Previously, checkout would tell the user this message before moving HEAD, without regard to whether the upcoming move will result in success. If the move failed, this causes confusion. Show the message after the move, unless the move failed. Signed-off-by: Daniel Cordero <theappleman@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16pre-commit.sample: don't print incidental SHA1Jim Meyering
Make the sample pre-commit hook script discard all git-rev-parse output, not just stderr. Otherwise, it would print an SHA1. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16tests: Add tests for missing format-patch long optionsStephen Boyd
Exercise format-patch's --signoff, --in-reply-to and --start-number long options. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-16api-parse-options.txt: use 'func' instead of 'funct'Stephen Boyd
Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>