Commit graph

9673 commits

Author SHA1 Message Date
Shawn O. Pearce ff06c743dc Improve request-pull to handle non-rebased branches
This is actually a few different changes to request-pull,
making it slightly smarter:

 1) Minor cleanup of revision->base variable names, making it
    follow the head/headrev naming convention that is already
    in use.

 2) Compute the merge-base between the two revisions upfront
    and reuse that selected merge-base to create the diffstat.

 3) Refuse to generate a pull request for branches that have no
    existing relationship.  These aren't very common and would mess
    up our diffstat generation.

 4) Disable the PAGER when running shortlog and diff, as these
    would otherwise activate the pager for each command when
    git-request-pull is run on a tty.  Instead users can get the
    entire output paged (if desired) using `git -p request-pull`.

 5) Use shortlog rather than `git log | git shortlog` now that
    recent shortlog versions are able to run the revision listing
    internally.

 6) Attempt to resolve the input URL using the user's configured
    remotes.  This is useful if the URL you want the recipient to
    see is also the one you used to push your changes.  If not a
    config-file remote could easily be setup for the public URL
    and request-pull could be passed that name instead.

 7) Automatically guess and include the remote branch name in the
    body of the message.  We list the branch name immediately after
    the URL, making it easy for the recipient to copy and paste
    the entire line onto a `git pull` command line.  Rumor has it
    Linus likes this format, for exactly that reason.

    If multiple branches at the remote match $headrev we take the
    first one returned by peek-remote and assume it is suitable.

    If no branches are available we warn the user about the problem,
    but insert a static string that is not a valid branch name
    and would be obvious to anyone reading the message as being
    totally incorrect.  This allows users to still generate a
    template message without network access (for example) and
    hand-correct the bits that cannot be verified.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 23:27:03 -07:00
Junio C Hamano 9aae177a4a Merge branch 'maint'
* maint:
  gitweb: use decode_utf8 directly
  posix compatibility for t4200
  Document 'opendiff' value in config.txt and git-mergetool.txt
  Allow PERL_PATH="/usr/bin/env perl"
  Make xstrndup common
  diff.c: fix "size cache" handling.
  http-fetch: Disable use of curl multi support for libcurl < 7.16.
2007-05-03 23:26:54 -07:00
Ismail Dönmez e3ad95a8be gitweb: use decode_utf8 directly
Using decode() tries to decode data that is already UTF-8 and
borks, but decode_utf8 from Encode.pm has a built-in safety
against that.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 23:22:12 -07:00
Bryan Larsen c256acb8fb posix compatibility for t4200
Fix t4200 so that it also works on OS X by not relying on gnu
extensions to sed.

Signed-off-by: Bryan Larsen <bryan@larsen.st>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:58:01 -07:00
Arjen Laarhoven e4e92b3f4b Document 'opendiff' value in config.txt and git-mergetool.txt
Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:56:23 -07:00
Bryan Larsen 5318f69812 Allow PERL_PATH="/usr/bin/env perl"
There is a mechanism PERL_PATH in the Makefile to specify path to
Perl binary, but sometimes it is convenient to let 'env' figure
out where Perl comes from, with PERL_PATH="/usr/bin/env perl".

Allowing this would make things easier to MacPorts, where we wish
to work with the MacPorts perl if it is installed, but fall back
to the system perl if it isn't.

Signed-off-by: Bryan Larsen <bryan@larsen.st>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:36:32 -07:00
Daniel Barkalow 5094102e13 Make xstrndup common
This also improves the implementation to match how strndup is
specified (by GNU): if the length given is longer than the string,
only the string's length is allocated and copied, but the string need
not be null-terminated if it is at least as long as the given length.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:28:55 -07:00
Junio C Hamano cdda666201 diff.c: fix "size cache" handling.
We broke the size-cache handling when we changed the function
signature of sha1_object_info() in 21666f1a.  We obviously
wanted to cache the size we obtained when sha1_object_info()
succeeded, not when it failed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:12:40 -07:00
Alexandre Julliard 9cf04301b1 http-fetch: Disable use of curl multi support for libcurl < 7.16.
curl_multi_remove_handle() is broken in libcurl < 7.16, in that it
doesn't correctly update the active handles count when a request is
aborted. This causes the transfer to hang forever waiting for the
handle count to become less than the number of active requests.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 22:12:40 -07:00
Junio C Hamano 50acc58914 blame: use .mailmap unconditionally
There really isn't any point in turning off .mailmap.  The
number of mailmap lookups are bounded by number of lines in the
target file, and the real blame processing is much more
expensive.  If it turns out to be too costly, we should optimize
the mailmap lookup itself, instead of avoiding the call.

