git
15 years agoMerge branch 'jk/unwanted-advices' into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:37 +0000 (22:52 -0700)] 
Merge branch 'jk/unwanted-advices' into next

* jk/unwanted-advices:
  status: make "how to stage" messages optional
  push: make non-fast-forward help message configurable

15 years agoMerge branch 'db/vcs-helper' (early part) into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:36 +0000 (22:52 -0700)] 
Merge branch 'db/vcs-helper' (early part) into next

* 'db/vcs-helper' (early part):
  Makefile: remove remnant of separate http/https/ftp helpers

15 years agoMerge branch 'master' into next
Junio C Hamano [Sat, 12 Sep 2009 05:52:31 +0000 (22:52 -0700)] 
Merge branch 'master' into next

* master:
  rebase: use plumbing to show dirty state
  pager: set LESS=FRSX also on Windows
  start_command: do not clobber cmd->env on Windows code path

15 years agoMakefile: remove remnant of separate http/https/ftp helpers
Junio C Hamano [Sat, 12 Sep 2009 05:35:30 +0000 (22:35 -0700)] 
Makefile: remove remnant of separate http/https/ftp helpers

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorebase: use plumbing to show dirty state
Jeff King [Wed, 9 Sep 2009 14:59:37 +0000 (10:59 -0400)] 
rebase: use plumbing to show dirty state

Commit 4cfbe06 introduced the use of "git diff" to show
dirty state in a format more familiar to users. However, it
should have used the plumbing "git diff-files" instead.

Not only is it good practice in general to use plumbing in
scripts, but in this case we really don't want the automatic
pager to kick in for an error message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: make "how to stage" messages optional
Jeff King [Wed, 9 Sep 2009 11:43:03 +0000 (07:43 -0400)] 
status: make "how to stage" messages optional

These messages are nice for new users, but experienced git
users know how to manipulate the index, and these messages
waste a lot of screen real estate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopush: make non-fast-forward help message configurable
Jeff King [Wed, 9 Sep 2009 11:38:58 +0000 (07:38 -0400)] 
push: make non-fast-forward help message configurable

This message is designed to help new users understand what
has happened when refs fail to push. However, it does not
help experienced users at all, and significantly clutters
the output, frequently dwarfing the regular status table and
making it harder to see.

This patch introduces a general configuration mechanism for
optional messages, with this push message as the first
example.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopager: set LESS=FRSX also on Windows
Johannes Sixt [Fri, 11 Sep 2009 17:45:07 +0000 (19:45 +0200)] 
pager: set LESS=FRSX also on Windows

Previously, this environment variable was set in the pager_preexec
callback, which is conditionally-compiled only on Unix, because it is not,
and cannot be, called on Windows.

With this patch the env member of struct child_process is used to set
the environment variable, which also works on Windows.

Noticed by Alexey Borzenkov.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostart_command: do not clobber cmd->env on Windows code path
Johannes Sixt [Fri, 11 Sep 2009 17:40:08 +0000 (19:40 +0200)] 
start_command: do not clobber cmd->env on Windows code path

Previously, it would not be possible to call start_command twice for the
same struct child_process that has env set.

The fix is achieved by moving the loop that modifies the environment block
into a helper function. This also allows us to make two other helper
functions static.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/merge-saner-messages' into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:04 +0000 (01:00 -0700)] 
Merge branch 'jc/merge-saner-messages' into next

* jc/merge-saner-messages:
  merge-recursive: give less scary messages when merge did not start

15 years agoMerge branch 'jt/pushinsteadof' into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:04 +0000 (01:00 -0700)] 
Merge branch 'jt/pushinsteadof' into next

* jt/pushinsteadof:
  Add url.<base>.pushInsteadOf: URL rewriting for push only
  Wrap rewrite globals in a struct in preparation for adding another set

15 years agoMerge branch 'db/vcs-helper' (early part) into next
Junio C Hamano [Fri, 11 Sep 2009 08:00:03 +0000 (01:00 -0700)] 
Merge branch 'db/vcs-helper' (early part) into next

* 'db/vcs-helper' (early part):
  Use a clearer style to issue commands to remote helpers
  Make the "traditionally-supported" URLs a special case

15 years agoMerge branch 'master' into next
Junio C Hamano [Fri, 11 Sep 2009 07:59:59 +0000 (00:59 -0700)] 
Merge branch 'master' into next

* master:
  add documentation for mailinfo.scissors and '--no-scissors'
  mailinfo: add '--scissors' to usage message
  INSTALL: Describe dependency knobs from Makefile
  INSTALL: Reorder dependencies, split shell and Perl
  git-p4: Avoid modules deprecated in Python 2.6.
  Makefile: Add NEEDS_CRYPTO_WITH_SSL
  git.el: Use git-add-file for unmerged files, remove git-resolve-file
  INSTALL: Update description of our SHA-1 code

15 years agoadd documentation for mailinfo.scissors and '--no-scissors'
Nicolas Sebrecht [Fri, 11 Sep 2009 00:29:58 +0000 (02:29 +0200)] 
add documentation for mailinfo.scissors and '--no-scissors'

Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomailinfo: add '--scissors' to usage message
Nicolas Sebrecht [Fri, 11 Sep 2009 00:09:20 +0000 (02:09 +0200)] 
mailinfo: add '--scissors' to usage message

Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoINSTALL: Describe dependency knobs from Makefile
Brian Gernhardt [Thu, 10 Sep 2009 20:28:19 +0000 (16:28 -0400)] 
INSTALL: Describe dependency knobs from Makefile

We said that some of our dependencies were optional, but didn't say
how to turn them off.  Add information for that and mention where to
save the options close to the top of the file.

