1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 15:28:21 +01:00
Commit graph

19412 commits

Author SHA1 Message Date
Junio C Hamano
64d5fe0a23 Merge branch 'lt/block-sha1'
* lt/block-sha1:
  block-sha1/sha1.c: silence compiler complaints by casting void * to char *
  block-sha1: more good unaligned memory access candidates
  block-sha1: support for architectures with memory alignment restrictions
  block-sha1: split the different "hacks" to be individually selected
  block-sha1: move code around
  block-sha1: improve code on large-register-set machines
  block-sha1: improved SHA1 hashing
  block-sha1: perform register rotation using cpp
  block-sha1: get rid of redundant 'lenW' context
  block-sha1: Use '(B&C)+(D&(B^C))' instead of '(B&C)|(D&(B|C))' in round 3
  block-sha1: macroize the rounds a bit further
  block-sha1: re-use the temporary array as we calculate the SHA1
  block-sha1: make the 'ntohl()' part of the first SHA1 loop
  block-sha1: minor fixups
  block-sha1: try to use rol/ror appropriately
  block-sha1: undo ctx->size change
  Add new optimized C 'block-sha1' routines
2009-08-16 04:14:32 -07:00
Junio C Hamano
2f74fb56c4 Merge branch 'bc/maint-am-email'
* bc/maint-am-email:
  git-am: print fair error message when format detection fails
  am: allow individual e-mail files as input
2009-08-16 04:13:22 -07:00
Junio C Hamano
228f9c9a9f Merge branch 'js/maint-cover-letter-non-ascii'
* js/maint-cover-letter-non-ascii:
  Correctly mark cover letters' encodings if they are not pure ASCII
  Expose the has_non_ascii() function
2009-08-16 04:13:18 -07:00
Junio C Hamano
14683af812 Merge branch 'jc/maint-clean-nested-dir-safety'
* jc/maint-clean-nested-dir-safety:
  clean: require double -f options to nuke nested git repository and work tree
2009-08-16 04:13:13 -07:00
Junio C Hamano
b21f9e7f86 Merge branch 'jk/maint-merge-msg-fix'
* jk/maint-merge-msg-fix:
  merge: indicate remote tracking branches in merge message
  merge: fix incorrect merge message for ambiguous tag/branch
  add tests for merge message headings
2009-08-16 04:13:04 -07:00
Junio C Hamano
1d7d6ad539 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Parse arbitrary commit-ish in SHA1 field
  gitk: Fix direction of symmetric difference in optimized mode
  gitk: New option to hide remote refs
  gitk: Do not hard-code "encoding" in attribute lookup functions
2009-08-16 03:46:51 -07:00
Dirk Hoerner
b2139dbd72 git-cvsimport: add support for cvs pserver password scrambling.
Instead of a cleartext password, the CVS pserver expects a scrambled one
in the authentication request. With this patch it is possible to import
CVS repositories only accessible via pserver and user/password.

Signed-off-by: Dirk Hoerner <dirker@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-14 19:49:35 -07:00
Benjamin Kramer
67e56eca34 gitweb: Optimize git-favicon.png
Reduce size of git-favicon.png using a combination of optipng and
pngout. From 164 bytes to 115 bytes (30% reduction). Also reduce
git-logo.png's size by one byte using advcomp.

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-14 19:49:31 -07:00
Brandon Casey
a12218572f block-sha1/sha1.c: silence compiler complaints by casting void * to char *
Some compilers produce errors when arithmetic is attempted on pointers to
void.  We want computations done on byte addresses, so cast them to char *
to work them around.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-14 19:13:00 -07:00
Junio C Hamano
5a3669340b Merge branch 'jn/gitweb-blame' (early part)
* 'jn/gitweb-blame' (early part):
  gitweb: Use light/dark for class names also in 'blame' view
  gitweb: Add author initials in 'blame' view, a la "git gui blame"
  gitweb: Mark commits with no "previous" in 'blame' view
  gitweb: Use "previous" header of git-blame -p in 'blame' view
  gitweb: Mark boundary commits in 'blame' view
  gitweb: Make .error style generic
2009-08-14 16:32:52 -07:00
Nicolas Pitre
ee7dc310af block-sha1: more good unaligned memory access candidates
In addition to X86, PowerPC and S390 are capable of unaligned memory
accesses.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-13 10:41:02 -07:00
Thomas Rast
9bf3acfada gitk: Parse arbitrary commit-ish in SHA1 field
We only accepted either SHA1s or heads/tags that have been read.  This
meant the user could not, e.g., enter HEAD to go back to the current
commit.

