Commit graph

22126 commits

Author SHA1 Message Date
Junio C Hamano d8c416b251 blame documentation: -M/-C notice copied lines as well as moved ones
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11 12:17:42 -07:00
Stephen Boyd fe90c93bee t3507: Make test executable
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-11 12:13:13 -07:00
Jonathan Nieder ce8b54d676 t7400: clarify submodule update tests
In particular, add a missing && to the update --init test.

The goal is to make it clearer what happened when one of these
tests fails.  The update --init test is currently (consistently)
failing on a few unusual machines.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 21:36:07 -07:00
Jonathan Nieder a76c944bbe t7400: clarify 'submodule add' tests
A new reader may not realize what properties the $submodurl
repository needs to have.

One of the tests is checking that ‘submodule add -b foo’ creates
a ‘foo’ branch.  Put this test in context by checking that
without -b, no ‘foo’ branch is created.

While at it, make sure each added submodule is a reasonable
repository, with clean index, no stray files, and so on.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 21:30:59 -07:00
Jonathan Nieder fe454b1315 t7400: split setup into multiple tests
The setup in t7400-submodule-basic does a number of different
things to support different tests.  Splitting it up makes the
test a little easier to read and should provide an opportunity
to move each piece of setup closer to the tests that require it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 21:24:43 -07:00
Henrik Grubbström ec775c41dc attr: Expand macros immediately when encountered.
When using macros it is otherwise hard to know whether an
attribute set by the macro should override an already set
attribute. Consider the following .gitattributes file:

[attr]mybinary	binary -ident
*		ident
foo.bin		mybinary
bar.bin		mybinary ident

Without this patch both foo.bin and bar.bin will have
the ident attribute set, which is probably not what
the user expects. With this patch foo.bin will have an
unset ident attribute, while bar.bin will have it set.

Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 18:36:00 -07:00
Henrik Grubbström 969f9d7322 attr: Allow multiple changes to an attribute on the same line.
When using macros it isn't inconceivable to have an attribute
being set by a macro, and then being reset explicitly.

Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 18:36:00 -07:00
Henrik Grubbström 426c27b7c0 attr: Fixed debug output for macro expansion.
When debug_set() was called during macro expansion, it
received a pointer to a struct git_attr rather than a
string.

Signed-off-by: Henrik Grubbström <grubba@grubba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 18:35:59 -07:00
Junio C Hamano b9aa901856 Git 1.7.1-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 13:05:16 -07:00
Junio C Hamano b92cbb62de Merge branch 'mr/gitweb-jsmin'
* mr/gitweb-jsmin:
  gitweb: update INSTALL to use shorter make target
  gitweb: add documentation to INSTALL regarding gitweb.js
  instaweb: add minification awareness
  Gitweb: add autoconfigure support for minifiers
  Gitweb: add support for minifying gitweb.css
  Gitweb: add ignore and clean rules for minified files
2010-04-10 13:02:22 -07:00
Brian Gernhardt 69cf7bfd13 send-email: Cleanup smtp-domain and add config
The way the code stored --smtp-domain was unlike its handling of other
similar options.  Bring it in line with the others by:

- Renaming $mail_domain to $smtp_domain to match the command line
  option. Also move its declaration from near the top of the file to
  near other option variables.

- Removing $mail_domain_default.  The variable was used once and only
  served to move the default away from where it gets used.

- Adding a sendemail.smtpdomain config option.  smtp-domain was the
  only SMTP configuration option that couldn't be set in the user's
  .gitconfig.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 13:01:23 -07:00
Brian Gernhardt 79ca070ce5 Document send-email --smtp-domain
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 13:01:21 -07:00
Brian Gernhardt 59a8630338 send-email: Don't use FQDNs without a '.'
Although Net::Domain::domainname attempts to be very thorough, the
host's configuration can still refuse to give a FQDN.  Check to see if
what we receive contains a dot as a basic sanity check.