Also, standardize on both using quotes for the names of the dependencies
and tabs for indentation of the list.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoINSTALL: Reorder dependencies, split shell and Perl
Brian Gernhardt [Wed, 9 Sep 2009 01:51:00 +0000 (21:51 -0400)] 
INSTALL: Reorder dependencies, split shell and Perl

The most important and non-optional dependencies should go first, so put
them there.  While we're moving them, the descriptions for shell and perl
were archaic, referring to "bare-bones Porcelainish scripts" that have
become powerful and essential.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-p4: Avoid modules deprecated in Python 2.6.
Reilly Grant [Thu, 10 Sep 2009 07:02:38 +0000 (00:02 -0700)] 
git-p4: Avoid modules deprecated in Python 2.6.

The popen2, sha and sets modules are deprecated in Python 2.6 (sha in
Python 2.5).  Both popen2 and sha are not actually used in git-p4.
Replace usage of sets.Set with the builtin set object.

The built-in set object was added in Python 2.4 and is already used in
other parts of this script, so this dependency is nothing new.

Signed-off-by: Reilly Grant <reillyeon@qotw.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: Add NEEDS_CRYPTO_WITH_SSL
Brian Gernhardt [Tue, 8 Sep 2009 13:54:38 +0000 (09:54 -0400)] 
Makefile: Add NEEDS_CRYPTO_WITH_SSL

The Makefile comment for NEEDS_SSL_WITH_CRYPTO says to define it "if
you need -lcrypto with -lssl (Darwin)."  However, what it actually
does is add -lssl when you use -lcrypto and not the other way around.
However, libcrypto contains a majority of the ERR_* functions from
OpenSSL (at least on OS X) so we need it both ways.

So, add NEEDS_CRYPTO_WITH_SSL which adds -lcrypto to the OpenSSL link
flags and clarify the difference between it and NEEDS_SSL_WITH_CRYPTO.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit.el: Use git-add-file for unmerged files, remove git-resolve-file
Martin Nordholts [Thu, 3 Sep 2009 20:27:24 +0000 (22:27 +0200)] 
git.el: Use git-add-file for unmerged files, remove git-resolve-file

Use `git-add-file' to mark unmerged files as resolved in the
*git-status* buffer to be consistent with git's CLI instructions. Also
remove `git-resolve-file' to make it clear that that "R" is a now a
free keybinding.

Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoINSTALL: Update description of our SHA-1 code
Brian Gernhardt [Wed, 9 Sep 2009 01:50:59 +0000 (21:50 -0400)] 
INSTALL: Update description of our SHA-1 code

We haven't had Mozilla's code or an ARM optimized algorithm since
30ae47b.  Reword the paragraph to give credit but not authorship to
Mozilla.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomerge-recursive: give less scary messages when merge did not start
Junio C Hamano [Tue, 8 Sep 2009 05:43:11 +0000 (22:43 -0700)] 
merge-recursive: give less scary messages when merge did not start

When unpack_trees() three-way merge logic is called from merge-recursive
and finds that local changes are going to be clobbered, its plumbing level
messages were given as errors first, and then the merge driver added even
more scary message "fatal: merging of trees <a long object name> and
<another long object name> failed".

This is most often encountered by new CVS/SVN migrants who are used to
start a merge from a dirty work tree.  The saddest part is that the merge
refused to run to prevent _any_ damage from being done to your work tree
when these messages are given, but the messages look a lot more scarier
than the conflicted case where the user needs to resolve them.

Replace the plumbing level messages so that they talk about what it is
protecting the user from, and end the messages with "Aborting." so that it
becomes clear that the command did not do any harm.

The final "merging of trees failed" message is superfluous, unless you are
interested in debugging the merge-recursive itself.  Squelch the current
die() message by default, but allow it to help people who debug git with
verbosity level 4 or greater.

Unless there is some bug, an inner merge that does not touch working tree
should not trigger any such error, so emit the current die() message when
we see an error return from it while running the inner merge, too.  It
would also help people who debug git.

We could later add instructions on how to recover (i.e. "stash changes
away or commit on a side branch and retry") instead of the silent
exit(128) I have in this patch, and then use Peff's advice.* mechanism to
squelch it (e.g. "advice.mergeindirtytree"), but they are separate topics.

Tested-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd url.<base>.pushInsteadOf: URL rewriting for push only
Josh Triplett [Mon, 7 Sep 2009 08:56:33 +0000 (01:56 -0700)] 
Add url.<base>.pushInsteadOf: URL rewriting for push only

This configuration option allows systematically rewriting fetch-only URLs
to push-capable URLs when used with push.  For instance:

[url "ssh://example.org/"]
    pushInsteadOf = "git://example.org/"

This will allow clones of "git://example.org/path/to/repo" to subsequently
push to "ssh://example.org/path/to/repo", without manually configuring
pushurl for that remote.

Includes documentation for the new option, bash completion updates, and
test cases (both that pushInsteadOf applies to push, that it does not
apply to fetch, and that it is ignored when pushURL is already defined).

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'sr/gfi-options' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:20 +0000 (17:21 -0700)] 
Merge branch 'sr/gfi-options' into next

* sr/gfi-options:
  fast-import: test the new option command
  fast-import: add option command
  fast-import: test the new feature command
  fast-import: add feature command
  fast-import: put marks reading in it's own function
  fast-import: put option parsing code in separate functions

15 years agoMerge branch 'jn/gitweb-blame' (early part) into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:20 +0000 (17:21 -0700)] 
Merge branch 'jn/gitweb-blame' (early part) into next

* 'jn/gitweb-blame' (early part):
  gitweb: Colorize 'blame_incremental' view during processing
  gitweb: Incremental blame (using JavaScript)
  gitweb: Add optional "time to generate page" info in footer

15 years agoMerge branch 'pk/fast-import-dirs' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'pk/fast-import-dirs' into next