This adds code to call out to git rev-parse --verify if all other
methods of interpreting the string the user entered fail.
(git-rev-parse alone is not enough as we really want a single
revision.)

The error paths change slighly, because we now know from the rev-parse
invocation whether the expression was valid at all.  The previous
"unknown" path is now only triggered if the revision does exist, but
is not in the current view display.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-08-13 21:49:12 +10:00
Thomas Rast
2b1fbf90aa gitk: Fix direction of symmetric difference in optimized mode
ee66e08 (gitk: Make updates go faster, 2008-05-09) implemented an
optimized mode where gitk parses the arguments with rev-parse, and
manually reads history in chunks.  As mentioned in the commit message,
symmetric differences are a problem there:

    One wrinkle is that we have to turn symmetric diff arguments (of the
    form a...b) back into symmetric diff form so that --left-right still
    works, as git rev parse turns a...b into a b ^merge_base(a,b).

However, git-rev-parse returns a...b in the swapped order

    b a ^merge_base(a,b)

This has been the case since at least 1f8115b (the state of master at
the time of the abovementioned ee66e08; Merge branch 'maint',
2008-05-08).  So gitk flipped the sides of symmetric differences
whenever it was in optimized mode.

Fix this by swapping the sides of the reconstruction code.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-08-13 21:49:11 +10:00
Thomas Rast
ffe15297b0 gitk: New option to hide remote refs
In repositories with lots of remotes, looking at the history in gitk
can be borderline insane with all the red labels for remote refs.
Introduce a new option in the preferences that makes gitk ignore
remote refs entirely, so they don't take up space in the display.

Wished-for-by: Thell Fowler <tbfowler4@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-08-13 21:49:10 +10:00
Johannes Sixt
097e111822 gitk: Do not hard-code "encoding" in attribute lookup functions
Commit 39ee47e (Clean up file encoding code and add enable/disable option,
2008-10-15) rewrote the attribute lookup functions gitattr and
cache_gitattr, but in the process hard-coded the attribute name "encoding"
instead of using the functions' parameters. This fixes it.

This is not a serious regression because currently all callers look only
for "encoding".

Further note that this fix assumes that future callers will not pass an
attribute name that contains regex special characters.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-08-13 21:49:09 +10:00
Eric Wong
c83f4e6864 svn: (cleanup) use predefined constant for rev_map_fmt
This makes life easier in case we ever need to change the
internal format of the rev_maps.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-12 22:22:45 -07:00
Adam Brewster
6f5748e14c svn: allow branches outside of refs/remotes
It may be convenient for some users to store svn remote tracking
branches outside of the refs/remotes/ heirarchy.

To accomplish this feat, this patch includes the entire path to
the ref in $r->{'refname'} in &read_all_remotes and tries to change
references to this entry so the new value makes sense.

[ew: fixed backwards compatibility, long lines]

Signed-off-by: Adam Brewster <adambrewster@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-12 22:17:56 -07:00
Eric Wong
b186a261b1 svn: initial "master" points to trunk if possible
Since "trunk" is a convention for the main development branch in
the SVN world, try to make that the master branch upon initial
checkout if it exists.  This is probably less surprising based
on user requests.

t9135 was the only test which relied on the previous behavior
and thus needed to be modified.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-12 21:41:09 -07:00
Junio C Hamano
6ffd781226 Merge branch 'maint'
* maint:
  push: point to 'git pull' and 'git push --force' in case of non-fast forward
  Documentation: add: <filepattern>... is optional
  Change mentions of "git programs" to "git commands"
  Documentation: merge: one <remote> is required
  help.c: give correct structure's size to memset()
2009-08-12 16:36:04 -07:00
Junio C Hamano
2cd9c2aff0 Merge branch 'maint-1.6.3' into maint
* maint-1.6.3:
  Change mentions of "git programs" to "git commands"
  Documentation: merge: one <remote> is required
  help.c: give correct structure's size to memset()
2009-08-12 16:15:55 -07:00
Matthieu Moy
07436e43da push: point to 'git pull' and 'git push --force' in case of non-fast forward
'git push' failing because of non-fast forward is a very common situation,
and a beginner does not necessarily understand "fast forward" immediately.

