git
14 years agoMerge branch 'js/maint-windows'
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

14 years agoMerge branch 'bw/diff-metainfo-color'
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

14 years agoMerge branch 'js/try-to-free-stackable'
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

14 years agoMerge branch 'jn/make-header-dependency'
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

14 years agoMerge branch 'cb/assume-unchanged-fix'
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"

14 years agoMerge branch 'jn/notes-doc'
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

14 years agoMerge branch 'wp/pretty-enhancement'
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

14 years agoMerge branch 'ab/test-cleanup'
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-*

14 years agoMerge branch 'jn/maint-amend-missing-name'
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

14 years agoMerge branch 'rs/diff-no-minimal'
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

14 years agoMerge branch 'maint'
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”

14 years agoadd-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 <fbriere@fbriere.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Fix typo in hash key name in %opts in git_header_html
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocommit: use value of GIT_REFLOG_ACTION env variable as reflog message
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 <chriscool@tuxfamily.org>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocommit::print_summary(): don't use format_commit_message()
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 <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoparseopt: wrap rev-parse --parseopt usage for eval consumption
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 <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agolog_ref_setup: don't return stack-allocated array
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 <trast@student.ethz.ch>
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
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"

14 years agocheck_aliased_update: strcpy() instead of strcat() to copy
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 <trast@student.ethz.ch>
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/README: document --root option
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 <trast@student.ethz.ch>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f)
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 <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest-lib: use DIFF definition from GIT-BUILD-OPTIONS
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 <gitster@pobox.com>
Acked-by: Thomas Rast <trast@student.ethz.ch>
14 years agoMakefile: default pager on AIX to "more"
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 <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase -i: Abort cleanly if new base cannot be checked out
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 <icomfort@stanford.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-recursive: demonstrate an incorrect conflict with submodule
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 <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocommit: give advice on empty amend
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Run in FastCGI mode if gitweb script has .fcgi extension
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 <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/checkout: clarify description
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 <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase -i -p: document shortcomings
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 <jpalecek@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: default pager on AIX to "more"
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 <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
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

14 years agoRefactor parse_date for approxidate functions
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 <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoChange C99 comments to old-style C comments
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 <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobranch: don't fail listing branches if one of the commits wasn't found
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 <simo.melenius@iki.fi>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobranch: exit status now reflects if branch listing finds an error
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 <simo.melenius@iki.fi>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
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

14 years agocommit.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 <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd "core.eol" config variable
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 <eyvind.bernhardsen@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Mon, 7 Jun 2010 01:42:12 +0000 (18:42 -0700)] 
Merge branch 'maint'

* maint:
  setup: document prefix

14 years agodiff: fix "git show -C -C" output when renaming a binary file
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 <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuild: propagate $DIFF to scripts
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 <gitster@pobox.com>
14 years agols-files: allow relative pathspec
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 <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoquote.c: separate quoting and relative path generation
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 <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosetup: document prefix
Clemens Buchacher [Sat, 5 Jun 2010 08:04:20 +0000 (10:04 +0200)] 
setup: document prefix

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation+t5708: document and test status -s -b
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 <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoShow branch information in short output of git status
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 <knittl89+git@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobash completion: add --orphan to 'git checkout'
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 <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3200: test -l with core.logAllRefUpdates options
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 <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocheckout --orphan: respect -l option always
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 <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit svn: fix empty directory creation
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 <normalperson@yhbt.net>
Signed-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>
14 years agot9129: fix UTF-8 locale detection
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 <gitster@pobox.com>
14 years agogit-instaweb: Add support for running gitweb via 'plackup'
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 <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-instaweb: Wait for server to start before running web browser
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 <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-instaweb: Remove pidfile after stopping web server
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 <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorefs: split log_ref_write logic into log_ref_setup
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 <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: alter checkout --orphan description
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 <erick.mattos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Tru64 portability fix
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: HP-UX 10.20 portability fixes
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: HPUX11 portability fixes
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
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>"

14 years agogit-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
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 <casey@nrlssc.navy.mil>
Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: A...B shortcut for checkout and rebase
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 <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/pretty-{formats,options}: better reference for "format:<string>"
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 <ayiehere@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit am: Remove stray error message from sed
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 <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit am: Display some help text when patch is empty
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 <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit am: Set cmdline globally
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 <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/aggregate-results: accomodate systems with small max argument list length
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t7006: ignore return status of shell's unset builtin
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 <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t5150: remove space from sed script
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 <casey@nrlssc.navy.mil>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-request-pull.sh: remove -e switch to shell interpreter which breaks ksh
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 <drafnel@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t5800: skip if python version is older than 2.5
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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
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

14 years agoMerge branch 'maint-1.7.0' into maint
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

14 years agogitignore.5: Clarify matching rules
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 <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoprint the usage string on stdout instead of stderr
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 <gscrivano@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/SubmittingPatches: Fix typo in GMail section
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 <tim.henigan@gmail.com>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-web--browse: Add support for google chrome and chromium
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 <pavan.sss1991@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMake --color-words work well with --graph
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 <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agograph.c: register a callback for graph output
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 <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoEmit a whole line in one go
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 <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff.c: Output the text graph padding before each diff line
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 <peff@peff.net> for reporting the '--summary' bug and
his initial patch.

Signed-off-by: Bo Yang <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoOutput the graph columns at the end of the commit message
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 <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd a prefix output callback to diff output
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 <struggleyb.nku@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-instaweb: Configure it to work with new gitweb structure
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 <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-instaweb: Put httpd logs in a "$httpd_only" subdirectory
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 <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Set default destination directory for installing gitweb in Makefile
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 <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Move static files into seperate subdirectory
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 <pavan.sss1991@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Petr Baudis <pasky@ucw.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase: improve error message when upstream argument is missing
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 <jmtd@debian.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/checkout: clarify description
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 <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-am: suggest what to do with superfluous patches
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 <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: remove redundant munging of @@INSTLIBDIR@@
Æ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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff.c: Ensure "index $from..$to" line contains unambiguous SHA1s
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 <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: SunOS 5.6 portability fix
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoinline declaration does not work on AIX
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAllow disabling "inline"
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSome platforms lack socklen_t type
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMake NO_{INET_NTOP,INET_PTON} configured independently
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: some platforms do not have hstrerror anywhere
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-compat-util.h: some platforms with mmap() lack MAP_FAILED definition
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest_cmp: do not use "diff -u" on platforms that lack one
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 <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>