* pk/fast-import-dirs:
  Add script for importing bits-and-pieces to Git.

15 years agoMerge branch 'jc/maint-1.6.0-blank-at-eof' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'jc/maint-1.6.0-blank-at-eof' into next

* jc/maint-1.6.0-blank-at-eof:
  core.whitespace: split trailing-space into blank-at-{eol,eof}
  diff --color: color blank-at-eof
  diff --whitespace=warn/error: fix blank-at-eof check
  diff --whitespace=warn/error: obey blank-at-eof
  diff.c: the builtin_diff() deals with only two-file comparison
  apply --whitespace: warn blank but not necessarily empty lines at EOF
  apply --whitespace=warn/error: diagnose blank at EOF
  apply.c: split check_whitespace() into two
  apply --whitespace=fix: detect new blank lines at eof correctly
  apply --whitespace=fix: fix handling of blank lines at the eof

Conflicts:
diff.c
t/t4124-apply-ws-rule.sh
ws.c

15 years agoMerge branch 'pk/fast-import-tars' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'pk/fast-import-tars' into next

* pk/fast-import-tars:
  import-tars: Allow per-tar author and commit message.

15 years agoMerge branch 'jk/1.7.0-status' (early part) into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'jk/1.7.0-status' (early part) into next

* 'jk/1.7.0-status' (early part):
  commit: support alternate status formats
  status: add --porcelain output format
  status: refactor format option parsing
  status: refactor short-mode printing to its own function

15 years agoMerge branch 'cb/maint-1.6.3-grep-relative-up' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:19 +0000 (17:21 -0700)] 
Merge branch 'cb/maint-1.6.3-grep-relative-up' into next

* cb/maint-1.6.3-grep-relative-up:
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
t/t7002-grep.sh

15 years agoMerge branch 'master' into next
Junio C Hamano [Tue, 8 Sep 2009 00:21:18 +0000 (17:21 -0700)] 
Merge branch 'master' into next

* master:
  GIT 1.6.5-rc0
  git-pull: do not mention --quiet and --verbose twice
  githooks.txt: put hooks into subsections

15 years agoGIT 1.6.5-rc0 v1.6.5-rc0
Junio C Hamano [Tue, 8 Sep 2009 00:20:02 +0000 (17:20 -0700)] 
GIT 1.6.5-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 7 Sep 2009 22:45:48 +0000 (15:45 -0700)] 
Merge branch 'maint'

* maint:
  git-pull: do not mention --quiet and --verbose twice
  githooks.txt: put hooks into subsections

15 years agogit-pull: do not mention --quiet and --verbose twice
Emmanuel Trillaud [Mon, 7 Sep 2009 12:34:35 +0000 (14:34 +0200)] 
git-pull: do not mention --quiet and --verbose twice

git-pull.txt includes fetch-options.txt and merge-options.txt, both of
which document the --quiet and --verbose.

Supress the ones from fetch-options.txt.

Signed-off-by: Emmanuel Trillaud <etrillaud@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogithooks.txt: put hooks into subsections
Bert Wesarg [Sun, 6 Sep 2009 10:22:58 +0000 (12:22 +0200)] 
githooks.txt: put hooks into subsections

All hooks are currently in its own section. Which may confuse users,
because the section name serves as the hook file name and sections are
all caps for man pages. Putting them into a new HOOKS section and each
hook into a subsection keeps the case to lower case.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/mailinfo-scissors'
Junio C Hamano [Mon, 7 Sep 2009 22:25:37 +0000 (15:25 -0700)] 
Merge branch 'jc/mailinfo-scissors'

* jc/mailinfo-scissors:
  mailinfo.scissors: new configuration
  am/mailinfo: Disable scissors processing by default
  Documentation: describe the scissors mark support of "git am"
  Teach mailinfo to ignore everything before -- >8 -- mark
  builtin-mailinfo.c: fix confusing internal API to mailinfo()

15 years agoMerge branch 'jk/clone-b'
Junio C Hamano [Mon, 7 Sep 2009 22:24:53 +0000 (15:24 -0700)] 
Merge branch 'jk/clone-b'

* jk/clone-b:
  clone: add --branch option to select a different HEAD

15 years agoMerge branch 'jc/upload-pack-hook'
Junio C Hamano [Mon, 7 Sep 2009 22:24:47 +0000 (15:24 -0700)] 
Merge branch 'jc/upload-pack-hook'

* jc/upload-pack-hook:
  upload-pack: feed "kind [clone|fetch]" to post-upload-pack hook
  upload-pack: add a trigger for post-upload-pack hook

15 years agoMerge branch 'tr/reset-checkout-patch'
Junio C Hamano [Mon, 7 Sep 2009 22:24:38 +0000 (15:24 -0700)] 
Merge branch 'tr/reset-checkout-patch'

* tr/reset-checkout-patch:
  stash: simplify defaulting to "save" and reject unknown options
  Make test case number unique
  tests: disable interactive hunk selection tests if perl is not available
  DWIM 'git stash save -p' for 'git stash -p'
  Implement 'git stash save --patch'
  Implement 'git checkout --patch'
  Implement 'git reset --patch'
  builtin-add: refactor the meat of interactive_add()
  Add a small patch-mode testing library
  git-apply--interactive: Refactor patch mode code
  Make 'git stash -k' a short form for 'git stash save --keep-index'

15 years agoMerge branch 'np/maint-1.6.3-deepen'
Junio C Hamano [Mon, 7 Sep 2009 22:23:50 +0000 (15:23 -0700)] 
Merge branch 'np/maint-1.6.3-deepen'

* np/maint-1.6.3-deepen:
  pack-objects: free preferred base memory after usage
  make shallow repository deepening more network efficient