Add a new section to the git-push documentation and refer them to it.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 16:15:47 -07:00
Paul Bolle
e89df7dcda Documentation: add: <filepattern>... is optional
<filepattern>... is optional (e.g. when the --all or --update
options are used) so use square brackets in the synopsis.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 16:15:47 -07:00
Ori Avtalion
57f6ec0290 Change mentions of "git programs" to "git commands"
Most of the docs and printouts refer to "commands" when discussing what
the end users call via the "git" top-level program. We should refer them
as "git programs" when we discuss the fact that the commands are
implemented as separate programs, but in other contexts, it is better to
use the term "git commands" consistently.

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 16:14:41 -07:00
Paul Bolle
22f1fb66be Documentation: merge: one <remote> is required
merge only requires one <remote>, so "<remote>..." should be used in the
synopsis (and not "<remote> <remote>...").

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 16:14:32 -07:00
Johan Herland
0b74f5dc3a help.c: give correct structure's size to memset()
These two structures are of the same type, but we'd better be consistent.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 16:14:31 -07:00
Jeff King
19a7fcbf16 allow pull --rebase on branch yet to be born
When doing a "pull --rebase", we check to make sure that the index and
working tree are clean. The index-clean check compares the index against
HEAD. The test erroneously reports dirtiness if we don't have a HEAD yet.

In such an "unborn branch" case, by definition, a non-empty index won't
be based on whatever we are pulling down from the remote, and will lose
the local change.  Just check if $GIT_DIR/index exists and error out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 15:50:09 -07:00
Nicolas Pitre
660231aa97 block-sha1: support for architectures with memory alignment restrictions
This is needed on architectures with poor or non-existent unaligned memory
support and/or no fast byte swap instruction (such as ARM) by using byte
accesses to memory and shifting the result together.

This also makes the code portable, therefore the byte access methods are
the defaults.  Any architecture that properly supports unaligned word
accesses in hardware simply has to enable the alternative methods.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 13:36:32 -07:00
Nicolas Pitre
dc52fd2973 block-sha1: split the different "hacks" to be individually selected
This is to make it easier for them to be selected individually depending
on the architecture instead of the other way around i.e. having each
architecture select a list of hacks up front.  That makes for clearer
documentation as well.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 13:35:54 -07:00
Nicolas Pitre
30ba0de726 block-sha1: move code around
Move the code around so specific architecture hacks are defined first.
Also make one line comments actually one line.  No code change.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-12 13:32:54 -07:00
Junio C Hamano
efd1796838 Merge branch 'maint'
* maint:
  Fix typos in git-remote.txt and git-symbolic-ref.txt
  git-instaweb: fix mod_perl detection for apache2
2009-08-10 22:23:59 -07:00
Junio C Hamano
e532e7b08f Merge branch 'maint-1.6.3' into maint
* maint-1.6.3:
  Fix typos in git-remote.txt and git-symbolic-ref.txt
2009-08-10 22:23:48 -07:00
Junio C Hamano
56b36b834d Merge branch 'jk/push-quiet'
* jk/push-quiet:
  transport: don't show push status if --quiet is given
  transport: pass "quiet" flag to pack-objects
  push: add --quiet flag
2009-08-10 22:18:21 -07:00
Junio C Hamano
14468ab45b Merge branch 'jc/maint-merge-recursive-fix'
* jc/maint-merge-recursive-fix:
  merge-recursive: don't segfault while handling rename clashes
2009-08-10 22:17:01 -07:00
Junio C Hamano
9c5164032f Merge branch 'zf/maint-gitweb-acname'
* zf/maint-gitweb-acname:
  gitweb: parse_commit_text encoding fix
2009-08-10 22:16:47 -07:00
Junio C Hamano
38a9f35d1f Merge branch 'ns/am-raw-email'
* ns/am-raw-email:
  git-am: print fair error message when format detection fails
  am: allow individual e-mail files as input
2009-08-10 22:16:42 -07:00
Junio C Hamano
efd3f9fdbc Merge branch 'np/maint-limit-delta-cache'
* np/maint-limit-delta-cache:
  don't let the delta cache grow unbounded in 'git repack'
2009-08-10 22:16:09 -07:00
Junio C Hamano
6eedee514e Merge branch 'jp/symlink-dirs'
* jp/symlink-dirs:
  t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite
  git-checkout: be careful about untracked symlinks
  lstat_cache: guard against full match of length of 'name' parameter
  Demonstrate bugs when a directory is replaced with a symlink
2009-08-10 22:15:41 -07:00
Junio C Hamano
67f272c2f2 Merge branch 'mk/grep-max-depth'
* mk/grep-max-depth:
  grep: Add --max-depth option.
2009-08-10 22:15:12 -07:00
Junio C Hamano
08ac69685a Merge branch 'js/run-command-updates'
* js/run-command-updates:
  api-run-command.txt: describe error behavior of run_command functions
  run-command.c: squelch a "use before assignment" warning
  receive-pack: remove unnecessary run_status report
  run_command: report failure to execute the program, but optionally don't
  run_command: encode deadly signal number in the return value
  run_command: report system call errors instead of returning error codes
  run_command: return exit code as positive value
  MinGW: simplify waitpid() emulation macros