Since the same condition is used twice and getting complex, let's move
it to a new function.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 13:01:20 -07:00
Brian Gernhardt 68ce93307f send-email: Cleanup { style
As Jakub Narebski pointed out on the list, Perl code usually prefers

  sub func {
  }

over

  sub func
  {
  }

git-send-email.perl is somewhat inconsistent in its style, with 23
subroutines using the first style and 6 using the second.  Convert the
few odd subroutines so that the code matches normal Perl style.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 13:01:17 -07:00
Junio C Hamano 055e1e2969 Merge branch 'jl/maint-submodule-gitfile-awareness'
* jl/maint-submodule-gitfile-awareness:
  Teach diff --submodule and status to handle .git files in submodules
2010-04-10 12:13:46 -07:00
Jens Lehmann eee49b6ce4 Teach diff --submodule and status to handle .git files in submodules
The simple test for an existing .git directory gives an incorrect result
if .git is a file that records "gitdir: overthere". So for submodules that
use a .git file, "git status" and the diff family - when the "--submodule"
option is given - did assume the submodule was not populated at all when
a .git file was used, thus generating wrong output or no output at all.

This is fixed by using read_gitfile_gently() to get the correct location
of the .git directory. While at it, is_submodule_modified() was cleaned up
to use the "dir" member of "struct child_process" instead of setting the
GIT_WORK_TREE and GIT_DIR environment variables.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 11:51:56 -07:00
Junio C Hamano 2381e39e5f status: --ignored option shows ignored files
There is no stronger reason behind the choice of "!!" than just I happened
to have typed them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 00:43:59 -07:00
Junio C Hamano 1b908b6fb4 wt-status: rename and restructure status-print-untracked
I will be reusing this to show ignored stuff in the next patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 00:43:59 -07:00
Junio C Hamano 6cb3f6b282 wt-status: collect ignored files
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 00:43:59 -07:00
Junio C Hamano f5b26b1d14 wt-status: plug memory leak while collecting untracked files
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 00:43:59 -07:00
Junio C Hamano e28a243b00 wt-status: remove unused workdir_untracked member
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-10 00:43:59 -07:00
Junio C Hamano 3b0c19663e Merge branch 'maint'
* maint:
  Let check_preimage() use memset() to initialize "struct checkout"
  fetch/push: fix usage strings
2010-04-09 22:43:18 -07:00
Jens Lehmann 54fd955c21 Let check_preimage() use memset() to initialize "struct checkout"
Every code site except check_preimage() uses either memset() or declares
a static instance of "struct checkout" to achieve proper initialization.
Lets use memset() instead of explicit initialization of all members here
too to be on the safe side in case this structure is expanded someday.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-09 22:42:57 -07:00
Junio C Hamano 408dee5222 Merge branch 'ef/maint-empty-commit-log' into maint
* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message
2010-04-09 22:38:53 -07:00
Junio C Hamano daaf2e8892 Merge branch 'jc/conflict-marker-size' into maint
* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute
2010-04-09 22:38:34 -07:00
Junio C Hamano 326bea47cb Merge branch 'sp/maint-http-backend-die-triggers-die-recursively' into maint
* sp/maint-http-backend-die-triggers-die-recursively:
  http-backend: Don't infinite loop during die()
2010-04-09 22:38:16 -07:00
Junio C Hamano fe7e37235d Merge branch 'mg/maint-send-email-lazy-editor' into maint
* mg/maint-send-email-lazy-editor:
  send-email: lazily assign editor variable
2010-04-09 22:23:04 -07:00
Junio C Hamano 2e5a40f0b5 Merge branch 'rr/imap-send-unconfuse-from-line' into maint
* rr/imap-send-unconfuse-from-line:
  imap-send: Remove limitation on message body
2010-04-09 22:22:44 -07:00
Junio C Hamano 581b26c82d Merge branch 'rb/maint-python-path' into maint
* rb/maint-python-path:
  Correct references to /usr/bin/python which does not exist on FreeBSD
2010-04-09 22:22:19 -07:00
Junio C Hamano 5d4bd79d80 Merge branch 'gh/maint-stash-show-error-message' into maint
* gh/maint-stash-show-error-message:
  Improve error messages from 'git stash show'
2010-04-09 22:22:14 -07:00
Junio C Hamano e80014a13e Merge branch 'mg/mailmap-update' into maint
* mg/mailmap-update:
  .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela
2010-04-09 22:22:06 -07:00
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