Commit graph

22145 commits

Author SHA1 Message Date
Junio C Hamano 2870695be0 Merge branch 'bc/maint-daemon-sans-ss-family' into maint
* bc/maint-daemon-sans-ss-family:
  daemon.c: avoid accessing ss_family member of struct sockaddr_storage
2010-04-09 22:22:00 -07:00
Tay Ray Chuan e3163c7515 fetch/push: fix usage strings
- use "<options>" instead of just "options".
 - use "[<repository> [<refspec>...]]" to indicate that <repository> and
   <refspec> are optional, and that <refspec> cannot be specified
   without specifying <repository>.

Note that when called without specifying <repository> (eg. "git fetch
-f"), it is accurate to say that the "git fetch [<options>]
[<repository> ...]" case takes precedence over "git fetch [<options>]
<group>".

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 21:23:10 -07:00
Tay Ray Chuan d8fab07208 remote-curl: ensure that URLs have a trailing slash
Previously, we blindly assumed that URLs passed to the remote-curl
helper did not end with a trailing slash.

Use the convenience function end_url_with_slash() from http.[ch] to
ensure that URLs have a trailing slash on invocation of the remote-curl
helper, and use the URL as one with a trailing slash throughout.

It is possible for users to pass a URL with a trailing slash to
remote-curl, by, say, setting it in remote.<name>.url in their git
config. The resulting requests have an empty path component (//) and may
break implementations of the http git protocol.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 21:16:11 -07:00
Tay Ray Chuan eb9d47cf9b http: make end_url_with_slash() public
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 21:11:09 -07:00
Tay Ray Chuan 9ee6bcd398 t5541-http-push: add test for URLs with trailing slash
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 21:11:03 -07:00
Brian Gernhardt f733f6a0c6 Makefile: Simplify handling of python scripts
The sed script intended to add a standard opening to python scripts
was non-compatible and overly complex.  Simplifying it down to a set
of one-liners removes the compatibility issues of newlines.  Moving
the environment alterations from the Makefile to the python scripts
makes also makes the scripts easier to run in-place.

Specifically, the new sed script:

 - Alters the shebang line to use the configured Python.
 - Alters any os.getenv("GITPYTHONLIB") calls to use @@INSTLIBDIR@@ as the
   default.  This will replace any existing default or add a default if
   none is provided.
 - Replaces the @@INSTLIBDIR@@ placeholder with the directory git installs
   its python libraries to.

The last two steps could be combined into a single step, but is left
separate in case someone has another need for @@INSTLIBDIR@@ in their
script.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 20:47:22 -07:00
Junio C Hamano da288e25d9 Merge branch 'rc/maint-reflog-msg-for-forced-branch'
* rc/maint-reflog-msg-for-forced-branch:
  branch: say "Reset to" in reflog entries for 'git branch -f' operations

Conflicts:
	builtin-branch.c
2010-04-09 20:42:10 -07:00
Tay Ray Chuan 936db184f0 branch: say "Reset to" in reflog entries for 'git branch -f' operations
In 5f856dd (fix reflog entries for "git-branch"), it is mentioned that
'git branch -f' is intended to be equivalent to 'git reset'. Since we
usually say "reset to <commit>" in the git-reset Documentation and
elsewhere, it would make sense to say "Reset to" here as well, instead
of "Reset from" previously.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 20:40:54 -07:00
Junio C Hamano 7ec1eb93f7 Merge early parts of jk/cached-textconv 2010-04-08 23:31:51 -07:00
Junio C Hamano aed6ca52e7 diff.c: work around pointer constness warnings
The textconv leak fix introduced two invocations of free() to release
memory pointed by "const char *", which get annoying compiler warning.
2010-04-08 23:30:49 -07:00
Junio C Hamano dcc30eb2c7 Merge branch 'maint'
* maint:
  docs: clarify "branch -l"
2010-04-08 23:27:23 -07:00
Junio C Hamano 4f62c2bc57 log.decorate: only ignore it under "log --pretty=raw"
Unlike notes that are often multi-line and disrupting to be placed in many
output formats, a decoration is designed to be a small token that can be
tacked after an existing line of the output where a commit object name sits.
Disabling log.decorate for something like "log --oneline" would defeat the
purpose of the configuration.

We _might_ want to change it further in the future to force scripts that
do not want to be broken by random end user configurations to explicitly
say "log --no-decorate", but that would be an incompatible change that
needs the usual multi-release-cycle deprecation process.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 23:13:48 -07:00
Jeff King b0e621adfd script with rev-list instead of log
Because log.decorate now shows decorations for --pretty=oneline,
we must explicitly turn it off when scripting. Otherwise,
users with log.decorate set will get cruft like:

  $ git stash
  Saved working directory and index state WIP on master:
    2c1f7f5 (HEAD, master) commit subject

Instead of adding --no-decorate to the log command line,
let's just use the rev-list plumbing interface instead,
which does the right thing.

git-submodule has a similar call. Since it just counts the
commit lines, nothing is broken, but let's switch it, too,
for the sake of consistency and cleanliness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 23:13:48 -07:00
Tay Ray Chuan 9c00de5a31 ls-remote: fall-back to default remotes when no remote specified
Instead of breaking execution when no remote (as specified in the
variable dest) is specified when git-ls-remote is invoked, continue on
and let remote_get() handle it.

This way, we are able to use the default remotes (eg. "origin",
branch.<name>.remote), as git-fetch, git-push, and other users of
remote_get(), do.

If no suitable remote is found, exit with a message describing the
issue, instead of just the usage text, as we do previously.

Add several tests to check that git-ls-remote handles the
no-remote-specified situation.

Also add a test that "git ls-remote <pattern>" does not work; we are
unable to guess the remote in that situation, as are git-fetch and
git-push.

In that test, we are testing for messages coming from two separate
processes, but we should be OK, because the second message is triggered
by closing the fd which must happen after the first message is printed.
(analysis by Jeff King.)

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 23:10:43 -07:00
Johannes Sixt 9374919442 Thread-safe xmalloc and xrealloc needs a recursive mutex
The mutex used to protect object access (read_mutex) may need to be
acquired recursively.  Introduce init_recursive_mutex() helper function
in thread-utils.c that constructs a mutex with the PHREAD_MUTEX_RECURSIVE
attribute.

pthread_mutex_init() emulation on Win32 is already recursive as it is
implemented on top of the CRITICAL_SECTION type, which is recursive.

    http://msdn.microsoft.com/en-us/library/ms682530%28VS.85%29.aspx

Add do-nothing compatibility wrappers for pthread_mutexattr* functions.

Initial-version-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 23:06:39 -07:00
Jeff King 4c35f0dbc4 docs: clarify "branch -l"
This option is mostly useless these days because we turn on
reflogs by default in non-bare repos.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-08 13:42:36 -07:00
Björn Gustavsson 0c3ef984fa apply: Allow blank *trailing* context lines to match beyond EOF
In 51667147be, "git apply --whitespace=fix" was extended to
allow a blank context line to match beyond the end of the file,
but only if the context line was in the leading part of the
hunk (i.e. the hunk inserted additional contents at the end
of the file).

Drop the restriction that the context line must be in the
leading part of the hunk, thus allowing a file to be changed
from:

 a
 (blank line)

to:

 b
 a
 (blank line)

Note that the blank line will be kept, because "--whitespace=fix"
only removes trailing blank lines that a hunk would add, never
trailing blank lines in the context.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-07 23:46:23 -07:00
Junio C Hamano df5753c4f6 SubmittingPatches: update GMail section
Even if you use imap-send to throw your drafts in the outbox, using their
web interface will mangle your patches.  Clarify that the imap-send is
meant to be used together with a real MUA that can use IMAP drafts, and
remove instructions related to the web interface, which is irrelevant.

Add description of send-email as an alternative.

Use --cover-letter, and do not use -C nor --no-color, on the example
command line for format-patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-07 16:04:09 -07:00
Junio C Hamano 02125bcc41 Merge branch 'mg/notes-reflog'
* mg/notes-reflog:
  refs.c: Write reflogs for notes just like for branch heads
  t3301-notes: Test the creation of reflog entries
2010-04-07 15:34:09 -07:00
Junio C Hamano d6b5af6d76 Merge branch 'jn/mailinfo-scissors'
* jn/mailinfo-scissors:
  Teach mailinfo %< as an alternative scissors mark
2010-04-07 15:34:06 -07:00
Ævar Arnfjörð Bjarmason c9b5fde759 Add option to git-commit to allow empty log messages
Change git-commit(1) to accept the --allow-empty-message option
to allow a commit with an empty message.  This is analogous to the
existing --allow-empty option which allows a commit that records
no changes.  As these are mainly for interoperating with foreign SCM
systems, and are not meant for normal use, ensure that "git commit -h"
does not talk about them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-07 15:22:57 -07:00
Jeff King e3af3cfc40 fix typos and grammar in 1.7.1 draft release notes
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-07 14:32:51 -07:00
Junio C Hamano b4ca1db968 reflog --expire-unreachable: avoid merge-base computation
The option tells the command to expire older reflog entries that refer to
commits that are no longer reachable from the tip of the ref the reflog is
associated with.  To avoid repeated merge_base() invocations, we used to
mark commits that are known to be reachable by walking the history from
the tip until we hit commits that are older than expire-total (which is
the timestamp before which all the reflog entries are expired).

However, it is a different matter if a commit is _not_ known to be
reachable and the commit is known to be unreachable.  Because you can
rewind a ref to an ancient commit and then reset it back to the original
tip, a recent reflog entry can point at a commit that older than the
expire-total timestamp and we shouldn't expire it.  For that reason, we
had to run merge-base computation when a commit is _not_ known to be
reachable.

This introduces a lazy/on-demand traversal of the history to mark
reachable commits in steps.  As before, we mark commits that are newer
than expire-total to optimize the normal case before walking reflog, but
we dig deeper from the commits the initial step left off when we encounter
a commit that is not known to be reachable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-07 11:09:12 -07:00
Brandon Casey a751b5cc96 notes.h: declare bit field as unsigned to silence compiler complaints
The IRIX MIPSPro compiler complains like this:

   cc-1107 c99: WARNING File = notes.h, Line = 215
     A signed bit field has a length of 1 bit.

           int suppress_default_notes:1;
               ^

'unsigned' is what was intended, so lets make it so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-06 21:55:50 -07:00
Junio C Hamano 016e5ff243 war on "sleep" in tests
In many places in test suite we have "sleep"s that do not have to be
there.

 - I do not simply see the point of the one in t3500.  It may be making
   sure that the timestamp order of commits generated during the test is
   stable, in which case test_tick is the right ingredient to use without
   wasting tester's time.

 - The one in t4011 is to make sure that the plumbing diff-index notices
   the stat-dirtyness of a removed then identically recreated symlink.
   Keeping the old symlink around to make sure that a newly created
   symlink gets different ino would be sufficient for that purpose.

 - The one in t7600 is to make sure that "git merge" does not get confused
   by stat-dirty "file" in the working tree.  Again, keeping the old file
   around and creating an identical copy to ensure a different ino would
   be sufficient for that purpose.

The "racy git" tests in t0010 are inherently about mtime between the index
itself and index entries.  The "sleep" in that test must stay as they are.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-06 21:55:27 -07:00
Junio C Hamano 537f6c7fb4 Git 1.7.1-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-06 15:00:01 -07:00
Junio C Hamano b807c524df Merge branch 'da/maint-python-startup'
* da/maint-python-startup:
  Makefile: Remove usage of deprecated Python "has_key" method
2010-04-06 14:50:47 -07:00
Junio C Hamano 4a8295f582 Merge branch 'ic/bash-completion-rpm'
* ic/bash-completion-rpm:
  RPM spec: include bash completion support
2010-04-06 14:50:47 -07:00
Junio C Hamano ae722b4e27 Merge branch 'sb/fmt-merge-msg'
* sb/fmt-merge-msg:
  fmt-merge-msg: hide summary option
  fmt-merge-msg: remove custom string_list implementation
  string-list: add unsorted_string_list_lookup()
  fmt-merge-msg: use pretty.c routines
  t6200: test fmt-merge-msg more
  t6200: modernize with test_tick
  fmt-merge-msg: be quiet if nothing to merge
2010-04-06 14:50:46 -07:00
Junio C Hamano 3f3f8d9d09 Merge branch 'jc/conflict-marker-size'
* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute
2010-04-06 14:50:46 -07:00
Junio C Hamano f9bdf9b210 Merge branch 'ef/maint-empty-commit-log'
* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message
2010-04-06 14:50:46 -07:00
Junio C Hamano 15bf052416 Merge branch 'sg/bash-completion'
* sg/bash-completion:
  bash: completion for gitk aliases
  bash: support user-supplied completion scripts for aliases
  bash: support user-supplied completion scripts for user's git commands
  bash: improve aliased command recognition
2010-04-06 14:50:45 -07:00
Junio C Hamano 635530a2fc log --pretty/--oneline: ignore log.decorate
Many scripts, most notably gitk, rely on output from the log family of
command not to be molested by random user configuration.  This is
especially true when --pretty=raw is given.

Just like we disable notes output unless the command line explicitly
asks for --show-notes, disable the decoration code unless --decorate is
given explicitly from the command line and --pretty or --oneline is
given.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-06 14:49:33 -07:00
Eli Barzilay 1367b12ad6 Add %B' in format strings for raw commit body in git log' and friends
Also update the documentation text and add a test.

Signed-off-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-05 23:02:33 -07:00
Junio C Hamano 8b5fe8c9ec Revert "Link against libiconv on IRIX"
Brandon Casey reports:

    Subject: Re: [PATCH] Link against libiconv on IRIX
    Date: Mon, 05 Apr 2010 11:45:32 -0500
    Message-Id: <1UypQMCHLT57SnjSQIM66RTkLalsvavG8xXoQJv4rEQ@cipher.nrlssc.navy.mil>

    This breaks compilation on IRIX 6.5.29m for me since there
    is no separate libiconv.so.

    What version of IRIX are you using?

    On my system, even the iconv utility doesn't link against
    a libiconv shared object.  It seems the iconv functionality is in libc.

       # ldd /usr/bin/iconv
	       libc.so.1  =>    /usr/lib32/libc.so.1

    Could it be that you are using a third party iconv library?
    I've experienced this on another system and the problem was related
    to curl.  In that case, curl was linked against an external iconv and
    not the native library, so if I tried to build with curl support, I had
    to also build against the external iconv library.

While we wait for an improved solution, revert the regression caused by
2170422790.
2010-04-05 10:16:11 -07:00
Junio C Hamano cf87463e79 Rename ONE_FILESYSTEM to DISCOVERY_ACROSS_FILESYSTEM
If a missing ONE_FILESYSTEM defaults to true, the only users who set this
variable set it to false to tell git not to limit the discovery to one
filesystem; there are too many negations in one sentence to make a simple
panda brain dizzy.

Use the variable GIT_DISCOVERY_ACROSS_FILESYSTEM that changes the
behaviour from the default "limit to one filesystem" to "cross the
boundary as I ask you to"; makes the semantics much more straight
forward.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 15:55:29 -07:00
Sverre Rabbelier 2cb5a48195 remote-helpers: add tests for testgit helper
[jc: with test fixes from J6t]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 14:25:43 -07:00
Chris Webb a347b17f15 whitespace: tests for git-apply --whitespace=fix with tab-in-indent
Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 14:21:54 -07:00
Chris Webb 4e35c51e51 whitespace: add tab-in-indent support for --whitespace=fix
If tab-in-indent is set, --whitespace=fix will ensure that any stray tabs in
the initial indent are expanded to the correct number of space characters.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 14:21:54 -07:00
Chris Webb d511bd330d whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst
To implement --whitespace=fix for tab-in-indent, we have to allow for the
possibility that whitespace can increase in size when it is fixed, expanding
tabs to to multiple spaces in the initial indent.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 14:21:54 -07:00
Chris Webb b27eb49948 whitespace: tests for git-diff --check with tab-in-indent error class
[jc: with test fixes from J6t]

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 14:21:00 -07:00
Junio C Hamano e640551773 GIT_ONE_FILESYSTEM: flip the default to stop at filesystem boundaries
Regarding the new environment variable, Linus Torvalds
<torvalds@linux-foundation.org> writes on Tue, 30 Mar 2010 in
<alpine.LFD.2.00.1003301537150.3707@i5.linux-foundation.org>:

    I suspect that it is _very_ unusual to have a source repo that crosses
    multiple filesystems, and the original reason for this patch-series
    seems to me to be likely to be more common than that multi-fs case. So
    having the logic go the other way would seem to match the common case,
    no?

The "crossing filesystem boundary" condition is checked by comparing
st_dev field in the result from stat(2).  This is slightly worrysome if
non-POSIX ports return different values in the field even for directories
in the same work tree extracted to the same "filesystem".  Erik Faye-Lund
confirms that in the msysgit port st_dev is 0, so this should be safe, as
"even Windows is safe" ;-)

This will affect those who use /.git to cram /etc and /home/me in the same
repostiory, /home is mounted from non-root filesystem, and a git operation
is done from inside /home/me/src.  But that is such a corner case we don't
want to give preference over helping people who will benefit from having
this default so that they do not have to suffer from slow automounters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:33:53 -07:00
Junio C Hamano 11766ca4a8 Merge branch 'maint'
* maint:
  pack-protocol.txt: fix pkt-line lengths
  pack-protocol.txt: fix spelling
2010-04-04 10:23:21 -07:00
Tay Ray Chuan c8a97906ba pack-protocol.txt: fix pkt-line lengths
Previously, the lengths were 4-bytes short. Fix it such that the lengths
reflect the total length of the pkt-line, as per spec.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:18:21 -07:00
Tay Ray Chuan 8e50175d94 pack-protocol.txt: fix spelling
s/paramater/parameter/.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:18:19 -07:00
Jonathan Nieder 9974e290e7 Teach mailinfo %< as an alternative scissors mark
Handle perforations found “in the wild” more robustly by recognizing
“%<” as an alternative scissors mark.

This feature is only meant to support old habits.  Discourage new use
of the percent-based version by only documenting the 8< symbol so new
users’ perforations can still be recognized by old versions of Git.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-04 10:17:55 -07:00
Junio C Hamano 9234b00372 Merge branch 'mb/rebase-i-no-ff'
* mb/rebase-i-no-ff:
  Teach rebase the --no-ff option.

Conflicts:
	git-rebase--interactive.sh
	t/t3404-rebase-interactive.sh
2010-04-03 12:28:44 -07:00
Junio C Hamano 7b1cb5c40e Merge branch 'sp/maint-http-backend-die-triggers-die-recursively'
* sp/maint-http-backend-die-triggers-die-recursively:
  http-backend: Don't infinite loop during die()
2010-04-03 12:28:43 -07:00
Junio C Hamano 9b5a7c447b Merge branch 'rr/imap-send-unconfuse-from-line'
* rr/imap-send-unconfuse-from-line:
  imap-send: Remove limitation on message body
2010-04-03 12:28:42 -07:00
Junio C Hamano aa4beff4b5 Merge branch 'mg/use-default-abbrev-length-in-rev-list'
* mg/use-default-abbrev-length-in-rev-list:
  rev-list: use default abbrev length when abbrev-commit is in effect
2010-04-03 12:28:42 -07:00