2009-08-10 22:14:57 -07:00
Štěpán Němec
75f492ace7 Fix typos in git-remote.txt and git-symbolic-ref.txt
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 19:05:00 -07:00
Linus Torvalds
926172c5e4 block-sha1: improve code on large-register-set machines
For x86 performance (especially in 32-bit mode) I added that hack to write
the SHA1 internal temporary hash using a volatile pointer, in order to get
gcc to not try to cache the array contents. Because gcc will do all the
wrong things, and then spill things in insane random ways.

But on architectures like PPC, where you have 32 registers, it's actually
perfectly reasonable to put the whole temporary array[] into the register
set, and gcc can do so.

So make the 'volatile unsigned int *' cast be dependent on a
SMALL_REGISTER_SET preprocessor symbol, and enable it (currently) on just
x86 and x86-64.  With that, the routine is fairly reasonable even when
compared to the hand-scheduled PPC version. Ben Herrenschmidt reports on
a G5:

 * Paulus asm version:       about 3.67s
 * Yours with no change:     about 5.74s
 * Yours without "volatile": about 3.78s

so with this the C version is within about 3% of the asm one.

And add a lot of commentary on what the heck is going on.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 17:26:51 -07:00
Nicolas Sebrecht
af12fb7b30 git-am: print fair error message when format detection fails
Avoid git ending with this message:
	"Patch format  is not supported."

With improved error message in the format detection failure case by
Giuseppe Bilotta.

Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 16:54:29 -07:00
Junio C Hamano
584c43567b am: allow individual e-mail files as input
We traditionally allowed a mbox file or a directory name of a maildir (but
never an individual file inside a maildir) to be given to "git am".  Even
though an individual file in a maildir (or more generally, a piece of
RFC2822 e-mail) is not a mbox file, it contains enough information to
create a commit out of it, so there is no reason to reject one.  Running
mailsplit on such a file feels stupid, but it does not hurt.

This builds on top of a5a6755 (git-am foreign patch support: introduce
patch_format, 2009-05-27) that introduced mailbox format detection.  The
codepath to deal with a mbox requires it to begin with "From " line and
also allows it to begin with "From: ", but a random piece of e-mail can
and often do begin with any valid RFC2822 header lines.

Instead of checking the first line, we extract all the lines up to the
first empty line, and make sure they look like e-mail headers.

A test is added to t4150 to demonstrate this feature.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 16:54:23 -07:00
Johannes Schindelin
0a7f448355 Correctly mark cover letters' encodings if they are not pure ASCII
If your name is, say, Üwë, you want your cover letters to appear
correctly.  Convince format-patch to mark it as 8-bit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 14:39:41 -07:00
Johannes Schindelin
28e9cf6512 Expose the has_non_ascii() function
This function is useful outside of log-tree.c, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 14:39:39 -07:00
Jeff Lasslett
0c4f21e452 Check return value of ftruncate call in http.c
In new_http_object_request(), check ftruncate() call return value and
handle possible errors.

Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 13:26:18 -07:00
Tay Ray Chuan
bb99190e27 http.c: replace usage of temporary variable for urls
Use preq->url in new_http_pack_request and freq->url in
new_http_object_request when calling curl_setopt(CURLOPT_URL), instead
of using an intermediate variable, 'url'.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 13:26:11 -07:00
Tay Ray Chuan
5ae9ebfd58 http.c: free preq when aborting
Free preq in new_http_pack_request when aborting. preq was allocated
before jumping to the 'abort' label so this is safe.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10 13:25:25 -07:00
Junio C Hamano
f402a7b172 Merge branch 'master' of git://git.bogomips.org/git-svn
* 'master' of git://git.bogomips.org/git-svn:
  git-svn: ignore leading blank lines in svn:ignore
  svn: Honor --prefix option in init without --stdlayout
  svn: Add && to t9107-git-svn-migrate.sh
2009-08-10 13:22:33 -07:00
Michael Haggerty
a7d72544b1 git-svn: ignore leading blank lines in svn:ignore
Subversion ignores all blank lines in svn:ignore properties.  The old
git-svn code ignored blank lines everywhere except for the first line
of the svn:ignore property.  This patch makes the "git svn
show-ignore" and "git svn create-ignore" commands ignore leading blank
lines, too.

Also include leading blank lines in the test suite.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-08-10 02:35:55 -07:00