If the author information of commits of the project are
relatively clean, .mailmap would have only small number of
entries, and the overhead of looking it up will not be high.  On
the other hand, if the author information is really screwed up
that a good .mailmap needs to be maintained to run shortlog,
giving uncleaned names in blame output is not helpful at all
either.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-03 00:03:15 -07:00
Junio C Hamano 6644d2f2c4 Merge branch 'maint'
* maint:
  cvsserver: Handle re-added files correctly
  Fix compilation of test-delta
2007-05-02 11:27:31 -07:00
Junio C Hamano 7a33b0bfce Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
* 'maint' of git://repo.or.cz/git/fastimport:
  Teach import-tars about GNU tar's @LongLink extension.
2007-05-02 11:00:16 -07:00
Frank Lichtenheld a7da9adb1f cvsserver: Handle re-added files correctly
We can't unconditionally assign revision 1.1 to
newly added files. In case the file did exist in the
past and was deleted we need to honor the old
revision number.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-02 10:41:52 -07:00
Shawn O. Pearce b3431bc603 Don't use seq in tests, not everyone has it
For example Mac OS X lacks the seq command.  So we cannot use it
there.  A good old while loop works just as good.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-02 13:24:23 -04:00
Shawn O. Pearce cbc6bdab08 Reuse fixup_pack_header_footer in index-pack
Now that fast-import is using a "library function" to handle
correcting its packfile's object count and trailing SHA-1 we
should reuse the same function in index-pack, to reduce the
size of the code we must maintain.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-02 13:24:21 -04:00
Dana L. How 8b0eca7c7b Create pack-write.c for common pack writing code
Include a generalized fixup_pack_header_footer() in this new file.
Needed by git-repack --max-pack-size feature in a later patchset.

[sp: Moved close(pack_fd) to callers, to support index-pack, and
     changed name to better indicate it is for packfiles.]

Signed-off-by: Dana L. How <danahow@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-02 13:24:18 -04:00
Shawn O. Pearce db81e67a7d Merge branch 'gfi-maint' into gfi-master
* gfi-maint:
  Teach import-tars about GNU tar's @LongLink extension.
2007-05-02 13:24:10 -04:00
Johannes Schindelin 775477aa1d Teach import-tars about GNU tar's @LongLink extension.
This extension allows GNU tar to process file names in excess of the 100
characters defined by the original tar standard. It does this by faking a
file, named '././@LongLink' containing the true file name, and then adding
the file with a truncated name. The idea is that tar without this
extension will write out a file with the long file name, and write the
contents into a file with truncated name.

Unfortunately, GNU tar does a lousy job at times. When truncating results
in a _directory_ name, it will happily use _that_ as a truncated name for
the file.

An example where this actually happens is gcc-4.1.2, where the full path
of the file WeThrowThisExceptionHelper.java truncates _exactly_ before the
basename. So, we have to support that ad-hoc extension.

This bug was noticed by Chris Riddoch on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-02 13:22:34 -04:00
Martin Koegler adb7b5fc86 Fix compilation of test-delta
The code used write_in_full() without pulling its declarations from the
header file.  When header is included, usage[] collides with usage()
function.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-01 02:59:08 -07:00
Junio C Hamano 4c16112494 GIT v1.5.2-rc1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 17:30:02 -07:00
Junio C Hamano 07c785dbb7 Merge branch 'maint'
* maint:
  GIT v1.5.1.3
  send-email documentation: clarify --smtp-server
  git.7: Mention preformatted html doc location
  Clarify SubmittingPatches Checklist
  git-svn: Add 'find-rev' command
  Fix symlink handling in git-svn, related to PerlIO