15 years agogrep: accept relative paths outside current working directory
Clemens Buchacher [Sat, 5 Sep 2009 12:31:17 +0000 (14:31 +0200)] 
grep: accept relative paths outside current working directory

"git grep" would barf at relative paths pointing outside the current
working directory (or subdirectories thereof). Use quote_path_relative(),
which can handle such cases just fine.

[jc: added tests.]

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: fix exit status if external_grep() punts
Clemens Buchacher [Mon, 7 Sep 2009 08:48:01 +0000 (10:48 +0200)] 
grep: fix exit status if external_grep() punts

If external_grep() is called and punts, grep_cache() mistakenly reported a
hit, even if there were none.  The bug can be triggered by calling "git
grep --no-color" from a subdirectory.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoWrap rewrite globals in a struct in preparation for adding another set
Josh Triplett [Mon, 7 Sep 2009 08:56:00 +0000 (01:56 -0700)] 
Wrap rewrite globals in a struct in preparation for adding another set

remote.c has a global set of URL rewrites, accessed by alias_url and
make_rewrite.  Wrap them in a new "struct rewrites", passed to alias_url
and make_rewrite.  This allows adding other sets of rewrites.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: test the new option command
Sverre Rabbelier [Sun, 6 Sep 2009 14:35:48 +0000 (16:35 +0200)] 
fast-import: test the new option command

Test three options (quiet and import/export-marks) and verify that the
commandline options override these.

Also make sure that a option command without a preceeding feature
git-options command is rejected and that non-git options are ignored.

Lastly, make sure that git options that we do not recognise are
ignored as well, but that they are rejected when parsed on the
commandline.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: add option command
Sverre Rabbelier [Sun, 6 Sep 2009 14:35:47 +0000 (16:35 +0200)] 
fast-import: add option command

This allows the frontend to specify any of the supported options as
long as no non-option command has been given. This way the
user does not have to include any frontend-specific options, but
instead she can rely on the frontend to tell fast-import what it
needs.

Also factor out parsing of argv and have it execute when we reach the
first non-option command, or after all commands have been read and
no non-option command has been encountered.

Non-git options and unrecognised git options are ignored, although
unrecognised options on the commandline still result in an error.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Sun, 6 Sep 2009 07:53:04 +0000 (00:53 -0700)] 
Merge branch 'master' into next

* master:
  push: re-flow non-fast-forward message
  push: fix english in non-fast-forward message
  Do not scramble password read from .cvspass

15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 6 Sep 2009 07:39:32 +0000 (00:39 -0700)] 
Merge branch 'maint'

* maint:
  push: re-flow non-fast-forward message
  push: fix english in non-fast-forward message

15 years agopush: re-flow non-fast-forward message
Jeff King [Sun, 6 Sep 2009 06:47:20 +0000 (02:47 -0400)] 
push: re-flow non-fast-forward message

The extreme raggedness of the right edge make this jarring
to read. Let's re-flow the text to fill the lines in a more
even way.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopush: fix english in non-fast-forward message
Jeff King [Sun, 6 Sep 2009 06:46:25 +0000 (02:46 -0400)] 
push: fix english in non-fast-forward message

We must use an article when referring to the section
because it is a non-proper noun, and it must be the definite
article because we are referring to a specific section.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'np/maint-1.6.3-deepen' into next
Junio C Hamano [Sun, 6 Sep 2009 07:14:11 +0000 (00:14 -0700)] 
Merge branch 'np/maint-1.6.3-deepen' into next

* np/maint-1.6.3-deepen:
  pack-objects: free preferred base memory after usage
  make shallow repository deepening more network efficient

15 years agoMerge branch 'jc/1.7.0-status' into next
Junio C Hamano [Sun, 6 Sep 2009 07:14:08 +0000 (00:14 -0700)] 
Merge branch 'jc/1.7.0-status' into next

* jc/1.7.0-status:
  status: typo fix in usage

15 years agocommit: support alternate status formats
Jeff King [Sat, 5 Sep 2009 08:59:56 +0000 (04:59 -0400)] 
commit: support alternate status formats

The status command recently grew "short" and "porcelain"
options for alternate output formats. Since status is no
longer "commit --dry-run", these formats are inaccessible to
people who do want to see a dry-run in a parseable form.

This patch makes those formats available to "git commit",
implying the "dry-run" option when they are used.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: add --porcelain output format
Jeff King [Sat, 5 Sep 2009 08:55:37 +0000 (04:55 -0400)] 
status: add --porcelain output format

The "short" format was added to "git status" recently to
provide a less verbose way of looking at the same
information. This has two practical uses:

  1. Users who want a more dense display of the information.

  2. Scripts which want to parse the information and need a
     stable, easy-to-parse interface.

For now, the "--short" format covers both of those uses.
However, as time goes on, users of (1) may want additional
format tweaks, or for "git status" to change its behavior
based on configuration variables. Those wishes will be at
odds with (2), which wants to stability for scripts.

This patch introduces a separate --porcelain option early to
avoid problems later on.  Right now the --short and
--porcelain outputs are identical. However, as time goes on,
we will have the freedom to customize --short for human
consumption while keeping --porcelain stable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: refactor format option parsing
Jeff King [Sat, 5 Sep 2009 08:54:14 +0000 (04:54 -0400)] 
status: refactor format option parsing

This makes it possible to have more than two formats.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: refactor short-mode printing to its own function
Jeff King [Sat, 5 Sep 2009 08:53:48 +0000 (04:53 -0400)] 
status: refactor short-mode printing to its own function

We want to be able to call it from multiple places.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: typo fix in usage
Jeff King [Sat, 5 Sep 2009 08:50:26 +0000 (04:50 -0400)] 
status: typo fix in usage

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocore.whitespace: split trailing-space into blank-at-{eol,eof}
Junio C Hamano [Sun, 6 Sep 2009 05:21:17 +0000 (22:21 -0700)] 
core.whitespace: split trailing-space into blank-at-{eol,eof}

