Junio C Hamano [Wed, 16 Jun 2010 23:21:15 +0000 (16:21 -0700)]
Merge branch 'sp/maint-describe-tiebreak-with-tagger-date' into maint
* sp/maint-describe-tiebreak-with-tagger-date:
describe: Break annotated tag ties by tagger date
tag.c: Parse tagger date (if present)
tag.c: Refactor parse_tag_buffer to be saner to program
tag.h: Remove unused signature field
tag.c: Correct indentation
Junio C Hamano [Wed, 16 Jun 2010 23:21:06 +0000 (16:21 -0700)]
Merge branch 'np/malloc-threading' into maint
* np/malloc-threading:
Thread-safe xmalloc and xrealloc needs a recursive mutex
Make xmalloc and xrealloc thread-safe
Junio C Hamano [Wed, 16 Jun 2010 23:20:06 +0000 (16:20 -0700)]
Merge branch 'bg/send-email-smtpdomain' into maint
* bg/send-email-smtpdomain:
send-email: Cleanup smtp-domain and add config
Document send-email --smtp-domain
send-email: Don't use FQDNs without a '.'
send-email: Cleanup { style
Junio C Hamano [Wed, 16 Jun 2010 23:19:43 +0000 (16:19 -0700)]
Merge branch 'rc/maint-curl-helper' into maint
* rc/maint-curl-helper:
remote-curl: ensure that URLs have a trailing slash
http: make end_url_with_slash() public
t5541-http-push: add test for URLs with trailing slash
Conflicts:
remote-curl.c
Junio C Hamano [Wed, 16 Jun 2010 23:17:54 +0000 (16:17 -0700)]
Merge branch 'hg/maint-attr-fix' into maint
* hg/maint-attr-fix:
attr: Expand macros immediately when encountered.
attr: Allow multiple changes to an attribute on the same line.
attr: Fixed debug output for macro expansion.
Junio C Hamano [Wed, 16 Jun 2010 23:16:40 +0000 (16:16 -0700)]
Merge branch 'mh/status-optionally-refresh' into maint
* mh/status-optionally-refresh:
t7508: add a test for "git status" in a read-only repository
git status: refresh the index if possible
t7508: add test for "git status" refreshing the index
Michael J Gruber [Mon, 14 Jun 2010 16:12:29 +0000 (18:12 +0200)]
pretty: Introduce ' ' modifier to add space if non-empty
We have the '+' modifiier which helps combine format specifiers which
may possibly be empty, e.g. '%s%+b%n'.
Introduce an analogous ' ' (space) modifier which adds a space before
non-empty items. This helps assemble "one line type" format specifiers.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 15 Jun 2010 23:02:03 +0000 (01:02 +0200)]
common_prefix: simplify and fix scanning for prefixes
common_prefix() scans backwards from the far end of each 'next'
pathspec, starting from 'len', shortening the 'prefix' using 'path' as
a reference.
However, there is a small opportunity for an out-of-bounds access
because len is unconditionally set to prefix-1 after a "direct match"
test failed. This means that if 'next' is shorter than prefix+2, we
read past it.
Instead of a minimal fix, simplify the loop: scan *forward* over the
'next' entry, remembering the last '/' where it matched the prefix
known so far. This is far easier to read and also has the advantage
that we only scan over each entry once.
Acked-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stephen Boyd [Wed, 16 Jun 2010 05:59:26 +0000 (22:59 -0700)]
completion: Add --signature and format.signature
Cc: Shawn O. Pearce <redacted>
Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stephen Boyd [Wed, 16 Jun 2010 05:59:25 +0000 (22:59 -0700)]
format-patch: Add a signature option (--signature)
By default, git uses the version string as the signature for all
patches output by format-patch. Many employers (mine included)
require the use of a signature on all outgoing mails. In a
format-patch | send-email workflow there isn't an easy way to modify
the signature without breaking the pipe and manually replacing the
version string with the signature required. Instead of doing all that
work, add an option (--signature) and a config variable
(format.signature) to replace the default git version signature when
formatting patches.
This does modify the original behavior of format-patch a bit. First
off the version string is now placed in the cover letter by default.
Secondly, once the configuration variable format.signature is added
to the .config file there is no way to revert back to the default
git version signature. Instead, specifying the --no-signature option
will remove the signature from the patches entirely.
Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jay Soffian [Wed, 16 Jun 2010 07:12:40 +0000 (03:12 -0400)]
am: use get_author_ident_from_commit instead of mailinfo when rebasing
In certain situations, commit authorship can consist of an invalid
e-mail address. For example, this is the case when working with git svn
repos where the author email has had the svn repo UUID appended such as:
author@example.com <redacted>
Given such an address, mailinfo extracts the authorship incorrectly as
it assumes a valid domain. However, when rebasing the original
authorship should be preserved irrespective of its validity as an email
address.
Using get_author_ident_from_commit instead of mailinfo when rebasing
preserves the original authorship.
Signed-off-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Mon, 14 Jun 2010 23:40:05 +0000 (23:40 +0000)]
notes: Initialize variable to appease Sun Studio
Sun Studio 12 Update 1 thinks that *t could be uninitialized,
ostensibly because it doesn't take rewrite_cmd into account in its
static analysis.
builtin/notes.c: In function `notes_copy_from_stdin':
builtin/notes.c:419: warning: 't' might be used uninitialized in this function
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sun, 13 Jun 2010 10:09:32 +0000 (12:09 +0200)]
gitweb: Return or exit after done serving request
Check if there is a caller in top frame of gitweb, and either 'return'
if gitweb code is wrapped in subroutine, or 'exit' if it is not.
This should avoid
gitweb.cgi: Subroutine git_SOMETHING redefined at gitweb.cgi line NNN
warnings in error_log when running gitweb with mod_perl (using
ModPerl::Registry handler)
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Mon, 14 Jun 2010 05:28:50 +0000 (00:28 -0500)]
t3508 (cherry-pick): futureproof against unmerged files
Each of the tests in t3508 begins by navigating to a sane state:
git checkout master &&
git reset --hard $commit
If a previous test left unmerged files around, they are untouched and
the checkout fails, causing later tests to fail, too. This is not a
problem in practice because no test except the final one produces
unmerged files.
But as a futureproofing measure, it is still best to avoid the problem
with 'checkout -f'. In particular, this is needed for new tests to be
added to the end of the script.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Linus Torvalds [Fri, 23 Apr 2010 15:20:20 +0000 (08:20 -0700)]
Make :/ accept a regex rather than a fixed pattern
This also makes it trigger anywhere in the commit message, rather than
just at the beginning. Which tends to be a lot more useful.
Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 14 Jun 2010 16:53:02 +0000 (09:53 -0700)]
Update draft release notes to 1.7.2
It is loooong overdue.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 14 Jun 2010 17:05:09 +0000 (10:05 -0700)]
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
git svn: avoid unnecessary '/' in paths for SVN
git-svn: strip off leading slashes on --trunk argument
Eric Wong [Mon, 14 Jun 2010 04:31:10 +0000 (04:31 +0000)]
git svn: avoid unnecessary '/' in paths for SVN
svn:// servers are more picky regarding redundant slashes
than file:// and http(s)://-backed respositories. Since
the last commit, we avoid putting unnecessary slashes in
$GIT_CONFIG, but this doesn't help users who are already
set up that way.
Signed-off-by: Eric Wong <redacted>
Jonathan Nieder [Sun, 13 Jun 2010 11:27:43 +0000 (06:27 -0500)]
git-svn: strip off leading slashes on --trunk argument
The following command
git svn clone \
-r9500:10006 \
svn://svn.debian.org/svn/pkg-games/packages \
--trunk=/trunk/freedoom \
--branches=/branches/freedoom \
--tags=/tags/freedoom \
freedoom.git.
2009091
produces strange results:
With v1.6.3.3 (and perhaps earlier versions), this would fetch up to
and including r9978 (the last revision of the no_iwad_alternatives
branch before it was deleted), check it out, and prematurely declare
success, leaving out some commits to the trunk (r9984, r9985, r10006)
from after the branch was merged.
With v1.6.5-rc0~74 (svn: allow branches outside of refs/remotes,
2009-08-11) and later, this fetches up to and including r9978 and then
attempts a post-fetch checkout and fails.
r9978 =
25f0920175c395f0f22f54ae7a2318147f745274
(refs/remotes/no_iwad_alternatives)
fatal: refs/remotes/trunk: not a valid SHA1
update-ref refs/heads/master refs/remotes/trunk: command returned error: 128
Checking .git/config reveals
fetch = packages//trunk/freedoom:refs/remotes/trunk
And with both 1.6.3.3 and 1.7.1, using --trunk=trunk/freedom without
the leading slash (/) works fine.
Moral: git-svn needs to scrub an initial / from $_trunk and related
arguments it receives. Make it so.
Reported-by: Jon Dowland <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Acked-by: Eric Wong <redacted>
Junio C Hamano [Mon, 14 Jun 2010 04:02:16 +0000 (21:02 -0700)]
Merge branch 'maint'
* maint:
git-mailinfo documentation: clarify -u/--encoding
Zhang Le [Sun, 13 Jun 2010 18:49:47 +0000 (02:49 +0800)]
git-mailinfo documentation: clarify -u/--encoding
Instead of talking about hardcoded UTF-8, describe i18n.commitencoding
and the --encoding option, and state that they default to UTF-8.
Signed-off-by: Zhang Le <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Thu, 10 Jun 2010 00:24:54 +0000 (19:24 -0500)]
Remove python 2.5'isms
The following python 2.5 features were worked around:
* the sha module is used as a fallback when the hashlib module is
not available
* the 'any' built-in method was replaced with a 'for' loop
* a conditional expression was replaced with an 'if' statement
* the subprocess.check_call method was replaced by a call to
subprocess.Popen followed by a call to subprocess.wait with a
check of its return status
These changes allow the python infrastructure to be used with python 2.4
which is distributed with RedHat's RHEL 5, for example.
t5800 was updated to check for python >= 2.4 to reflect these changes.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 9 Jun 2010 21:23:59 +0000 (16:23 -0500)]
Makefile: add PYTHON_PATH to GIT-BUILD-OPTIONS
The PYTHON_PATH environment variable is not set when running test scripts
manually i.e. when not using 'make test'. Scripts which attempt to use
this variable will fail. So add it to the list of variables written to
the GIT-BUILD-OPTIONS file so that the test suite will import it when
running the test scripts.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sun, 13 Jun 2010 18:22:42 +0000 (11:22 -0700)]
Merge branch 'ab/cvsserver'
* ab/cvsserver:
git-cvsserver: test for pserver authentication support
git-cvsserver: document making a password without htpasswd
git-cvsserver: Improved error handling for pserver
git-cvsserver: indent & clean up authdb code
git-cvsserver: use a password file cvsserver pserver
git-cvsserver: authentication support for pserver
Junio C Hamano [Sun, 13 Jun 2010 18:22:39 +0000 (11:22 -0700)]
Merge branch 'mg/notes-dry-run'
* mg/notes-dry-run:
notes: dry-run and verbose options for prune
Junio C Hamano [Sun, 13 Jun 2010 18:22:30 +0000 (11:22 -0700)]
Merge branch 'mc/maint-zoneparse'
* mc/maint-zoneparse:
Add "Z" as an alias for the timezone "UTC"
Junio C Hamano [Sun, 13 Jun 2010 18:22:27 +0000 (11:22 -0700)]
Merge branch 'jk/diff-m-doc'
* jk/diff-m-doc:
docs: clarify meaning of -M for git-log
Junio C Hamano [Sun, 13 Jun 2010 18:22:15 +0000 (11:22 -0700)]
Merge branch 'jn/maint-doc-ignore'
* jn/maint-doc-ignore:
gitignore.5: Clarify matching rules
Junio C Hamano [Sun, 13 Jun 2010 18:22:09 +0000 (11:22 -0700)]
Merge branch 'jn/fsck-ident'
* jn/fsck-ident:
fsck: fix bogus commit header check
Junio C Hamano [Sun, 13 Jun 2010 18:22:05 +0000 (11:22 -0700)]
Merge branch 'bs/userdiff-php'
* bs/userdiff-php:
diff: Support visibility modifiers in the PHP hunk header regexp
Junio C Hamano [Sun, 13 Jun 2010 18:22:00 +0000 (11:22 -0700)]
Merge branch 'jk/maint-sha1-file-name-fix'
* jk/maint-sha1-file-name-fix:
remove over-eager caching in sha1_file_name
Junio C Hamano [Sun, 13 Jun 2010 18:21:55 +0000 (11:21 -0700)]
Merge branch 'jk/maint-pull-dry-run-noop'
* jk/maint-pull-dry-run-noop:
pull: do nothing on --dry-run
Junio C Hamano [Sun, 13 Jun 2010 18:21:49 +0000 (11:21 -0700)]
Merge branch 'ab/submodule-foreach-toplevel'
* ab/submodule-foreach-toplevel:
git-submodule foreach: Add $toplevel variable
Junio C Hamano [Sun, 13 Jun 2010 18:21:44 +0000 (11:21 -0700)]
Merge branch 'rs/grep-binary'
* rs/grep-binary:
grep: support NUL chars in search strings for -F
grep: use REG_STARTEND for all matching if available
grep: continue case insensitive fixed string search after NUL chars
grep: use memmem() for fixed string search
grep: --name-only over binary
grep: --count over binary
grep: grep: refactor handling of binary mode options
grep: add test script for binary file handling
Junio C Hamano [Sun, 13 Jun 2010 18:21:37 +0000 (11:21 -0700)]
Merge branch 'jn/gitweb-syntax-highlight'
* jn/gitweb-syntax-highlight:
gitweb: Refactor syntax highlighting support
gitweb: Syntax highlighting support
Junio C Hamano [Sun, 13 Jun 2010 18:21:30 +0000 (11:21 -0700)]
Merge branch 'js/maint-windows'
* js/maint-windows:
Recent MinGW has a C99 implementation of snprintf functions
mingw: use _commit to implement fsync
Junio C Hamano [Sun, 13 Jun 2010 18:21:25 +0000 (11:21 -0700)]
Merge branch 'bw/diff-metainfo-color'
* bw/diff-metainfo-color:
diff: fix coloring of extended diff headers
Junio C Hamano [Sun, 13 Jun 2010 18:21:21 +0000 (11:21 -0700)]
Merge branch 'js/try-to-free-stackable'
* js/try-to-free-stackable:
Do not call release_pack_memory in malloc wrappers when GIT_TRACE is used
Have set_try_to_free_routine return the previous routine
Junio C Hamano [Sun, 13 Jun 2010 18:21:17 +0000 (11:21 -0700)]
Merge branch 'jn/make-header-dependency'
* jn/make-header-dependency:
Makefile: let header dependency checker override COMPUTE_HEADER_DEPENDENCIES
Makefile: fix header dependency checker to allow NO_CURL builds
Junio C Hamano [Sun, 13 Jun 2010 18:21:11 +0000 (11:21 -0700)]
Merge branch 'cb/assume-unchanged-fix'
* cb/assume-unchanged-fix:
Documentation: git-add does not update files marked "assume unchanged"
do not overwrite files marked "assume unchanged"
Junio C Hamano [Sun, 13 Jun 2010 18:21:06 +0000 (11:21 -0700)]
Merge branch 'jn/notes-doc'
* jn/notes-doc:
Documentation/notes: nitpicks
Documentation/notes: clean up description of rewriting configuration
Documentation/notes: simplify treatment of default display refs
Documentation/log: add a CONFIGURATION section
Documentation/notes: simplify treatment of default notes ref
Documentation/notes: add configuration section
Documentation/notes: describe content of notes blobs
Documentation/notes: document format of notes trees
Junio C Hamano [Sun, 13 Jun 2010 18:21:00 +0000 (11:21 -0700)]
Merge branch 'wp/pretty-enhancement'
* wp/pretty-enhancement:
pretty: initialize new cmt_fmt_map to 0
pretty: add aliases for pretty formats
pretty: add infrastructure for commit format aliases
pretty: make it easier to add new formats
Junio C Hamano [Sun, 13 Jun 2010 18:20:57 +0000 (11:20 -0700)]
Merge branch 'ab/test-cleanup'
* ab/test-cleanup:
Turn setup code in t2007-checkout-symlink.sh into a test
Move t6000lib.sh to lib-*
Junio C Hamano [Sun, 13 Jun 2010 18:20:52 +0000 (11:20 -0700)]
Merge branch 'jn/maint-amend-missing-name'
* jn/maint-amend-missing-name:
commit --amend: cope with missing display name
Junio C Hamano [Sun, 13 Jun 2010 18:20:46 +0000 (11:20 -0700)]
Merge branch 'rs/diff-no-minimal'
* rs/diff-no-minimal:
git diff too slow for a file
Junio C Hamano [Sun, 13 Jun 2010 17:47:17 +0000 (10:47 -0700)]
Merge branch 'maint'
* maint:
add-interactive: Clarify “remaining hunks in the file”
Jonathan Nieder [Sun, 13 Jun 2010 03:32:51 +0000 (22:32 -0500)]
add-interactive: Clarify “remaining hunks in the file”
The "a" and "d" commands to ‘add --patch’ (accept/reject rest of file)
interact with "j", "g", and "/" (skip some hunks) in a perhaps
confusing way: after accepting or rejecting all _later_ hunks in the
file, they return to the earlier, skipped hunks and prompt the user
about them again.
This behavior can be very useful in practice. One can still accept or
reject _all_ undecided hunks in a file by using the "g" command to
move to hunk #1 first.
Reported-by: Frédéric Brière <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sat, 12 Jun 2010 22:35:59 +0000 (00:35 +0200)]
gitweb: Fix typo in hash key name in %opts in git_header_html
The name of the key has to be the same in call site handle_errors_html
and in called subroutine that uses it, i.e. git_header_html.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Sat, 12 Jun 2010 16:05:12 +0000 (18:05 +0200)]
commit: use value of GIT_REFLOG_ACTION env variable as reflog message
The environment variable GIT_REFLOG_ACTION was used by git-commit.sh,
but when it was converted to a builtin
(
f5bbc3225c4b073a7ff3218164a0c820299bc9c6, Port git commit to C,
Nov 8 2007) this was lost.
Let's use it again as it is more user friendly when reverting or
cherry-picking to see "revert" or "cherry-pick" in the reflog rather
than to just see "commit".
Signed-off-by: Christian Couder <redacted>
Acked-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 12 Jun 2010 14:15:39 +0000 (22:15 +0800)]
commit::print_summary(): don't use format_commit_message()
This attempts to fix a regression in git-commit, where non-abbreviated
SHA-1s were printed in the summary.
One possible fix would be to set ctx.abbrev to DEFAULT_ABBREV in the
`if` block, where format_commit_message() is used.
Instead, we do away with the format_commit_message() codeblock
altogether, replacing it with a re-run of log_tree_commit().
We re-run log_tree_commit() with rev.always_show_header set, to force
the invocation of show_log(). The effect of this flag can be seen from
this excerpt from log-tree.c:560, the only area that
rev.always_show_header is checked:
shown = log_tree_diff(opt, commit, &log);
if (!shown && opt->loginfo && opt->always_show_header) {
log.parent = NULL;
show_log(opt);
shown = 1;
}
We also set rev.use_terminator, so that a newline is appended at the end
of the log message. Note that callers in builtin/log.c that also set
rev.always_show_header don't have to set rev.use_terminator, but still
get a newline, because they are wrapped in a pager.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Sat, 12 Jun 2010 12:57:39 +0000 (14:57 +0200)]
parseopt: wrap rev-parse --parseopt usage for eval consumption
9c7304e (print the usage string on stdout instead of stderr,
2010-05-17) broke rev-parse --parseopt: when run with -h, the usage
notice on stdout ended up in the shell eval.
Wrap the usage in a cat <<\EOF ... EOF block when printing to stdout.
I do not expect any usage lines to ever start with EOF so this
shouldn't be an undue burden.
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sat, 12 Jun 2010 16:39:46 +0000 (11:39 -0500)]
grep -O: allow optional argument specifying the pager (or editor)
Suppose you want to edit all files that contain a specific search term.
Of course, you can do something totally trivial such as
git grep -z -e <term> | xargs -0r vi +/<term>
but maybe you are happy that the same will be achieved by
git grep -Ovi <term>
now.
[jn: rebased and added tests]
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Acked-by: Paolo Bonzini <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sat, 12 Jun 2010 16:36:51 +0000 (11:36 -0500)]
grep: Add the option '--open-files-in-pager'
This adds an option to open the matching files in the pager, and if the
pager happens to be "less" (or "vi") and there is only one grep pattern,
it also jumps to the first match right away.
The short option was chose as '-O' to avoid clashes with GNU grep's
options (as suggested by Junio).
So, 'git grep -O abc' is a short form for 'less +/abc $(grep -l abc)'
except that it works also with spaces in file names, and it does not
start the pager if there was no matching file.
[jn: rebased and added tests; with error handling fix from Junio
squashed in]
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sat, 12 Jun 2010 16:32:11 +0000 (11:32 -0500)]
Unify code paths of threaded greps
There were three awfully similar code paths ending the threaded grep. It
is better to avoid duplicated code, though.
This change might very well prevent a race, where the grep patterns were
free()d before waiting that all threads finished.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Sat, 12 Jun 2010 16:31:18 +0000 (11:31 -0500)]
grep: refactor grep_objects loop into its own function
Simplify cmd_grep by splitting off the loop that finds matches in a
list of trees. So now the main part of cmd_grep looks like:
if (!use_index) {
int hit = grep_directory(&opt, paths);
if (use_threads)
hit |= wait_all();
return !hit;
}
if (!list.nr) {
if (!cached)
setup_work_tree();
int hit = grep_cache(&opt, paths, cached);
if (use_threads)
hit |= wait_all;
return !hit;
}
hit = grep_objects(&opt, path, &list);
if (use_threads)
hit |= wait_all();
return !hit;
and is ripe for further refactoring.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Thu, 10 Jun 2010 11:47:23 +0000 (13:47 +0200)]
rev-list: introduce --count option
Add a --count option that, instead of actually listing the commits,
merely counts them.
This is mostly geared towards script use, and to this end it acts
specially when used with --left-right: it outputs the left and right
counts separately. Previously, scripts would have to run a shell loop
or small inline script over to achieve the same. (Without
--left-right, a simple |wc -l does the job.)
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Thu, 10 Jun 2010 12:54:03 +0000 (14:54 +0200)]
log_ref_setup: don't return stack-allocated array
859c301 (refs: split log_ref_write logic into log_ref_setup,
2010-05-21) refactors the stack allocation of the log_file array into
the new log_ref_setup() function, but passes it back to the caller.
Since the original intent seems to have been to split the work between
log_ref_setup and log_ref_write, make it the caller's responsibility
to allocate the buffer.
Signed-off-by: Thomas Rast <redacted>
Reported-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 12 Jun 2010 05:05:58 +0000 (22:05 -0700)]
Merge branch 'maint'
* maint:
t/README: document --root option
Makefile: default pager on AIX to "more"
Thomas Rast [Thu, 10 Jun 2010 18:43:51 +0000 (20:43 +0200)]
check_aliased_update: strcpy() instead of strcat() to copy
da3efdb (receive-pack: detect aliased updates which can occur with
symrefs, 2010-04-19) introduced two strcat() into uninitialized
strings. The intent was clearly make a copy of the static buffer used
by find_unique_abbrev(), so use strcpy() instead.
Signed-off-by: Thomas Rast <redacted>
Reported-by: Ævar Arnfjörð Bjarmason <redacted>
Tested-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Thu, 10 Jun 2010 18:24:46 +0000 (20:24 +0200)]
t/README: document --root option
We've had this option since
f423ef5 (tests: allow user to specify
trash directory location, 2009-08-09). Make it easier to look up :-)
Signed-off-by: Thomas Rast <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Fri, 11 Jun 2010 15:02:50 +0000 (17:02 +0200)]
fast-import: die_nicely() back to vsnprintf (reverts part of
ebaa79f)
ebaa79f (Make report() from usage.c public as vreportf() and use it.,
2010-03-06) changed fast-import's die_nicely() to use vreportf().
Unfortunately this is not possible: we need the message again for
write_report(), and vreportf() uses vsnprintf(), which invalidates the
va_list. As pointed out by Erik Faye-Lund, va_copy is C99 and thus
not an option.
So revert the part of
ebaa79f that pertains to die_nicely().
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 11 Jun 2010 16:40:25 +0000 (09:40 -0700)]
test-lib: use DIFF definition from GIT-BUILD-OPTIONS
Otherwise running individual tests from t/ directory may lack the definition
of $DIFF, $GIT_TEST_CMP and friends.
Noticed and initial patch provided by Thomas Rast, alternative solution
suggested by Brandon Casey, which this patch implements.
Signed-off-by: Junio C Hamano <redacted>
Acked-by: Thomas Rast <redacted>
Jens Lehmann [Tue, 8 Jun 2010 16:31:51 +0000 (18:31 +0200)]
Add optional parameters to the diff option "--ignore-submodules"
In some use cases it is not desirable that the diff family considers
submodules that only contain untracked content as dirty. This may happen
e.g. when the submodule is not under the developers control and not all
build generated files have been added to .gitignore by the upstream
developers. Using the "untracked" parameter for the "--ignore-submodules"
option disables checking for untracked content and lets git diff report
them as changed only when they have new commits or modified content.
Sometimes it is not wanted to have submodules show up as changed when they
just contain changes to their work tree. An example for that are scripts
which just want to check for submodule commits while ignoring any changes
to the work tree. Also users having large submodules known not to change
might want to use this option, as the - sometimes substantial - time it
takes to scan the submodule work tree(s) is saved.
Signed-off-by: Jens Lehmann <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jens Lehmann [Tue, 8 Jun 2010 16:31:25 +0000 (18:31 +0200)]
git diff: rename test that had a conflicting name
In
86140d5 the new test t4041-diff-submodule.sh was introduced although
t4027-diff-submodule.sh already existed. Rename the newer test to
t4041-diff-submodule-option.sh to fix that.
Signed-off-by: Jens Lehmann <redacted>
Signed-off-by: Junio C Hamano <redacted>
Axel Bonnet [Mon, 7 Jun 2010 15:23:36 +0000 (17:23 +0200)]
textconv: make the API public
The textconv functionality allows one to convert a file into text before
running diff. But this functionality can be useful to other features
such as blame.
Signed-off-by: Axel Bonnet <redacted>
Signed-off-by: Clément Poulain <redacted>
Signed-off-by: Diane Gasselin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 10 Jun 2010 08:59:52 +0000 (04:59 -0400)]
Makefile: default pager on AIX to "more"
AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice. People who really want less can set the
compile-time option themselves, or users can set $PAGER.
Signed-off-by: Jeff King <redacted>
Tested-by: Tor Arntsen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ian Ward Comfort [Tue, 8 Jun 2010 08:16:11 +0000 (01:16 -0700)]
rebase -i: Abort cleanly if new base cannot be checked out
Untracked content in the working tree may prevent rebase -i from checking out
the new base onto which it wants to replay commits, if the new base commit
includes files at those (now untracked) paths. Currently, rebase -i dies
uncleanly in this situation, updating ORIG_HEAD and leaving a useless
.git/rebase-merge directory, with which the user can do nothing useful except
rebase --abort. Make rebase -i abort the procedure itself instead, as
non-interactive rebase already does, and add a test for this behavior.
Signed-off-by: Ian Ward Comfort <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Sixt [Tue, 8 Jun 2010 11:34:12 +0000 (13:34 +0200)]
merge-recursive: demonstrate an incorrect conflict with submodule
When one side of a merge turns a directory into a submodule, and the other
side does not touch that directory (but has other non-conflicting changes),
then a merge should succeed. But currently, it does not; it rather fails
with a file/directory conflict.
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Mon, 7 Jun 2010 00:41:46 +0000 (20:41 -0400)]
commit: give advice on empty amend
We generally disallow empty commits with "git commit". The
output produced by the wt_status functions is generally
sufficient to explain what happened.
With --amend commits, however, things are a little more
confusing. We would create an empty commit not if you
actually have staged changes _now_, but if your staged
changes match HEAD^. In this case, it is not immediately
obvious why "git commit" claims no changes, but "git status"
does not. Furthermore, we should point the user in the
direction of git reset, which would eliminate the empty
commit entirely.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sat, 5 Jun 2010 21:11:18 +0000 (23:11 +0200)]
gitweb: Run in FastCGI mode if gitweb script has .fcgi extension
If the name of the script ($SCRIPT_NAME or $SCRIPT_FILENAME CGI
environment variable, or __FILE__ literal) ends with '.fcgi'
extension, run gitweb in FastCGI mode, as if it was run with
'--fastcgi' / '--fcgi' option.
This is intended for easy deploying gitweb using FastCGI
interface.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Tue, 1 Jun 2010 07:25:23 +0000 (02:25 -0500)]
Documentation/checkout: clarify description
git checkout can be used to switch branches and to retrieve files from
the index or an arbitrary tree. Split the description into
subsections corresponding to each mode to make each use easier to
understand.
Helped-by: Jeff King <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Tue, 1 Jun 2010 01:43:35 +0000 (20:43 -0500)]
rebase -i -p: document shortcomings
The rebase --preserve-merges facility presents a list of commits
in its instruction sheet and uses a separate table to keep
track of their parents. Unfortunately, in practice this means
that with -p after most attempts to rearrange patches, some
commits have the "wrong" parent and the resulting history is
rarely what the caller expected.
Yes, it would be nice to fix that. But first, add a warning to the
manual to help the uninitiated understand what is going on.
Reported-by: Jiří Paleček <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Thu, 10 Jun 2010 08:59:52 +0000 (04:59 -0400)]
Makefile: default pager on AIX to "more"
AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice. People who really want less can set the
compile-time option themselves, or users can set $PAGER.
Signed-off-by: Jeff King <redacted>
Tested-by: Tor Arntsen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 8 Jun 2010 05:15:31 +0000 (22:15 -0700)]
Merge branch 'maint'
* maint:
Change C99 comments to old-style C comments
Ramkumar Ramachandra [Thu, 3 Jun 2010 20:28:55 +0000 (22:28 +0200)]
Refactor parse_date for approxidate functions
approxidate_relative and approxidate_careful both use parse_date to
dump the timestamp to a character buffer and parse it back into a long
unsigned using strtoul(). Avoid doing this by creating a new
parse_date_toffset method.
Noticed-by: Jonathan Nieder <redacted>
Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tor Arntsen [Fri, 4 Jun 2010 09:32:11 +0000 (11:32 +0200)]
Change C99 comments to old-style C comments
Signed-off-by: Tor Arntsen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Simo Melenius [Fri, 4 Jun 2010 09:50:11 +0000 (12:50 +0300)]
branch: don't fail listing branches if one of the commits wasn't found
When listing branches with ref lookups, if one of the known raw refs
doesn't point to a commit then "git branch" would return error(),
terminating the whole for_each_rawref() iteration and possibly hiding
any remaining refs.
Signed-off-by: Simo Melenius <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Simo Melenius [Fri, 4 Jun 2010 09:50:10 +0000 (12:50 +0300)]
branch: exit status now reflects if branch listing finds an error
If some refs could not be read when listing branches, this can now be
observed in the exit status of the "git branch" command.
Signed-off-by: Simo Melenius <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 7 Jun 2010 22:46:01 +0000 (15:46 -0700)]
Merge branch 'maint'
* maint:
commit.txt: clarify how --author argument is used
Jay Soffian [Sun, 6 Jun 2010 23:31:34 +0000 (19:31 -0400)]
commit.txt: clarify how --author argument is used
commit --author was added by
146ea06 (git commit --author=$name: look $name up
in existing commits), but its documentation was sorely lacking compared to its
excellent commit message. This commit tries to improve the documentation.
Signed-off-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
Eyvind Bernhardsen [Fri, 4 Jun 2010 19:29:08 +0000 (21:29 +0200)]
Add "core.eol" config variable
Introduce a new configuration variable, "core.eol", that allows the user
to set which line endings to use for end-of-line-normalized files in the
working directory. It defaults to "native", which means CRLF on Windows
and LF everywhere else.
Note that "core.autocrlf" overrides core.eol. This means that
[core]
autocrlf = true
puts CRLFs in the working directory even if core.eol is set to "lf".
Signed-off-by: Eyvind Bernhardsen <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 7 Jun 2010 01:42:12 +0000 (18:42 -0700)]
Merge branch 'maint'
* maint:
setup: document prefix
Christian Couder [Wed, 26 May 2010 02:50:12 +0000 (04:50 +0200)]
diff: fix "git show -C -C" output when renaming a binary file
A bug was introduced in
3e97c7c6af2901cec63bf35fcd43ae3472e24af8
(No diff -b/-w output for all-whitespace changes, Nov 19 2009)
that made the lines:
diff --git a/bar b/sub/bar
similarity index 100%
rename from bar
rename to sub/bar
disappear from "git show -C -C" output when file bar is a binary
file.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Thu, 3 Jun 2010 23:17:37 +0000 (01:17 +0200)]
revision: Turn off history simplification in --ancestry-path mode
When using --ancestry-path together with history simplification (typically
triggered by path limiting), history simplification would get in the way of
--ancestry-path by prematurely removing the parent links between commits on
which the ancestry path calculations are made.
This patch disables this history simplification when --ancestry-path is
enabled. This is similar to what e.g. --full-history already does.
The patch also includes a simple testcase verifying that --ancestry-path
works together with path limiting.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Thu, 3 Jun 2010 23:17:36 +0000 (01:17 +0200)]
revision: Fix typo in --ancestry-path error message
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Thu, 3 Jun 2010 23:17:35 +0000 (01:17 +0200)]
Documentation/rev-list-options.txt: Explain --ancestry-path
Add a short paragraph explaining --ancestry-path, followed by a more
detailed example. This mirrors how the other history simplification options
are documented.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Thu, 3 Jun 2010 23:17:33 +0000 (01:17 +0200)]
Documentation/rev-list-options.txt: Fix missing line in example history graph
In the detailed explanation of how the revision machinery does history
simplification, the current text presents an example history and explains
how various options of the revision machinery affect the resulting list
of commits. The first simplification mode mentioned is the default mode,
in which a number of commits is omitted from the example graph according
to the history simplification rules. The text states (among other things)
that commit "C was considered via N, but is TREESAME", and therefore
omitted. However, the accompanying graph does not list the effect on the
implicit parentage, i.e. that commit I takes C's place as a parent of N.
Running 'git rev-list --parents P' does indeed list I as a second parent
of N, and the accompanying graph should therefore also show this line.
Signed-off-by: Johan Herland <redacted>
Cc: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 5 Jun 2010 16:36:13 +0000 (09:36 -0700)]
build: propagate $DIFF to scripts
git-merge-one-file expects to run "-u" capable "diff", but using
$DIFF is not the right way to do so.
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Thu, 3 Jun 2010 13:39:18 +0000 (15:39 +0200)]
ls-files: allow relative pathspec
git ls-files used to error out if given paths which point outside the current
working directory, such as '../'. We now allow such paths and the output is
analogous to git grep -l.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Thu, 3 Jun 2010 13:36:31 +0000 (15:36 +0200)]
quote.c: separate quoting and relative path generation
This is in preparation of relative path support for ls-files, which
quotes a path only if the line terminator is not the NUL character.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Sat, 5 Jun 2010 08:04:20 +0000 (10:04 +0200)]
setup: document prefix
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Tue, 25 May 2010 14:52:03 +0000 (16:52 +0200)]
Documentation+t5708: document and test status -s -b
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Daniel Knittl-Frank [Tue, 25 May 2010 13:45:51 +0000 (15:45 +0200)]
Show branch information in short output of git status
This patch adds a first line in the output of `git status -s` when given
the option `-b` or `--branch`, showing which branch the user is
currently on, and in case of tracking branches the number of commits on
each branch.
Signed-off-by: Daniel Knittl-Frank <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erick Mattos [Sat, 22 May 2010 00:43:52 +0000 (21:43 -0300)]
bash completion: add --orphan to 'git checkout'
Update git-completion.bash with new --orphan option to 'git checkout'.
Signed-off-by: Erick Mattos <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erick Mattos [Sat, 22 May 2010 00:28:38 +0000 (21:28 -0300)]
t3200: test -l with core.logAllRefUpdates options
By default reflogs are always created for new local branches by
"checkout -b". But by setting core.logAllRefUpdates to false this will
not be true anymore.
In that case you only create the reflogs when you use -l switch with
"checkout -b".
Added missing tests to check expected behaviors.
Signed-off-by: Erick Mattos <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erick Mattos [Sat, 22 May 2010 00:28:37 +0000 (21:28 -0300)]
checkout --orphan: respect -l option always
Added changes to satisfy a corner case: creating reflogs by using -l
when core.logAllRefUpdates is set to false.
Signed-off-by: Erick Mattos <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J. Kiwala [Tue, 1 Jun 2010 21:24:57 +0000 (16:24 -0500)]
git svn: fix empty directory creation
Avoid attempts to stat() the contents of '', which could happen
when the root directory is empty. Additionally, remove the
unnecessary '_' stat optimization since it was confusing and
possibly throwing off the non-existent case.
[ew: fixed indentation, rewrote commit message]
Acked-by: Eric Wong <redacted>
Signed-off-by: Michael J. Kiwala <redacted>
Junio C Hamano [Wed, 2 Jun 2010 19:15:48 +0000 (12:15 -0700)]
t9129: fix UTF-8 locale detection
The UTF-8 prerequisite test checked explicitly for en_US.utf8 in the
output from "locale -a", but the tests that are actually protected by the
prerequisite were asking LC_ALL=en_US.UTF-8 from the system.
This inconsistency leads the tests to fail on platforms that do not know
both en_US.UTF-8 and en_US.utf8 (thanks you, Yann Droneaud, for bringing
this up with an initial patch).
Instead, pick a locale with ".UTF-8" (with or without hyphen, spelled in
either upper or lowercase) in its name from "locale -a" output, and use it
for running the test.
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Fri, 28 May 2010 19:11:25 +0000 (21:11 +0200)]
git-instaweb: Add support for running gitweb via 'plackup'
PSGI is an interface between Perl web applications and web servers, and
Plack is a Perl module and toolkit that contains PSGI middleware, helpers
and adapters to web servers; see http://plackperl.org
PSGI and Plack are inspired by Python's WSGI and Ruby's Rack (and
probably JavaScript's Jack/JSGI).
Plack core distribution includes HTTP::Server::PSGI, a reference PSGI
standalone web server implementation. 'plackup' is a command line
launcher to run PSGI applications from command line, connecting web
app to a web server via Plack::Runner module. By default it uses
HTTP::Server::PSGI as a web server.
git-instaweb generates gitweb.psgi wrapper (in $GIT_DIR/gitweb). This
wrapper uses Plack::App::WrapCGI to compile gitweb.cgi (which is a CGI
script) into a PSGI application using CGI::Compile and CGI::Emulate::PSGI.
git-instaweb then runs this wrapper, using by default HTTP::Server::PSGI
standalone Perl server, via Plack::Runner.
The configuration for 'plackup' is currently embedded in generated
gitweb.psgi wrapper, instead of using httpd.conf ($conf).
To run git-instaweb with '--httpd=plackup', you need to have instaled
Plack core, CGI::Emulate::PSGI, CGI::Compile. Those modules have to be
available for Perl scripts (which can be done for example by setting
PERL5LIB environment variable). This is currently not documented.
Signed-off-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Acked-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Fri, 28 May 2010 19:11:24 +0000 (21:11 +0200)]
git-instaweb: Wait for server to start before running web browser
Add generic httpd_is_ready subroutine, which busy-waits for web server to
be started, by checking if $port is opened on localhost. This is used to
avoid situation where web browser is started before web server is ready to
accept connection, and fails.
It uses IO::Socket::INET module, which is core Perl module since v5.6.0.
Alternate solution, possible for those web servers that can run arbitrary
code hooks after they bind the listen socket (after they start accepting
connections), would be to use some kind of blocking mechanism: FIFO or
lockfile, see
http://thread.gmane.org/gmane.comp.version-control.git/147337/focus=147566
This can be always added later, as a web server specific branch in
httpd_is_ready function.
Signed-off-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Acked-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>