2007-04-30 17:16:19 -07:00
Junio C Hamano b5cc62f701 GIT v1.5.1.3
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 17:09:48 -07:00
Alex Riesen fe5d30b630 Include mailmap.h in mailmap.c to catch mailmap interface changes
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:57:59 -07:00
Alex Riesen e44b5d106c Remove pointless calls to access(2) when checking for .mailmap
read_mailmap already returns not 0 in case of error, and nothing
seem to be interested in it. It also is silent about the fact
(read_mailmap being to chatty would justify the call to access,
but there is no point for it to be and it isn't).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:57:52 -07:00
Alex Riesen 8503ee4394 Fix read_mailmap to handle a caller uninterested in repo abbreviation
The only such a caller builtin-blame.c would pass NULL as the place
where to store the abbreviation.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:57:50 -07:00
Alex Riesen 600682aaa1 Use strlcpy instead of strncpy in mailmap.c
strncpy does not NUL-terminate output in case of output buffer too short,
and map_email prototype (and usage) does not allow for figuring out
what the length of the name is.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:57:47 -07:00
Jari Aalto 928a559000 send-email documentation: clarify --smtp-server
It can be either hostname/address, or a full path to a
local executable.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:50:55 -07:00
Jari Aalto 34b604af29 git.7: Mention preformatted html doc location
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:43:12 -07:00
Jari Aalto a7af09d2db Clarify SubmittingPatches Checklist
Separate things to be checked when making commits, and things
to be checked when sending patches.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 16:39:18 -07:00
Adam Roben b3cb7e4582 git-svn: Add 'find-rev' command
This patch adds a new 'find-rev' command to git-svn that lets you easily
translate between SVN revision numbers and git tree-ish.

Signed-off-by: Adam Roben <aroben@apple.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-30 15:58:37 -07:00
Junio C Hamano bcd8ee5b43 Fix symlink handling in git-svn, related to PerlIO
After reading the leading contents from a symlink data obtained
from subversion, which we expect to begin with 'link ', the code
forked to hash the remainder (which should match readlink()
result) using git-hash-objects, by redirecting its STDIN from
the filehandle we read that 'link ' from.  This was Ok with Perl
on modern Linux, but on Mac OS, the read in the parent process
slurped more than we asked for in stdio buffer, and the child
did not correctly see the "remainder".

This attempts to fix the issue by using lower level sysseek and
sysread instead of seek and read to bypass the stdio buffer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Acked-by: Seth Falcon <sethfalcon@gmail.com>
2007-04-30 15:50:13 -07:00
Junio C Hamano a07157ac62 Merge branch 'jc/attr'
* jc/attr:
  Add 'filter' attribute and external filter driver definition.
  Add 'ident' conversion.
2007-04-29 11:01:27 -07:00
Junio C Hamano 96651ef508 Make sure test-genrandom and test-chmtime are builtas part of the main build.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:11 -07:00
Junio C Hamano e0173ad9fc Make macros to prevent double-inclusion in headers consistent.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:11 -07:00
Junio C Hamano f95673849c Apply mailmap in git-blame output.
This makes git-blame to use the same mailmap used by
git-shortlog.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:06 -07:00
Junio C Hamano 7c1c6782e0 Split out mailmap handling out of shortlog
This splits out a few functions to deal with mailmap from
shortlog and makes it a bit more usable from other programs.
Most notably, it does not clobber input e-mail address anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:06 -07:00
Junio C Hamano 093dc5bee6 blame -s: suppress author name and time.
With this "git blame -b -s HEAD~n..HEAD" becomes a nicer way to
review the result of recent changes in context.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:06 -07:00
Josh Triplett 28a94f885a Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL
Some other programs get the user's email address from $EMAIL, so fall back to
that if we don't have a Git-specific email address.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 02:05:06 -07:00
Junio C Hamano 25dc5e2995 Merge commit 'gfi/master'
* commit 'gfi/master':
2007-04-29 01:54:28 -07:00
Junio C Hamano 39231b1c32 Merge branch 'maint'
* maint:
  http.c: Fix problem with repeated calls of http_init
  Add missing reference to GIT_COMMITTER_DATE in git-commit-tree documentation
  Fix import-tars fix.
  Update .mailmap with "Michael"
  Do not barf on too long action description
  Catch empty pathnames in trees during fsck
  Don't allow empty pathnames in fast-import
  import-tars: be nice to wrong directory modes
  git-svn: Added 'find-rev' command
  git shortlog documentation: add long options and fix a typo
2007-04-29 01:52:43 -07:00
Julian Phillips e9d54bd18b http.c: Fix problem with repeated calls of http_init
Calling http_init after calling http_cleanup causes a segfault.  This
is due to the pragma_header curl_slist being freed but not being set
to NULL.  The subsequent call to http_init tries to setup the slist
again, but it now points to an invalid memory location.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:34:59 -07:00
Josh Triplett 4e58bf970b Add missing reference to GIT_COMMITTER_DATE in git-commit-tree documentation
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:34:59 -07:00
Junio C Hamano d0c32b6339 Fix import-tars fix.
This heeds advice from our resident Perl expert to make sure
the script is not confused with a string that ends with /\n

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:34:59 -07:00
Junio C Hamano 2342c4ee14 Update .mailmap with "Michael"
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:34:59 -07:00
Junio C Hamano 4e6380e5c3 Do not barf on too long action description
Reflog message is primarily about easier identification, and
leaving truncated entry is much better than dying.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:33:13 -07:00
Junio C Hamano 5b5fe9a526 Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
* 'maint' of git://repo.or.cz/git/fastimport:
  Don't allow empty pathnames in fast-import
  import-tars: be nice to wrong directory modes
2007-04-28 18:15:00 -07:00
Shawn O. Pearce cb2cada6da Catch empty pathnames in trees during fsck
Released versions of fast-import have been able to create a tree that
contains files or subtrees that contain no name.  Unfortunately these
trees aren't valid, but people may have actually tried to create them
due to bugs in import-tars.perl or their own fast-import frontend.

We now look for this unusual condition and warn the user if at
least one of their tree objects contains the problem.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-28 18:06:00 -07:00
Shawn O. Pearce aff787b52b Merge branch 'gfi-maint' into gfi-master
* gfi-maint:
  Don't allow empty pathnames in fast-import
  import-tars: be nice to wrong directory modes
2007-04-28 20:05:58 -04:00
Shawn O. Pearce ec771a7084 Merge commit 'jc/maint' into gfi-maint
* commit 'jc/maint': (35 commits)
  Update git-http-fetch documentation
  Update git-local-fetch documentation
  Update git-http-push documentation
  Update -L documentation for git-blame/git-annotate
  Update git-grep documentation
  Update git-fmt-merge documentation
  Document additional options for git-fetch
  Removing -n option from git-diff-files documentation
  Start preparing for 1.5.1.3
  Sanitize @to recipients.
  git-svn: Ignore usernames in URLs in find_by_url
  Document --dry-run and envelope-sender for git-send-email.
  Allow users to optionally specify their envelope sender.
  Ensure clean addresses are always used with Net::SMTP
  Validate @recipients before using it for sendmail and Net::SMTP.
  Perform correct quoting of recipient names.
  Change the scope of the $cc variable as it is not needed outside of send_message.
  Debugging cleanup improvements
  Prefix Dry- to the message status to denote dry-runs.
  Document --dry-run parameter to send-email.
  ...
2007-04-28 20:05:20 -04:00
Shawn O. Pearce 475d1b333a Don't allow empty pathnames in fast-import
riddochc on #git noticed corruption caused by import-tars.  This
was fixed in the prior commit by Dscho, but fast-import was wrong
to have allowed a tree to be created with an empty string as the
filename.  No operating system allows this, and Git itself doesn't
accept this into the index.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-04-28 20:03:25 -04:00