People who configured trailing-space depended on it to catch both extra
white space at the end of line, and extra blank lines at the end of file.
Earlier attempt to introduce only blank-at-eof gave them an escape hatch
to keep the old behaviour, but it is a regression until they explicitly
specify the new error class.

This introduces a blank-at-eol that only catches extra white space at the
end of line, and makes the traditional trailing-space a convenient synonym
to catch both blank-at-eol and blank-at-eof.  This way, people who used
trailing-space continue to catch both classes of errors.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDo not scramble password read from .cvspass
Pascal Obry [Fri, 4 Sep 2009 11:58:32 +0000 (13:58 +0200)] 
Do not scramble password read from .cvspass

Passwords stored in .cvspass are already scrambled, we do not
want to scramble them twice. Only passwords read from the
command line are scrambled.

This fixes a regression introduced by b2139db (git-cvsimport: add support
for cvs pserver password scrambling., 2009-08-14).

Signed-off-by: Pascal Obry <pascal@obry.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopack-objects: free preferred base memory after usage
Nicolas Pitre [Fri, 4 Sep 2009 01:54:03 +0000 (21:54 -0400)] 
pack-objects: free preferred base memory after usage

When adding objects for preferred delta base, the content from tree
objects leading to given paths is kept in a cache. This has the
potential to grow significantly, especially with large directories as
the whole tree object content is loaded in memory, even if in practice
the number of those objects is limited to the 256 cache entries plus the
$window root tree objects.  Still, that can't hurt freeing that up after
object enumeration is done, and before more memory is needed for delta
search.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake shallow repository deepening more network efficient
Nicolas Pitre [Thu, 3 Sep 2009 23:08:33 +0000 (19:08 -0400)] 
make shallow repository deepening more network efficient

First of all, I can't find any reason why thin pack generation is
explicitly disabled when dealing with a shallow repository.  The
possible delta base objects are collected from the edge commits which
are always obtained through history walking with the same shallow refs
as the client, Therefore the client is always going to have those base
objects available. So let's remove that restriction.

Then we can make shallow repository deepening much more efficient by
using the remote's unshallowed commits as edge commits to get preferred
base objects for thin pack generation.  On git.git, this makes the data
transfer for the deepening of a shallow repository from depth 1 to depth 2
around 134 KB instead of 3.68 MB.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --color: color blank-at-eof
Junio C Hamano [Fri, 4 Sep 2009 07:41:15 +0000 (00:41 -0700)] 
diff --color: color blank-at-eof

Since the coloring logic processed the patch output one line at a time, we
couldn't easily color code the new blank lines at the end of file.

Reuse the adds_blank_at_eof() function to find where the runs of such
blank lines start, keep track of the line number in the preimage while
processing the patch output one line at a time, and paint the new blank
lines that appear after that line to implement this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --whitespace=warn/error: fix blank-at-eof check
Junio C Hamano [Fri, 4 Sep 2009 06:39:43 +0000 (23:39 -0700)] 
diff --whitespace=warn/error: fix blank-at-eof check

The "diff --check" logic used to share the same issue as the one fixed for
"git apply" earlier in this series, in that a patch that adds new blank
lines at end could appear as

    @@ -l,5 +m,7 @@$
    _context$
    _context$
    -deleted$
    +$
    +$
    +$
    _$
    _$

where _ stands for SP and $ shows a end-of-line.  Instead of looking at
each line in the patch in the callback, simply count the blank lines from
the end in two versions, and notice the presence of new ones.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff --whitespace=warn/error: obey blank-at-eof
Junio C Hamano [Fri, 4 Sep 2009 05:30:27 +0000 (22:30 -0700)] 
diff --whitespace=warn/error: obey blank-at-eof

The "diff --check" code used to conflate trailing-space whitespace error
class with this, but now we have a proper separate error class, we should
check it under blank-at-eof, not trailing-space.

The whitespace error is not about _having_ blank lines at end, but about
adding _new_ blank lines.  To keep the message consistent with what is
given by "git apply", call whitespace_error_string() to generate it,
instead of using a hardcoded custom message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff.c: the builtin_diff() deals with only two-file comparison
Junio C Hamano [Fri, 4 Sep 2009 06:59:25 +0000 (23:59 -0700)] 
diff.c: the builtin_diff() deals with only two-file comparison

The combined diff is implemented in combine_diff() and fn_out_consume()
codepath never has to deal with anything but two-file comparision.

Drop nparents from the emit_callback structure and simplify the code.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply --whitespace: warn blank but not necessarily empty lines at EOF
Junio C Hamano [Fri, 4 Sep 2009 09:25:57 +0000 (02:25 -0700)] 
apply --whitespace: warn blank but not necessarily empty lines at EOF

The whitespace error of adding blank lines at the end of file should
trigger if you added a non-empty line at the end, if the contents of the
line is full of whitespaces.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply --whitespace=warn/error: diagnose blank at EOF
Junio C Hamano [Thu, 3 Sep 2009 23:02:32 +0000 (16:02 -0700)] 
apply --whitespace=warn/error: diagnose blank at EOF

"git apply" strips new blank lines at EOF under --whitespace=fix option,
but neigher --whitespace=warn nor --whitespace=error paid any attention to
these errors.

Introduce a new whitespace error class, blank-at-eof, to make the
whitespace error handling more consistent.

The patch adds a new "linenr" field to the struct fragment in order to
record which line the hunk started in the input file, but this is needed
solely for reporting purposes.  The detection of this class of whitespace
errors cannot be done while parsing a patch like we do for all the other
classes of whitespace errors.  It instead has to wait until we find where
to apply the hunk, but at that point, we do not have an access to the
original line number in the input file anymore, hence the new field.

