Jakub Narebski [Fri, 28 May 2010 19:11:23 +0000 (21:11 +0200)]
git-instaweb: Remove pidfile after stopping web server
This way running e.g. "git instaweb" after "git instaweb --stop" would
not try to kill already stopped web server.
This is probably important only for those web servers that are
"daemonized" by git-instaweb itself, i.e. for those where it is
git-instaweb that creates pidfile. Currently it is includes only
'mongoose' web server, but it would also include 'plackup' web server
(added in later commit).
Signed-off-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Acked-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erick Mattos [Sat, 22 May 2010 00:28:36 +0000 (21:28 -0300)]
refs: split log_ref_write logic into log_ref_setup
Separation of the logic for testing and preparing the reflogs from
function log_ref_write to a new non static new function: log_ref_setup.
This allows to be performed from outside the first all reasonable checks
and procedures for writing reflogs.
Signed-off-by: Erick Mattos <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erick Mattos [Sat, 22 May 2010 00:28:35 +0000 (21:28 -0300)]
Documentation: alter checkout --orphan description
The present text is a try to enhance description accuracy. It is a
merge of the rewritten text made by native english speaker Chris Johnsen
and further changes of Junio. It came from the last thread messages of
--orphan patch.
Signed-off-by: Erick Mattos <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:49 +0000 (09:31 +0000)]
Makefile: Tru64 portability fix
Add defaults for Tru64 Unix. Without this patch I cannot compile
git on Tru64 5.1.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:48 +0000 (09:31 +0000)]
Makefile: HP-UX 10.20 portability fixes
HP-UX 10.20 has no pread definition, the inline keyword doesn't work,
and has no inet_ntop/inet_pton definitions.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:47 +0000 (09:31 +0000)]
Makefile: HPUX11 portability fixes
There is no nanosecond field on HPUX, the inline keyword is
spelled "__inline", and there are no inet_ntop/inet_pton definitions
on HP-UX 11.00
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 2 Jun 2010 17:17:26 +0000 (10:17 -0700)]
Merge branch 'maint'
* maint:
git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
Documentation: A...B shortcut for checkout and rebase
Documentation/pretty-{formats,options}: better reference for "format:<string>"
Christian Couder [Wed, 2 Jun 2010 05:58:41 +0000 (07:58 +0200)]
Documentation/revert: describe passing more than one commit
And while at it, add an "EXAMPLES" section.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:40 +0000 (07:58 +0200)]
Documentation/cherry-pick: describe passing more than one commit
And while at it, add an "EXAMPLES" section.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:39 +0000 (07:58 +0200)]
revert: add tests to check cherry-picking many commits
Note that there is an expected failure when running:
git cherry-pick -3 fourth
that's because:
git rev-list --no-walk -3 fourth
produce only one commit and not 3 as "--no-walk" seems to
take over "-3".
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:38 +0000 (07:58 +0200)]
revert: allow cherry-picking more than one commit
This makes it possible to pass many commits or ranges of
commits to "git cherry-pick" and to "git revert" to process
many commits instead of just one.
In fact commits are now enumerated with an equivalent of
git rev-list --no-walk "$@"
so all the following are now possible:
git cherry-pick master~2..master
git cherry-pick ^master~2 master
git cherry-pick master^ master
The following should be possible but does not work:
git cherry-pick -2 master
because "git rev-list --no-walk -2 master" only outputs
one commit as "--no-walk" seems to take over "-2".
And there is currently no way to continue cherry-picking or
reverting if there is a problem with one commit. It's also
not possible to abort the whole process. Some future work
should provide the --continue and --abort options to do
just that.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:37 +0000 (07:58 +0200)]
revert: change help_msg() to take no argument
This is needed because the following commits will make it
possible to cherry-pick many commits instead of just one.
So it will be possible to pass for example ranges of commits
to "git cherry-pick" and this means that it will not be
possible to use the arguments passed to "git cherry-pick" in
the help message.
The help message will have to use the sha1 of the currently
processed commit.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:36 +0000 (07:58 +0200)]
revert: refactor code into a do_pick_commit() function
This is needed because we are going to make it possible
to cherry-pick many commits instead of just one in the following
commits. And we will be able to do that by just calling
do_pick_commit() once for each commit to cherry-pick.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:35 +0000 (07:58 +0200)]
revert: use run_command_v_opt() instead of execv_git_cmd()
This is needed by the following commits, because we are going
to cherry pick many commits instead of just one.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 2 Jun 2010 05:58:34 +0000 (07:58 +0200)]
revert: cleanup code for -x option
There was some dead code and option -x appeared in the short
help message of git revert (when running "git revert -h")
which was wrong.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Wed, 2 Jun 2010 01:55:36 +0000 (20:55 -0500)]
git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro. Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Tue, 1 Jun 2010 15:16:42 +0000 (17:16 +0200)]
Documentation: A...B shortcut for checkout and rebase
Describe the A...B shortcuts for checkout and rebase [-i] which were
introduced in these commits:
619a64e ("checkout A...B" switches to the merge base between A and B, 2009-10-18)
61dfa1b ("rebase --onto A...B" replays history on the merge base between A and B, 2009-11-20)
230a456 (rebase -i: teach --onto A...B syntax, 2010-01-07)
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nazri Ramliy [Tue, 1 Jun 2010 17:54:46 +0000 (01:54 +0800)]
Documentation/pretty-{formats,options}: better reference for "format:<string>"
In "git help log" (and friends) it's not easy to find the possible
placeholder for <string> for the "--pretty=format:<string>" option
to git log.
This patch makes the placeholder easier to find by adding a reference
to the "PRETTY FORMATS" section and repeating the "format:<string>"
phrase.
Signed-off-by: Nazri Ramliy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ramkumar Ramachandra [Wed, 2 Jun 2010 08:33:37 +0000 (10:33 +0200)]
git am: Remove stray error message from sed
When --continue is invoked without any changes, the following stray
error message appears- sed: can't read $dotest/final-commit: No such
file or directory. Remove this by making sure that the file actually
exists.
Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ramkumar Ramachandra [Wed, 2 Jun 2010 08:33:36 +0000 (10:33 +0200)]
git am: Display some help text when patch is empty
When a patch is found to be empty, prompt the user to use either
--skip or --abort.
Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ramkumar Ramachandra [Wed, 2 Jun 2010 08:33:35 +0000 (10:33 +0200)]
git am: Set cmdline globally
Set the $cmdline variable globally, and not in stop_here_user_resolve
so it can be used in other code fragments as well.
Signed-off-by: Ramkumar Ramachandra <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 2 Jun 2010 00:13:44 +0000 (19:13 -0500)]
t/aggregate-results: accomodate systems with small max argument list length
IRIX 6.5 has a default maximum argument list length of 20480. The file
glob that is passed to aggregate-results currently exceeds this length, and
so the script cannot run successfully. Work around this issue by passing
the file names in via the standard input rather than the argument list.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 2 Jun 2010 15:32:26 +0000 (10:32 -0500)]
t/t7006: ignore return status of shell's unset builtin
The unset builtin of Solaris's xpg4/sh returns non-zero if it is passed a
variable name which was not previously set. Since the unset is not likely
to fail, ignore its return status, but add a semicolon as a clue that the
'&&' was deliberately left off.
Signed-off-by: Brandon Casey <redacted>
Acked-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 2 Jun 2010 00:13:42 +0000 (19:13 -0500)]
t/t5150: remove space from sed script
Solaris's xpg4/sed and IRIX's sed fail to parse these negated matching
expressions when the '!' is separated from the command that follows.
Signed-off-by: Brandon Casey <redacted>
Acked-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 2 Jun 2010 00:13:41 +0000 (19:13 -0500)]
git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh
The -e option causes the shell to exit immediately when a command exits
with a non-zero exit status. This does not seem to cause a problem for
Bash, but it does cause a problem for the Korn shell, like Solaris's
xpg4/sh, whose unset utility returns non-zero if it is passed a variable
name which was not previously set. When using xpg4/sh, git-request-pull
exits while sourcing git-sh-setup since git-sh-setup tries to unset the
CDPATH environment variable.
When git-request-pull was originally written, it did not do any error
checking and it used this shell feature to exit when an error occurred.
This script now performs proper error checking and provides useful error
messages, so this -e option appears to be merely a historical artifact and
can be removed.
Kudos to Jonathan Nieder for introducing t5150 which exercises the
request-pull code path.
Suggested-by: Brandon Casey <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Brandon Casey [Wed, 2 Jun 2010 00:13:40 +0000 (19:13 -0500)]
t/t5800: skip if python version is older than 2.5
This test script depends on the git-remote-testgit python script. This
python script makes use of the hashlib module which was released in python
version 2.5. So, add a new pre-requisite named PYTHON_2_5_OR_NEWER to
test-lib.sh and check for it in t5800.
Signed-off-by: Brandon Casey <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Tue, 1 Jun 2010 08:35:49 +0000 (03:35 -0500)]
DWIM 'git show -5' to 'git show --do-walk -5'
To show the last two commits with one command, one might try
1) git show -s master~2..
2) git show -s ^master~2 master
3) git show -s master^ master
4) git show -s -2 master
Choice (3) works because both commits are listed on the command line.
Choices (1) and (2) have worked ever since v1.6.4-rc~3 (Make 'git
show' more useful, 2009-07-13) disabled --no-walk in this case because
there is no other useful meaning for them to have. Unfortunately, (4)
does not work: it outputs only one commit, because --no-walk stays on.
So disable --no-walk in this case so ‘git show’ and future ‘git
cherry-pick’ can behave as expected.
As a side effect, this unfortunately changes the meaning of
‘git log --oneline --decorate --no-walk -5 --all’: instead of listing
five refs, after this patch that command would list the five most
recent commits.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 1 Jun 2010 01:14:23 +0000 (18:14 -0700)]
Merge branch 'maint'
* maint:
Documentation/SubmittingPatches: Fix typo in GMail section
Documentation/config: describe status.submodulesummary
Junio C Hamano [Tue, 1 Jun 2010 01:14:17 +0000 (18:14 -0700)]
Merge branch 'maint-1.7.0' into maint
* maint-1.7.0:
Documentation/config: describe status.submodulesummary
Jonathan Nieder [Fri, 5 Mar 2010 15:56:39 +0000 (09:56 -0600)]
gitignore.5: Clarify matching rules
Patterns containing a / are implicitly anchored to the directory
containing the relevant .gitignore file.
Patterns not containing a / are textual matches against the path
name relative to the directory containing .gitignore.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Giuseppe Scrivano [Mon, 17 May 2010 15:34:41 +0000 (17:34 +0200)]
print the usage string on stdout instead of stderr
When -h is used, print usage messages on stdout. If a command is invoked with
wrong arguments then print the usage messages on stderr.
Signed-off-by: Giuseppe Scrivano <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tim Henigan [Wed, 26 May 2010 12:36:10 +0000 (08:36 -0400)]
Documentation/SubmittingPatches: Fix typo in GMail section
Commit
e498257d introduced a typo while improving the GMail section
of SubmittingPatches.
Signed-off-by: Tim Henigan <redacted>
Acked-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pavan Kumar Sunkara [Sat, 29 May 2010 18:36:51 +0000 (00:06 +0530)]
git-web--browse: Add support for google chrome and chromium
Add support for google's chrome & chromium. The value of the
browser is 'chromium' or 'chrome' to select it.
You can always provide config variable for browser path if they
are not installed in right paths.
Signed-off-by: Pavan Kumar Sunkara <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Sat, 29 May 2010 15:32:06 +0000 (23:32 +0800)]
Make --color-words work well with --graph
'--color-words' algorithm can be described as:
1. collect a the minus/plus lines of a diff hunk, divided into
minus-lines and plus-lines;
2. break both minus-lines and plus-lines into words and
place them into two mmfile_t with one word for each line;
3. use xdiff to run diff on the two mmfile_t to get the words level diff;
And for the common parts of the both file, we output the plus side text.
diff_words->current_plus is used to trace the current position of the plus file
which printed. diff_words->last_minus is used to trace the last minus word
printed.
For '--graph' to work with '--color-words', we need to output the graph prefix
on each line of color words output. Generally, there are two conditions on
which we should output the prefix.
1. diff_words->last_minus == 0 &&
diff_words->current_plus == diff_words->plus.text.ptr
that is: the plus text must start as a new line, and if there is no minus
word printed, a graph prefix must be printed.
2. diff_words->current_plus > diff_words->plus.text.ptr &&
*(diff_words->current_plus - 1) == '\n'
that is: a graph prefix must be printed following a '\n'
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Wed, 26 May 2010 07:23:56 +0000 (15:23 +0800)]
graph.c: register a callback for graph output
It will look better if the 'git log --graph' print
the graph pading lines before the diff output just
like what it does for commit message.
And this patch leverage the new diff prefix callback
function to achieve this.
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Sat, 29 May 2010 15:32:05 +0000 (23:32 +0800)]
Emit a whole line in one go
Since the graph prefix will be printed when calling
emit_line, so the functions should be used to emit a
complete line out once a time. No one should call
emit_line to just output some strings instead of a
complete line.
Use a strbuf to compose the whole line, and then
call emit_line to output it once.
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Wed, 26 May 2010 07:23:54 +0000 (15:23 +0800)]
diff.c: Output the text graph padding before each diff line
Change output from diff with -p/--dirstat/--binary/--numstat/--stat/
--shortstat/--check/--summary options to align with graph paddings.
Thanks Jeff King <redacted> for reporting the '--summary' bug and
his initial patch.
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Wed, 26 May 2010 07:08:03 +0000 (15:08 +0800)]
Output the graph columns at the end of the commit message
There is an empty line between the commit message and the diff
output. Add the graph columns as prefix of this line.
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Bo Yang [Wed, 26 May 2010 07:08:02 +0000 (15:08 +0800)]
Add a prefix output callback to diff output
The callback can be used to add some prefix string to each line of
diff output.
Signed-off-by: Bo Yang <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pavan Kumar Sunkara [Fri, 28 May 2010 06:25:52 +0000 (11:55 +0530)]
git-instaweb: Configure it to work with new gitweb structure
git-instaweb in its current form (re)creates gitweb.cgi and
(some of) required static files in $GIT_DIR/gitweb/ directory.
Splitting gitweb would make it difficult for git-instaweb to
continue with this method.
Use the instaweb.gitwebdir config variable to point git-instaweb script
to a global directory which contains gitweb files as server root
and the httpd.conf along with server logs and pid go into
'$(GIT_DIR)/gitweb' directory.
Signed-off-by: Pavan Kumar Sunkara <redacted>
Mentored-by: Christian Couder <redacted>
Mentored-by: Petr Baudis <redacted>
Acked-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pavan Kumar Sunkara [Fri, 28 May 2010 06:25:51 +0000 (11:55 +0530)]
git-instaweb: Put httpd logs in a "$httpd_only" subdirectory
Resolve full httpd and create "$httpd_only" subdirectory before
writing httpd.conf so that error.log and access.log go into it.
While at it, change apache2 configuration to use logs in a
similiar fashion.
Signed-off-by: Pavan Kumar Sunkara <redacted>
Mentored-by: Christian Couder <redacted>
Mentored-by: Petr Baudis <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pavan Kumar Sunkara [Fri, 28 May 2010 06:25:50 +0000 (11:55 +0530)]
gitweb: Set default destination directory for installing gitweb in Makefile
Currently installing gitweb requires to give a target directory
(via 'gitwebdir' build variable). Giving it a default value
protects against user errors.
Signed-off-by: Pavan Kumar Sunkara <redacted>
Mentored-by: Christian Couder <redacted>
Mentored-by: Petr Baudis <redacted>
Acked-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pavan Kumar Sunkara [Fri, 28 May 2010 06:25:49 +0000 (11:55 +0530)]
gitweb: Move static files into seperate subdirectory
Create a new subdirectory called 'static' in gitweb/, and move
all static files required by gitweb.cgi when running, which means
styles, images and Javascript code. This should make gitweb more
readable and easier to maintain.
Update t/gitweb-lib.sh to reflect this change.The install-gitweb
now also include moving of static files into 'static' subdirectory
in target directory: update Makefile, gitweb's INSTALL, README and
Makefile accordingly.
Signed-off-by: Pavan Kumar Sunkara <redacted>
Mentored-by: Christian Couder <redacted>
Mentored-by: Petr Baudis <redacted>
Acked-by: Jakub Narebski <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Mon, 31 May 2010 22:51:32 +0000 (17:51 -0500)]
rebase: improve error message when upstream argument is missing
Strip out options before checking for a missing upstream argument.
Before:
$ git rebase -m
shift: 426: can't shift that many
After:
$ git rebase -m
Usage: git rebase ...
While at it, fix the usage message to explain that the upstream
argument is mandatory.
Reported-by: Jon Dowland <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Sun, 30 May 2010 08:41:53 +0000 (03:41 -0500)]
Documentation/checkout: clarify description
To the first-time reader, it may not be obvious that ‘git checkout’
has two modes, nor that if no branch is specified it will read
from the index.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jan Krüger [Sun, 30 May 2010 08:19:26 +0000 (10:19 +0200)]
git-am: suggest what to do with superfluous patches
Particularly in the context of rebase, conflicts frequently occur
because the change in the patch to be applied was made obsolete by new
upstream commits. In this case, solving the conflict effectively means
skipping the patch. However, it's not always readily apparent that the
patch needs to be skipped, and when people solve the conflict and try
git rebase --continue, they get confronted with a message of
No changes - did you forget to use 'git add'?
That's not very helpful if you did actually stage your changes and they
happen to turn the patch into a no-op. This extends the message to point
out what's going on.
Signed-off-by: Jan Krüger <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Sun, 30 May 2010 17:12:41 +0000 (17:12 +0000)]
Makefile: remove redundant munging of @@INSTLIBDIR@@
Junio originally added this in
f6276fe159 for use in `unshift @INC,
'@@INSTLIBDIR@@'' in git-fmt-merge-msg.perl. That program was since
then rewritten in C in
00449f992b. And since
6fcca938b0 all Perl
programs use `use lib' to set their @INC path.
There's been no @@INSTLIBDIR@@ in any Perl script to replace since
then. So there's no reason to keep it around.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Sun, 30 May 2010 13:37:17 +0000 (15:37 +0200)]
diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s
In the metainfo section of git diffs there's an "index" line providing
abbreviated (unless --full-index is used) blob SHA1s from the
pre-/post-images used to generate the diff. These provide hints that
can be used to reconstruct a 3-way merge when applying the patch
(see the --3way option to 'git am' for more details).
In order for this to work, however, the blob SHA1s must not be
abbreviated into ambiguity.
This patch eliminates the possible ambiguity by using find_unique_abbrev()
to produce the abbreviated SHA1s (instead of blind abbreviation by way of
"%.*s").
A testcase verifying the fix is also included.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:45 +0000 (09:31 +0000)]
Makefile: SunOS 5.6 portability fix
Although configure takes care of most of this, set some default values
for Solaris 2.6 (aka SunOS-5.6) to ensure git compiles even when
configure is not used to build it.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:44 +0000 (09:31 +0000)]
inline declaration does not work on AIX
Define away inline declaration on AIX.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:43 +0000 (09:31 +0000)]
Allow disabling "inline"
Compiler support for inline is sometimes buggy, and occasionally
missing entirely. This patch adds a test for inline support, and
redefines the keyword with the preprocessor if necessary at compile
time.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:42 +0000 (09:31 +0000)]
Some platforms lack socklen_t type
Some platforms do not have a socklen_t type declaration.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:41 +0000 (09:31 +0000)]
Make NO_{INET_NTOP,INET_PTON} configured independently
Being careful not to overwrite the results of testing for hstrerror in
libresolv, also test whether inet_ntop/inet_pton are available from
that library.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:40 +0000 (09:31 +0000)]
Makefile: some platforms do not have hstrerror anywhere
This patch improves the logic of the test for hstrerror, not to
blindly assume that if there is no hstrerror in libc that it must
exist in libresolv.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:39 +0000 (09:31 +0000)]
git-compat-util.h: some platforms with mmap() lack MAP_FAILED definition
Some platforms with mmap() lack MAP_FAILED definition.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:38 +0000 (09:31 +0000)]
test_cmp: do not use "diff -u" on platforms that lack one
By default the testsuite calls 'diff -u' whenever a file comparison is
called for. Unfortunately that throws a "diff: unknown option '-u'"
error for most non-GNU diffs.
This patch sets GIT_TEST_CMP to 'cmp' on all the architectures where
that happens. The previous version of this patch forgot to export
GIT_TEST_CMP from t/Makefile, which is why 'make test' continued to
fail most tests on most architectures - test-lib.sh was falling back
on its default of `diff -u' for GIT_TEST_CMP. This version of this
patch shows a vast improvement in testsuite results where either GNU
diff is in the path at configure time, or where Makefile knows that
GIT_TEST_CMP=cmp is required.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 1 Jun 2010 00:35:20 +0000 (17:35 -0700)]
fixup: do not unconditionally disable "diff -u"
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:37 +0000 (09:31 +0000)]
tests: use "test_cmp", not "diff", when verifying the result
In tests, call test_cmp rather than raw diff where possible (i.e. if
the output does not go to a pipe), to allow the use of, say, 'cmp'
when the default 'diff -u' is not compatible with a vendor diff.
When that is not possible, use $DIFF, as set in GIT-BUILD-OPTIONS.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:36 +0000 (09:31 +0000)]
Do not use "diff" found on PATH while building and installing
Some of the flags used with the first diff found in PATH cause the
vendor diff to choke.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:35 +0000 (09:31 +0000)]
enums: omit trailing comma for portability
Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
5.1 fails to compile git.
enum style is inconsistent already, with some enums declared on one
line, some over 3 lines with the enum values all on the middle line,
sometimes with 1 enum value per line... and independently of that the
trailing comma is sometimes present and other times absent, often
mixing with/without trailing comma styles in a single file, and
sometimes in consecutive enum declarations.
Clearly, omitting the comma is the more portable style, and this patch
changes all enum declarations to use the portable omitted dangling
comma style consistently.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:34 +0000 (09:31 +0000)]
Makefile: -lpthread may still be necessary when libc has only pthread stubs
Without this patch, systems that provide stubs for pthread functions
in libc, but which still require libpthread for full the pthread
implementation are not detected correctly.
Also, some systems require -pthread in CFLAGS for each compilation
unit for a successful link of an mt binary, which is also addressed by
this patch.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:33 +0000 (09:31 +0000)]
Rewrite dynamic structure initializations to runtime assignment
Unfortunately, there are still plenty of production systems with
vendor compilers that choke unless all compound declarations can be
determined statically at compile time, for example hpux10.20 (I can
provide a comprehensive list of our supported platforms that exhibit
this problem if necessary).
This patch simply breaks apart any compound declarations with dynamic
initialisation expressions, and moves the initialisation until after
the last declaration in the same block, in all the places necessary to
have the offending compilers accept the code.
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Gary V. Vaughan [Fri, 14 May 2010 09:31:32 +0000 (09:31 +0000)]
Makefile: pass CPPFLAGS through to fllow customization
Without this patch there is no straight forward way to pass additional
CPPFLAGS at configure-time. At TWW, everything non-vendor package is
installed to its own subdirectory, so we need the following to show
the preprocessor where the headers for the libraries we will link
later can be found:
$SHELL ./configure \
CPPFLAGS="-I${SB_VAR_CURL_INC}\
-I${SB_VAR_LIBEXPAT_INC}\
-I${SB_VAR_LIBZ_INC}\
${CPPFLAGS+ $CPPFLAGS}" <<...>>
Signed-off-by: Gary V. Vaughan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kirill Smelkov [Thu, 20 May 2010 09:50:41 +0000 (13:50 +0400)]
gitk: Show notes by default (like git log does)
Starting from ~ git-1.6.6, log, show & whatchanged show notes by default.
On the other hand, gitk does not show notes by default, because under
the hood it calls 'git log --pretty=raw ...' to get the log, and in
'git log' notes are turned off when user specifies format or pretty
settings.
Yes, it is possible to invoke 'gitk --show-notes' explicitly, but since
from user's perspective, gitk is gui enabled git log, it would be
logical for gitk to show notes by default too for consistency.
In git, --show-notes was introduced in 66b2ed (Fix "log" family not to
be too agressive about showing notes) which predates 1.6.6.2.
Notes can still be supressed with 'gitk --no-notes'.
Cc: Michael J Gruber <redacted>
Signed-off-by: Kirill Smelkov <redacted>
Signed-off-by: Paul Mackerras <redacted>
Michael J Gruber [Thu, 20 May 2010 15:55:42 +0000 (17:55 +0200)]
Documentation/config: describe status.submodulesummary
ac8d5af (builtin-status: submodule summary support, 2008-04-12)
intoduced this variable and described it in git-status[1].
Include this description in git-config[1], as well.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 28 May 2010 23:59:42 +0000 (16:59 -0700)]
Merge branch 'maint'
* maint:
Makefile: reenable install with NO_CURL
completion: --set-upstream option for git-branch
get_cwd_relative(): do not misinterpret suffix as subdirectory
Junio C Hamano [Fri, 28 May 2010 23:59:36 +0000 (16:59 -0700)]
Merge branch 'maint-1.7.0' into maint
* maint-1.7.0:
Makefile: reenable install with NO_CURL
Michael J Gruber [Wed, 26 May 2010 14:24:34 +0000 (16:24 +0200)]
Makefile: reenable install with NO_CURL
Setting NO_CURL leaves some variables like REMOTE_CURL_ALIASES
empty, which creates no fun when for-looping over
$(REMOTE_CURL_ALIASES) unconditionally. Make it conditional.
Reported-by: Paul Walker <redacted>
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Thu, 27 May 2010 15:34:51 +0000 (23:34 +0800)]
t7502-commit: add summary output tests for empty and merge commits
After
c197702 (pretty: Respect --abbrev option), non-abbreviated hashes
began to appear, leading to failures for these tests.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Thu, 27 May 2010 15:34:50 +0000 (23:34 +0800)]
t7502-commit: add tests for summary output
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Wed, 26 May 2010 21:50:34 +0000 (16:50 -0500)]
fsck: fix bogus commit header check
daae1922 (fsck: check ident lines in commit objects, 2010-04-24)
taught fsck to expect commit objects to have the form
tree <object name>
<parents>
author <valid ident string>
committer <valid ident string>
log message
The check is overly strict: for example, it errors out with the
message “expected blank line” for perfectly valid commits with an
"encoding ISO-8859-1" line.
Later it might make sense to teach fsck about the rest of the header
and warn about unrecognized header lines, but for simplicity, let’s
accept arbitrary trailing lines for now.
Reported-by: Tuncer Ayaz <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Wed, 26 May 2010 08:46:41 +0000 (10:46 +0200)]
completion: --set-upstream option for git-branch
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Sat, 22 May 2010 11:13:05 +0000 (13:13 +0200)]
get_cwd_relative(): do not misinterpret suffix as subdirectory
If the current working directory is the same as the work tree path
plus a suffix, e.g. 'work' and 'work-xyz', then the suffix '-xyz'
would be interpreted as a subdirectory of 'work'.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Björn Steinbrink [Sun, 23 May 2010 18:05:40 +0000 (20:05 +0200)]
diff: Support visibility modifiers in the PHP hunk header regexp
Starting with PHP5, class methods can have a visibility modifier, which
caused the methods not to be matched by the existing regexp, so extend
the regexp to match those modifiers. And while we're at it, allow the
"static" modifier as well.
Since the "static" modifier can appear either before or after the
visibility modifier, let's just allow any number of modifiers to appear
in any order, as that simplifies the regexp and shouldn't cause any
false positives.
Signed-off-by: Björn Steinbrink <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 25 May 2010 20:13:43 +0000 (13:13 -0700)]
Merge branch 'maint'
* maint:
Documentation/SubmittingPatches: clarify GMail section and SMTP
show-branch: use DEFAULT_ABBREV instead of 7
t7502-commit: fix spelling
test get_git_work_tree() return value for NULL
Michael J Gruber [Tue, 25 May 2010 08:30:13 +0000 (10:30 +0200)]
Documentation/SubmittingPatches: clarify GMail section and SMTP
We keep getting mangled submissions from GMail's web interface. Try to
be more proactive in SubmittingPatches by
- pointing to MUA specific instructions early on,
- structuring the GMail section more clearly,
- putting send-email/SMTP before imap-send/IMAP.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Tue, 25 May 2010 06:07:25 +0000 (02:07 -0400)]
pull: do nothing on --dry-run
Pull was never meant to take --dry-run at all. However, it
passes unknown arguments to git-fetch, which does do a
dry-run. Unfortunately, pull then attempts to merge whatever
cruft was in FETCH_HEAD (which the dry-run fetch will not
have written to).
Even though we never advertise --dry-run as something that
should work, it is still worth being defensive because:
1. Other commands (including fetch) take --dry-run, so a
user might try it.
2. Rather than simply producing an error, it actually
changes the repository in totally unexpected ways.
This patch makes "pull --dry-run" equivalent to "fetch
--dry-run".
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Mon, 24 May 2010 08:50:44 +0000 (16:50 +0800)]
show-branch: use DEFAULT_ABBREV instead of 7
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Mon, 24 May 2010 08:51:17 +0000 (16:51 +0800)]
t7502-commit: fix spelling
s/subdirecotry/subdirectory/
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Sat, 22 May 2010 12:21:27 +0000 (14:21 +0200)]
test get_git_work_tree() return value for NULL
If we are in a git directory, get_git_work_tree() can return NULL.
While trying to determine whether or not the given paths are outside
the work tree, the following command would read from it anyways and
trigger a segmentation fault.
git diff / /
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Sat, 22 May 2010 06:59:42 +0000 (02:59 -0400)]
remove over-eager caching in sha1_file_name
This function takes a sha1 and produces a loose object
filename. It caches the location of the object directory so
that it can fill the sha1 information directly without
allocating a new buffer (and in its original incarnation,
without calling getenv(), though these days we cache that
with the code in environment.c).
This cached base directory can become stale, however, if in
a single process git changes the location of the object
directory (e.g., by running setup_work_tree, which will
chdir to the new worktree).
In most cases this isn't a problem, because we tend to set
up the git repository location and do any chdir()s before
actually looking up any objects, so the first lookup will
cache the correct location. In the case of reset --hard,
however, we do something like:
1. look up the commit object
2. notice we are doing --hard, run setup_work_tree
3. look up the tree object to reset
Step (3) fails because our cache object directory value is
bogus.
This patch simply removes the caching. We use a static
buffer instead of allocating one each time (the original
version treated the malloc'd buffer as a static, so there is
no change in calling semantics).
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Fri, 21 May 2010 16:10:10 +0000 (16:10 +0000)]
git-submodule foreach: Add $toplevel variable
Add a $toplevel variable accessible to `git submodule foreach`, it
contains the absolute path of the top level directory (where
.gitmodules is).
This makes it possible to e.g. read data in .gitmodules from within
foreach commands. I'm using this to configure the branch names I want
to track for each submodule:
git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) && git pull'
For a little history: This patch is borne out of my continuing fight
of trying to have Git track the branches of submodules, not just their
commits.
Obviously that's not how they work (they only track commits), but I'm
just interested in being able to do:
git submodule foreach 'git pull'
Of course that won't work because the submodule is in a disconnected
head, so I first have to connect it, but connect it *to what*.
For a while I was happy with this because as fate had it, it just so
happened to do what I meant:
git submodule foreach 'git checkout $(git describe --all --always) && git pull'
But then that broke down, if there's a tag and a branch the tag will
win out, and I can't git pull a branch:
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
$ git tag -l
release-0.0.6
$ git describe --always --all
release-0.0.6
So I figured that I might as well start tracking the branches I want
in .gitmodules itself:
[submodule "yaml-mode"]
path = yaml-mode
url = git://github.com/yoshiki/yaml-mode.git
branch = master
So now I can just do (as stated above):
git submodule foreach 'git checkout $(git config --file $toplevel/.gitmodules submodule.$name.branch) && git pull'
Maybe there's a less painful way to do *that* (I'd love to hear about
it). But regardless of that I think it's a good idea to be able to
know what the top-level is from git submodule foreach.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Sun, 23 May 2010 09:19:44 +0000 (05:19 -0400)]
decode file:// and ssh:// URLs
We generally treat these as equivalent to "/path/to/repo"
and "host:path_to_repo" respectively. However, they are URLs
and as such may be percent-encoded. The current code simply
uses them as-is without any decoding.
With this patch, we will now percent-decode any file:// or
ssh:// url (or ssh+git, git+ssh, etc) at the transport
layer. We continue to treat plain paths and "host:path"
syntax literally.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Sun, 23 May 2010 09:17:55 +0000 (05:17 -0400)]
make url-related functions reusable
The is_url function and url percent-decoding functions were
static, but are generally useful. Let's make them available
to other parts of the code.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:43:43 +0000 (23:43 +0200)]
grep: support NUL chars in search strings for -F
Search patterns in a file specified with -f can contain NUL characters.
The current code ignores all characters on a line after a NUL.
Pass the actual length of the line all the way from the pattern file to
fixmatch() and use it for case-sensitive fixed string matching.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:35:07 +0000 (23:35 +0200)]
grep: use REG_STARTEND for all matching if available
Refactor REG_STARTEND handling inlook_ahead() into a new helper,
regmatch(), and use it for line matching, too. This allows regex
matching beyond NUL characters if regexec() supports the flag. NUL
characters themselves are not matched in any way, though.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:34:06 +0000 (23:34 +0200)]
grep: continue case insensitive fixed string search after NUL chars
Functions for C strings, like strcasestr(), can't see beyond NUL
characters. Check if there is such an obstacle on the line and try
again behind it.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:32:43 +0000 (23:32 +0200)]
grep: use memmem() for fixed string search
Allow searching beyond NUL characters by using memmem() instead of
strstr().
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:30:48 +0000 (23:30 +0200)]
grep: --name-only over binary
As with the option -c/--count, git grep with the option -l/--name-only
should work the same with binary files as with text files because
there is no danger of messing up the terminal with control characters
from the contents of matching files. GNU grep does the same.
Move the check for ->name_only before the one for binary_match_only,
thus making the latter irrelevant for git grep -l.
Reported-by: Dmitry Potapov <redacted>
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:29:35 +0000 (23:29 +0200)]
grep: --count over binary
The intent of showing the message "Binary file xyz matches" for
binary files is to avoid annoying users by potentially messing up
their terminals by printing control characters. In --count mode,
this precaution isn't necessary.
Display counts of matches if -c/--count was specified, even if -a
was not given. GNU grep does the same.
Moving the check for ->count before the code for handling binary
file also avoids printing context lines if --count and -[ABC] were
used together, so we can remove the part of the comment that
mentions this behaviour. Again, GNU grep does the same.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:28:17 +0000 (23:28 +0200)]
grep: grep: refactor handling of binary mode options
Turn the switch inside-out and add labels for each possible value
of ->binary. This makes the code easier to read and avoids calling
buffer_is_binary() if the option -a was given.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sat, 22 May 2010 21:26:39 +0000 (23:26 +0200)]
grep: add test script for binary file handling
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 21 May 2010 11:02:24 +0000 (04:02 -0700)]
Merge branch 'by/blame-doc-m-c'
* by/blame-doc-m-c:
blame-options.txt: Add default value for `-M/-C` options.
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'by/log-follow'
* by/log-follow:
tests: rename duplicate t4205
Make git log --follow find copies among unmodified files.
Make diffcore_std only can run once before a diff_flush
Add a macro DIFF_QUEUE_CLEAR.
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'mg/advice-statushints'
* mg/advice-statushints:
wt-status: take advice.statusHints seriously
t7508: test advice.statusHints
Conflicts:
wt-status.c
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'cb/maint-stash-orphaned-file'
* cb/maint-stash-orphaned-file:
stash tests: stash can lose data in a file removed from the index
stash: Don't overwrite files that have gone from the index
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'jn/maint-bundle'
* jn/maint-bundle:
fix "bundle --stdin" segfault
t5704 (bundle): add tests for bundle --stdin
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'pb/patch-id-plus'
* pb/patch-id-plus:
patch-id: Add support for mbox format
patch-id: extract parsing one diff out of generate_id_list
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'rr/doc-submitting'
* rr/doc-submitting:
SubmittingPatches: Add new section about what to base work on
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'st/remote-tags-no-tags'
* st/remote-tags-no-tags:
remote add: add a --[no-]tags option
Honor "tagopt = --tags" configuration option