Depending on your point of view, this may be a bugfix that makes warn and
error in line with fix.  Or you could call it a new feature.  The line
between them is somewhat fuzzy in this case.

Strictly speaking, triggering more errors than before is a change in
behaviour that is not backward compatible, even though the reason for the
change is because the code was not checking for an error that it should
have.  People who do not want added blank lines at EOF to trigger an error
can disable the new error class.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply.c: split check_whitespace() into two
Junio C Hamano [Fri, 4 Sep 2009 05:26:33 +0000 (22:26 -0700)] 
apply.c: split check_whitespace() into two

This splits the logic to record the presence of whitespace errors out of
the check_whitespace() function, which checks and then records.  The new
function, record_ws_error(), can be used by the blank-at-eof check that
does not use ws_check() logic to report its findings in the same output
format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply --whitespace=fix: detect new blank lines at eof correctly
Junio C Hamano [Thu, 3 Sep 2009 21:08:20 +0000 (14:08 -0700)] 
apply --whitespace=fix: detect new blank lines at eof correctly

The command tries to strip blank lines at the end of the file added by a
patch.  It is done by first detecting if a hunk in patch has additional
blank lines at the end of itself, and if so checking if such a hunk
applies at the end of file.  This patch addresses a bug in the logic to
implement the former (the previous one addressed a bug in the latter).

If the original ends with blank lines, often the patch hunk ends like
this:

    @@ -l,5 +m,7 @@$
    _context$
    _context$
    -deleted$
    +$
    +$
    +$
    _$
    _$

where _ stands for SP and $ shows a end-of-line.  This example patch adds
three trailing blank lines, but the code fails to notice it, because it
only pays attention to added blank lines at the very end of the hunk.  In
this example, the three added blank lines do not appear textually at the
end in the patch, even though you can see that they are indeed added at
the end, if you rearrange the diff like this:

    @@ -l,5 +m,7 @@$
    _context$
    _context$
    -deleted$
    _$
    _$
    +$
    +$
    +$

The fix is not to reset the number of (candidate) added blank lines at the
end when the loop sees a context line that is empty.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoapply --whitespace=fix: fix handling of blank lines at the eof
Junio C Hamano [Fri, 4 Sep 2009 08:41:47 +0000 (01:41 -0700)] 
apply --whitespace=fix: fix handling of blank lines at the eof

b94f2ed (builtin-apply.c: make it more line oriented, 2008-01-26) broke
the logic used to detect if a hunk adds blank lines at the end of the
file.  With the new code after that commit:

 - img holds the contents of the file that the hunk is being applied to;

 - preimage has the lines the hunk expects to be in img; and

 - postimage has the lines the hunk wants to update the part in img that
   corresponds to preimage with.

and we need to compare if the last line of preimage (not postimage)
matches the last line of img to see if the hunk applies at the end of the
file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse a clearer style to issue commands to remote helpers
Daniel Barkalow [Fri, 4 Sep 2009 02:13:51 +0000 (22:13 -0400)] 
Use a clearer style to issue commands to remote helpers

This style is overkill for some commands, but it's worthwhile to use
the same style to issue all commands, and it's useful to avoid
open-coding string lengths.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake the "traditionally-supported" URLs a special case
Daniel Barkalow [Fri, 4 Sep 2009 02:13:49 +0000 (22:13 -0400)] 
Make the "traditionally-supported" URLs a special case

Instead of trying to make http://, https://, and ftp:// URLs
indicative of some sort of pattern of transport helper usage, make
them a special case which runs the "curl" helper, and leave the
mechanism by which arbitrary helpers will be chosen entirely to future
work.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd script for importing bits-and-pieces to Git.
Peter Krefting [Thu, 3 Sep 2009 12:15:00 +0000 (13:15 +0100)] 
Add script for importing bits-and-pieces to Git.

Allows the user to import version history that is stored in bits and
pieces in the file system, for instance snapshots of old development
trees, or day-by-day backups. A configuration file is used to
describe the relationship between the different files and allow
describing branches and merges, as well as authorship and commit
messages.

Output is created in a format compatible with git-fast-import.

Full documentation is provided inline in perldoc format.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoimport-tars: Allow per-tar author and commit message.
Peter Krefting [Thu, 3 Sep 2009 12:15:00 +0000 (13:15 +0100)] 
import-tars: Allow per-tar author and commit message.

If the "--metainfo=<ext>" option is given on the command line, a file
called "<filename.tar>.<ext>" will be used to create the commit message
for "<filename.tar>", instead of using "Imported from filename.tar".

The author and committer of the tar ball can also be overridden by
embedding an "Author:" or "Committer:" header in the metainfo file.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Thu, 3 Sep 2009 16:43:22 +0000 (09:43 -0700)] 
Merge branch 'master' into next

* master:
  git-clone: add missing comma in --reference documentation
  push: teach --quiet to suppress "Everything up-to-date"
  git-cvsserver: no longer use deprecated 'git-subcommand' commands
  clone: disconnect transport after fetching
  status: list unmerged files much later

15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 3 Sep 2009 16:43:08 +0000 (09:43 -0700)] 
Merge branch 'maint'

* maint:
  git-clone: add missing comma in --reference documentation

15 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Thu, 3 Sep 2009 16:42:56 +0000 (09:42 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  git-clone: add missing comma in --reference documentation
  git-cvsserver: no longer use deprecated 'git-subcommand' commands
  clone: disconnect transport after fetching

15 years agoMerge branch 'maint-1.6.2' into maint-1.6.3
Junio C Hamano [Thu, 3 Sep 2009 16:42:38 +0000 (09:42 -0700)] 
Merge branch 'maint-1.6.2' into maint-1.6.3

* maint-1.6.2:
  git-clone: add missing comma in --reference documentation
  clone: disconnect transport after fetching

15 years agogit-clone: add missing comma in --reference documentation
Miklos Vajna [Thu, 3 Sep 2009 11:24:16 +0000 (13:24 +0200)] 
git-clone: add missing comma in --reference documentation

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'tr/reset-checkout-patch' into next
Junio C Hamano [Thu, 3 Sep 2009 16:40:38 +0000 (09:40 -0700)] 
Merge branch 'tr/reset-checkout-patch' into next

* tr/reset-checkout-patch:
  stash: simplify defaulting to "save" and reject unknown options

15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 3 Sep 2009 02:52:18 +0000 (19:52 -0700)] 
Merge branch 'maint'

* maint:
  git-cvsserver: no longer use deprecated 'git-subcommand' commands
  clone: disconnect transport after fetching

15 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Thu, 3 Sep 2009 02:51:55 +0000 (19:51 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  git-cvsserver: no longer use deprecated 'git-subcommand' commands
  clone: disconnect transport after fetching

15 years agopush: teach --quiet to suppress "Everything up-to-date"
Jeff King [Mon, 31 Aug 2009 19:28:34 +0000 (15:28 -0400)] 
push: teach --quiet to suppress "Everything up-to-date"

This should have been part of 481c7a6, whose goal was to
make "git push -q" silent unless there is an error.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: test the new feature command
Sverre Rabbelier [Wed, 2 Sep 2009 17:57:01 +0000 (19:57 +0200)] 
fast-import: test the new feature command

Test that an unknown feature causes fast-import to abort, and that a
known feature is accepted.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: add feature command
Sverre Rabbelier [Wed, 2 Sep 2009 17:57:00 +0000 (19:57 +0200)] 
fast-import: add feature command

This allows the fronted to require a specific feature to be supported
by the frontend, or abort.

Also add support for the first feature, date-format=.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: put marks reading in it's own function
Sverre Rabbelier [Wed, 2 Sep 2009 17:56:59 +0000 (19:56 +0200)] 
fast-import: put marks reading in it's own function

All options do nothing but set settings, with the exception of the
--input-marks option. Delay the reading of the marks file till after
all options have been parsed.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: put option parsing code in separate functions
Sverre Rabbelier [Wed, 2 Sep 2009 17:56:58 +0000 (19:56 +0200)] 
fast-import: put option parsing code in separate functions

Putting the options in their own functions increases readability of
the option parsing block and makes it easier to reuse the option
parsing code later on.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint-1.6.2' into maint-1.6.3
Junio C Hamano [Thu, 3 Sep 2009 01:45:44 +0000 (18:45 -0700)] 
Merge branch 'maint-1.6.2' into maint-1.6.3

* maint-1.6.2:
  clone: disconnect transport after fetching

15 years agogit-cvsserver: no longer use deprecated 'git-subcommand' commands
Gerrit Pape [Wed, 2 Sep 2009 09:23:10 +0000 (09:23 +0000)] 
git-cvsserver: no longer use deprecated 'git-subcommand' commands

git-cvsserver still references git commands like 'git-config', which
is depcrecated.  This commit changes git-cvsserver to use the
'git subcommand' form.

Sylvain Beucler reported the problem through
 http://bugs.debian.org/536067

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclone: disconnect transport after fetching
Jeff King [Wed, 2 Sep 2009 06:36:47 +0000 (02:36 -0400)] 
clone: disconnect transport after fetching

The current code just leaves the transport in whatever state
it was in after performing the fetch.  For a non-empty clone
over the git protocol, the transport code already
disconnects at the end of the fetch.

But for an empty clone, we leave the connection hanging, and
eventually close the socket when clone exits. This causes
the remote upload-pack to complain "the remote end hung up
unexpectedly". While this message is harmless to the clone
itself, it is unnecessarily scary for a user to see and may
pollute git-daemon logs.

This patch just explicitly calls disconnect after we are
done with the remote end, which sends a flush packet to
upload-pack and cleanly disconnects, avoiding the error
message.

Other transports are unaffected or slightly improved:

 - for a non-empty repo over the git protocol, the second
   disconnect is a no-op (since we are no longer connected)

 - for "walker" transports (like HTTP or FTP), we actually
   free some used memory (which previously just sat until
   the clone process exits)

 - for "rsync", disconnect is always a no-op anyway

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostatus: list unmerged files much later
Johannes Sixt [Tue, 1 Sep 2009 20:13:53 +0000 (22:13 +0200)] 
status: list unmerged files much later

When resolving a conflicted merge, two lists in the status output need
more attention from the user than other parts.

 - the list of updated paths is useful to review the amount of changes the
   merge brings in (the user cannot do much about them other than
   reviewing, though); and

 - the list of unmerged paths needs the most attention from the user; the
   user needs to resolve them in order to proceed.

Since the output of git status does not by default go through the pager,
the early parts of the output can scroll away at the top. It is better to
put the more important information near the bottom.  During a merge, local
changes that are not in the index are minimum, and you should keep the
untracked list small in any case, so moving the unmerged list from the top
of the output to immediately after the list of updated paths would give us
the optimum layout.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostash: simplify defaulting to "save" and reject unknown options
Matthieu Moy [Tue, 18 Aug 2009 21:38:40 +0000 (23:38 +0200)] 
stash: simplify defaulting to "save" and reject unknown options

With the earlier DWIM patches, certain combination of options defaulted
to the "save" command correctly while certain equally valid combination
did not.  For example, "git stash -k" were Ok but "git stash -q -k" did
not work.

This makes the logic of defaulting to "save" much simpler. If there are no
non-flag arguments, it is clear that there is no command word, and we
default to "save" subcommand.  This rule prevents "git stash -q apply"
from quietly creating a stash with "apply" as the message.

This also teaches "git stash save" to reject an unknown option.  This is
to keep a mistyped "git stash save --quite" from creating a stash with a
message "--quite", and this safety is more important with the new logic
to default to "save" with any option-looking argument without an explicit
comand word.

[jc: this is based on Matthieu's 3-patch series, and a follow-up
discussion, and he and Peff take all the credit; if I have introduced bugs
while reworking, they are mine.]

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Tue, 1 Sep 2009 15:38:08 +0000 (08:38 -0700)] 
Merge branch 'master' into next

* master:
  builtin-apply.c: get rid of an unnecessary use of temporary array
  builtin-pack-objects.c: avoid vla

15 years agogitweb: Colorize 'blame_incremental' view during processing
Jakub Narebski [Tue, 1 Sep 2009 11:39:18 +0000 (13:39 +0200)] 
gitweb: Colorize 'blame_incremental' view during processing

This requires using 3 colors, not only two, to choose a color that is
different from colors of up to 2 neighbors.

gitweb.js selects the least used color, if more than one color is
possible.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: Incremental blame (using JavaScript)
Jakub Narebski [Tue, 1 Sep 2009 11:39:17 +0000 (13:39 +0200)] 
gitweb: Incremental blame (using JavaScript)

Add 'blame_incremental' view, which uses "git blame --incremental"
and JavaScript (Ajax), where 'blame' use "git blame --porcelain".

 * gitweb generates initial info by putting file contents (from
   "git cat-file") together with line numbers in blame table
 * then gitweb makes web browser JavaScript engine call startBlame()
   function from gitweb.js
 * startBlame() opens XMLHttpRequest connection to 'blame_data' view,
   which in turn calls "git blame --incremental" for a file, and
   streams output of git-blame to JavaScript (gitweb.js)
 * XMLHttpRequest event handler updates line info in blame view as soon
   as it gets data from 'blame_data' (from server), and it also updates
   progress info
 * when 'blame_data' ends, and gitweb.js finishes updating line info,
   it fixes colors to match (as far as possible) ordinary 'blame' view,
   and updates information about how long it took to generate page.

Gitweb deals with streamed 'blame_data' server errors by displaying
them in the progress info area (just in case).

The 'blame_incremental' view tries to be equivalent to 'blame' action;
there are however a few differences in output between 'blame' and
'blame_incremental' view:

 * 'blame_incremental' always used query form for this part of link(s)
   which is generated by JavaScript code.  The difference is visible
   if we use path_info link (pass some or all arguments in path_info).
   Changing this would require implementing something akin to href()
   subroutine from gitweb.perl in JavaScript (in gitweb.js).
 * 'blame_incremental' always uses "rowspan" attribute, even if
   rowspan="1".  This simplifies code, and is not visible to user.
 * The progress bar and progress info are still there even after
   JavaScript part of 'blame_incremental' finishes work.

Note that currently no link generated by gitweb leads to this new view.

This code is based on patch by Petr Baudis <pasky@suse.cz> patch, which
in turn was tweaked up version of Fredrik Kuivinen <frekui@gmail.com>'s
proof of concept patch.

This patch adds GITWEB_JS compile configuration option, and modifies
git-instaweb.sh to take gitweb.js into account.  The code for
git-instaweb.sh was taken from Pasky's patch.

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: Add optional "time to generate page" info in footer
Jakub Narebski [Tue, 1 Sep 2009 11:39:16 +0000 (13:39 +0200)] 
gitweb: Add optional "time to generate page" info in footer

Add "This page took XXX seconds and Y git commands to generate"
to page footer, if global feature 'timed' is enabled (disabled
by default).  Requires Time::HiRes installed for high precision
'wallclock' time.

Note that Time::HiRes is being required unconditionally; this is
because setting $t0 variable needs to be done fairly early to have
running time of the whole script.  If Time::HiRes module were required
only if 'timed' feature is enabled, the earliest place where starting
time ($t0) could be calculated would be after reading gitweb config,
making "time to generate page" info inaccurate.

This code is based on example code by Petr 'Pasky' Baudis.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-apply.c: get rid of an unnecessary use of temporary array
Junio C Hamano [Tue, 1 Sep 2009 09:18:29 +0000 (02:18 -0700)] 
builtin-apply.c: get rid of an unnecessary use of temporary array

Instead of allocating a temporary array imglen[], copying contents to it
from another array img->line[], and then using imglen[], use the value
from img->line[], whose value does not change during the whole process.

This incidentally removes a use of C99 variable length array, which some
older compilers apparently are not happy with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-pack-objects.c: avoid vla
Junio C Hamano [Tue, 1 Sep 2009 09:18:52 +0000 (02:18 -0700)] 
builtin-pack-objects.c: avoid vla

This is one of only two places that we use C99 variable length array on
the stack, which some older compilers apparently are not happy with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/upload-pack-hook' into next
Junio C Hamano [Tue, 1 Sep 2009 06:31:02 +0000 (23:31 -0700)] 
Merge branch 'jc/upload-pack-hook' into next

* jc/upload-pack-hook:
  upload-pack: feed "kind [clone|fetch]" to post-upload-pack hook
  upload-pack: add a trigger for post-upload-pack hook

15 years agoMerge branch 'master' into next
Junio C Hamano [Tue, 1 Sep 2009 06:27:15 +0000 (23:27 -0700)] 
Merge branch 'master' into next

* master:
  Style fixes, add a space after if/for/while.

15 years agoStyle fixes, add a space after if/for/while.
Brian Gianforcaro [Tue, 1 Sep 2009 05:35:10 +0000 (01:35 -0400)] 
Style fixes, add a space after if/for/while.

The majority of code in core git appears to use a single
space after if/for/while. This is an attempt to bring more
code to this standard. These are entirely cosmetic changes.

Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>