git.git
17 years agosend-pack: cluster ref status reporting
Jeff King [Tue, 20 Nov 2007 11:18:01 +0000 (06:18 -0500)]
send-pack: cluster ref status reporting

Instead of intermingling success and failure, we now print:

  1. all uptodate refs (if args.verbose is enabled)
  2. successfully pushed refs
  3. failed refs

with the assumption that the user is most likely to see the
ones at the end, and therefore we order them from "least
interesting" to "most interesting."

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: fix "everything up-to-date" message
Jeff King [Sun, 18 Nov 2007 08:08:22 +0000 (03:08 -0500)]
send-pack: fix "everything up-to-date" message

This has always been slightly inaccurate, since it used the
new_refs counter, which really meant "did we send any
objects," so deletions were not counted.

It has gotten even worse with recent patches, since we no
longer look at the 'ret' value, meaning we would say "up to
date" if non-ff pushes were rejected.

Instead, we now claim up to date iff every ref is either
unmatched or up to date. Any other case should already have
generated a status line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: tighten remote error reporting
Jeff King [Sun, 18 Nov 2007 07:16:52 +0000 (02:16 -0500)]
send-pack: tighten remote error reporting

Previously, we set all ref pushes to 'OK', and then marked
them as errors if the remote reported so. This has the
problem that if the remote dies or fails to report a ref, we
just assume it was OK.

Instead, we use a new non-OK state to indicate that we are
expecting status (if the remote doesn't support the
report-status feature, we fall back on the old behavior).
Thus we can flag refs for which we expected a status, but
got none (conversely, we now also print a warning for refs
for which we get a status, but weren't expecting one).

This also allows us to simplify the receive_status exit
code, since each ref is individually marked with failure
until we get a success response. We can just print the usual
status table, so the user still gets a sense of what we were
trying to do when the failure happened.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agomake "find_ref_by_name" a public function
Jeff King [Sun, 18 Nov 2007 07:13:10 +0000 (02:13 -0500)]
make "find_ref_by_name" a public function

This was a static in remote.c, but is generally useful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix warning about bitfield in struct ref
Shawn O. Pearce [Sun, 18 Nov 2007 09:31:37 +0000 (04:31 -0500)]
Fix warning about bitfield in struct ref

cache.h:503: warning: type of bit-field 'force' is a GCC extension
cache.h:504: warning: type of bit-field 'merge' is a GCC extension
cache.h:505: warning: type of bit-field 'nonfastforward' is a GCC extension
cache.h:506: warning: type of bit-field 'deletion' is a GCC extension

So we change it to an 'unsigned int' which is not a GCC extension.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: assign remote errors to each ref
Jeff King [Sat, 17 Nov 2007 12:56:03 +0000 (07:56 -0500)]
send-pack: assign remote errors to each ref

This lets us show remote errors (e.g., a denied hook) along
with the usual push output.

There is a slightly clever optimization in receive_status
that bears explanation. We need to correlate the returned
status and our ref objects, which naively could be an O(m*n)
operation. However, since the current implementation of
receive-pack returns the errors to us in the same order that
we sent them, we optimistically look for the next ref to be
looked up to come after the last one we have found. So it
should be an O(m+n) merge if the receive-pack behavior
holds, but we fall back to a correct but slower behavior if
it should change.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: check ref->status before updating tracking refs
Jeff King [Sat, 17 Nov 2007 12:55:15 +0000 (07:55 -0500)]
send-pack: check ref->status before updating tracking refs

Previously, we manually checked the 'NONE' and 'UPTODATE'
conditions. Now that we have ref->status, we can easily
say "only update if we pushed successfully".

This adds a test for and fixes a regression introduced in
ed31df31 where deleted refs did not have their tracking
branches removed. This was due to a bogus per-ref error test
that is superseded by the more accurate ref->status flag.

Signed-off-by: Jeff King <peff@peff.net>
Completely-Acked-By: Alex "Sleepy" Riesen <raa.lkml@gmail.com>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: track errors for each ref
Jeff King [Sat, 17 Nov 2007 12:54:27 +0000 (07:54 -0500)]
send-pack: track errors for each ref

Instead of keeping the 'ret' variable, we instead have a
status flag for each ref that tracks what happened to it.
We then print the ref status after all of the refs have
been examined.

This paves the way for three improvements:
  - updating tracking refs only for non-error refs
  - incorporating remote rejection into the printed status
  - printing errors in a different order than we processed
    (e.g., consolidating non-ff errors near the end with
    a special message)

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'aw/mirror-push' into jk/send-pack
Junio C Hamano [Wed, 14 Nov 2007 11:13:30 +0000 (03:13 -0800)]
Merge branch 'aw/mirror-push' into jk/send-pack

* aw/mirror-push:
  git-push: add documentation for the newly added --mirror mode
  Add tests for git push'es mirror mode
  git-push: plumb in --mirror mode
  Teach send-pack a mirror mode
  send-pack: segfault fix on forced push
  send-pack: require --verbose to show update of tracking refs
  receive-pack: don't mention successful updates
  more terse push output

Conflicts:

transport.c
transport.h

17 years agoMerge branch 'ar/send-pack-remote-track' into jk/send-pack
Junio C Hamano [Wed, 14 Nov 2007 11:11:37 +0000 (03:11 -0800)]
Merge branch 'ar/send-pack-remote-track' into jk/send-pack

* ar/send-pack-remote-track:
  Update the tracking references only if they were succesfully updated on remote
  Add a test checking if send-pack updated local tracking branches correctly

17 years agoMerge branch 'db/remote-builtin' into jk/send-pack
Junio C Hamano [Wed, 14 Nov 2007 11:09:52 +0000 (03:09 -0800)]
Merge branch 'db/remote-builtin' into jk/send-pack

* db/remote-builtin:
  Reteach builtin-ls-remote to understand remotes
  Build in ls-remote
  Use built-in send-pack.
  Build-in send-pack, with an API for other programs to call.
  Build-in peek-remote, using transport infrastructure.
  Miscellaneous const changes and utilities

Conflicts:

transport.c

17 years agoFix dependencies of parse-options test program
Alex Riesen [Tue, 13 Nov 2007 23:16:36 +0000 (00:16 +0100)]
Fix dependencies of parse-options test program

A stale test-parse-options can break t0040 otherwise.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agouser-manual.txt: fix a few mistakes
Sergei Organov [Tue, 13 Nov 2007 18:19:39 +0000 (21:19 +0300)]
user-manual.txt: fix a few mistakes

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoHandle broken vsnprintf implementations in strbuf
Shawn O. Pearce [Tue, 13 Nov 2007 08:22:44 +0000 (03:22 -0500)]
Handle broken vsnprintf implementations in strbuf

Solaris 9's vsnprintf implementation returns -1 if we pass it a
buffer of length 0.  The only way to get it to give us the actual
length necessary for the formatted string is to grow the buffer
out to have at least 1 byte available in the strbuf and then ask
it to compute the length.

If the available space is 0 I'm growing it out by 64 to ensure
we will get an accurate length estimate from all implementations.
Some callers may need to grow the strbuf again but 64 should be a
reasonable enough initial growth.

We also no longer silently fail to append to the string when we are
faced with a broken vsnprintf implementation.  On Solaris 9 this
silent failure caused me to no longer be able to execute "git clone"
as we tried to exec the empty string rather than "git-clone".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoResurrect git-revert.sh example and add comment to builtin-revert.c
Junio C Hamano [Tue, 13 Nov 2007 21:45:11 +0000 (13:45 -0800)]
Resurrect git-revert.sh example and add comment to builtin-revert.c

I had to scratch my head for quite some time figuring out why we
cannot optimize out write_tree() we do when --no-commit option
is given, whose purpose seem to be only to check if the index is
unmerged, with a simple loop over the active_cache[].

So add a comment to describe why the write_tree() is there, and
resurrect the last scripted version as a reference material in
contrib/example directory with others.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-push: add documentation for the newly added --mirror mode
Andy Whitcroft [Fri, 9 Nov 2007 23:32:57 +0000 (23:32 +0000)]
git-push: add documentation for the newly added --mirror mode

Add some basic documentation on the --mirror mode for git-push.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd tests for git push'es mirror mode
Andy Whitcroft [Fri, 9 Nov 2007 23:32:41 +0000 (23:32 +0000)]
Add tests for git push'es mirror mode

Add some tests for git push --mirror mode.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate the tracking references only if they were succesfully updated on remote
Alex Riesen [Mon, 12 Nov 2007 21:39:38 +0000 (22:39 +0100)]
Update the tracking references only if they were succesfully updated on remote

It fixes the bug where local tracking branches were filled with zeroed
SHA-1 if the remote branch was not updated because, for instance, it
was not an ancestor of the local (i.e. had other changes).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd a test checking if send-pack updated local tracking branches correctly
Alex Riesen [Mon, 12 Nov 2007 21:38:23 +0000 (22:38 +0100)]
Add a test checking if send-pack updated local tracking branches correctly

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-clean: Fix error message if clean.requireForce is not set.
Johannes Sixt [Mon, 12 Nov 2007 08:27:35 +0000 (09:27 +0100)]
git-clean: Fix error message if clean.requireForce is not set.

It was distracting to see this error message:

     clean.requireForce set and -n or -f not given; refusing to clean

even though clean.requireForce was not set at all. This patch distinguishes
the cases and gives a different message depending on whether the
configuration variable is not set or set to true.

While we are here, we also divert the error messages to stderr.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: support for funky branch and project names over HTTP(S)
Eric Wong [Mon, 12 Nov 2007 07:37:42 +0000 (23:37 -0800)]
git-svn: support for funky branch and project names over HTTP(S)

SVN requires that paths be URI-escaped for HTTP(S) repositories.
file:// and svn:// repositories do not need these rules.

Additionally, accessing individual paths inside repositories
(check_path() and get_log() do NOT require escapes to function
and in fact it breaks things).

Noticed-by: Michael J. Cohen <mjc@cruiseplanners.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation: Fix references to deprecated commands
Jonas Fonseca [Mon, 12 Nov 2007 00:32:51 +0000 (01:32 +0100)]
Documentation: Fix references to deprecated commands

... by changing git-tar-tree reference to git-archive and removing
seemingly unrelevant footnote about git-ssh-{fetch,upload}.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Nov 2007 08:14:15 +0000 (00:14 -0800)]
Merge branch 'maint'

* maint:
  for-each-ref: fix off by one read.
  git-branch: remove mention of non-existent '-b' option
  git-svn: prevent dcommitting if the index is dirty.
  Fix memory leak in traverse_commit_list

17 years agoMerge branch 'sp/maint-plug-traverse-commit-list-leak' into maint
Junio C Hamano [Mon, 12 Nov 2007 08:00:00 +0000 (00:00 -0800)]
Merge branch 'sp/maint-plug-traverse-commit-list-leak' into maint

* sp/maint-plug-traverse-commit-list-leak:
  Fix memory leak in traverse_commit_list

17 years agofor-each-ref: fix off by one read.
Christian Couder [Mon, 12 Nov 2007 04:37:25 +0000 (05:37 +0100)]
for-each-ref: fix off by one read.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-branch: remove mention of non-existent '-b' option
Jeff King [Mon, 12 Nov 2007 04:07:05 +0000 (23:07 -0500)]
git-branch: remove mention of non-existent '-b' option

This looks like a cut and paste error from the git-checkout
explanation of --no-track.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: prevent dcommitting if the index is dirty.
Benoit Sigoure [Sun, 11 Nov 2007 18:41:41 +0000 (19:41 +0100)]
git-svn: prevent dcommitting if the index is dirty.

dcommit uses rebase to sync the history with what has just been pushed to
SVN.  Trying to dcommit with a dirty index is troublesome for rebase, so now
the user will get an error message if he attempts to dcommit with a dirty
index.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'js/upload-pack'
Junio C Hamano [Sun, 11 Nov 2007 23:19:57 +0000 (15:19 -0800)]
Merge branch 'js/upload-pack'

* js/upload-pack:
  upload-pack: Use finish_{command,async}() instead of waitpid().

17 years agoMerge branch 'js/reset'
Junio C Hamano [Sun, 11 Nov 2007 23:19:24 +0000 (15:19 -0800)]
Merge branch 'js/reset'

* js/reset:
  builtin-reset: avoid forking "update-index --refresh"
  builtin-reset: do not call "ls-files --unmerged"

17 years agoMerge branch 'js/parseopt-abbrev-fix'
Junio C Hamano [Sun, 11 Nov 2007 23:12:06 +0000 (15:12 -0800)]
Merge branch 'js/parseopt-abbrev-fix'

* js/parseopt-abbrev-fix:
  parse-options: abbreviation engine fix.

17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 11 Nov 2007 23:00:05 +0000 (15:00 -0800)]
Merge branch 'maint'

* maint:
  fix index-pack with packs >4GB containing deltas on 32-bit machines
  git-hash-object should honor config variables
  gitweb: correct month in date display for atom feeds

17 years agopush: teach push to pass --verbose option to transport layer
Steffen Prohaska [Sun, 11 Nov 2007 14:01:44 +0000 (15:01 +0100)]
push: teach push to pass --verbose option to transport layer

A --verbose option to push should also be passed to the
transport layer, i.e. git-send-pack, git-http-push.

git push is modified to do so.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopush: mention --verbose option in documentation
Steffen Prohaska [Sun, 11 Nov 2007 14:01:43 +0000 (15:01 +0100)]
push: mention --verbose option in documentation

Before this commit, only '-v' was documented.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofix index-pack with packs >4GB containing deltas on 32-bit machines
Nicolas Pitre [Sun, 11 Nov 2007 04:29:10 +0000 (23:29 -0500)]
fix index-pack with packs >4GB containing deltas on 32-bit machines

This probably hasn't been properly tested before.  Here's a script to
create a 8GB repo with the necessary characteristics (copy the
test-genrandom executable from the Git build tree to /tmp first):

-----
#!/bin/bash

git init
git config core.compression 0

# create big objects with no deltas
for i in $(seq -w 1 2 63)
do
echo $i
/tmp/test-genrandom $i 268435456 > file_$i
git add file_$i
rm file_$i
echo "file_$i -delta" >> .gitattributes
done

# create "deltifiable" objects in between big objects
for i in $(seq -w 2 2 64)
do
echo "$i $i $i" >> grow
cp grow file_$i
git add file_$i
rm file_$i
done
rm grow

# create a pack with them
git commit -q -m "commit of big objects interlaced with small deltas"
git repack -a -d
-----

Then clone this repo over the Git protocol.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-hash-object should honor config variables
Nicolas Pitre [Sat, 10 Nov 2007 20:00:33 +0000 (15:00 -0500)]
git-hash-object should honor config variables

... such as core.compression.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: correct month in date display for atom feeds
Vincent Zanotti [Sat, 10 Nov 2007 18:55:27 +0000 (19:55 +0100)]
gitweb: correct month in date display for atom feeds

Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agotest-lib.sh: move error line after error() declaration
Michele Ballabio [Sat, 10 Nov 2007 14:17:25 +0000 (15:17 +0100)]
test-lib.sh: move error line after error() declaration

This patch removes a spurious "command not found" error
and actually makes the "Test script did not set test_description."
string follow the command line option "--no-color".

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofor-each-ref: fix setup of option-parsing for --sort
Lars Hjemli [Sat, 10 Nov 2007 16:47:54 +0000 (17:47 +0100)]
for-each-ref: fix setup of option-parsing for --sort

The option value for --sort is already a pointer to a pointer to struct
ref_sort, so just use it.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Sat, 10 Nov 2007 10:06:30 +0000 (02:06 -0800)]
Merge branch 'maint'

* maint:
  print warning/error/fatal messages in one shot

17 years agocore-tutorial.txt: Fix git-show-branch example and its description
Sergei Organov [Thu, 8 Nov 2007 15:10:28 +0000 (18:10 +0300)]
core-tutorial.txt: Fix git-show-branch example and its description

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix memory leak in traverse_commit_list
Shawn O. Pearce [Fri, 9 Nov 2007 11:06:10 +0000 (06:06 -0500)]
Fix memory leak in traverse_commit_list

If we were listing objects too then the objects were buffered in an
array only reachable from a stack allocated structure.  When this
function returns that array would be leaked as nobody would have
a reference to it anymore.

Historically this hasn't been a problem as the primary user of
traverse_commit_list() (the noble git-rev-list) would terminate
as soon as the function was finished, thus allowing the operating
system to cleanup memory.  However we have been leaking this data
in git-pack-objects ever since that program learned how to run the
revision listing internally, rather than relying on reading object
names from git-rev-list.

To better facilitate reuse of traverse_commit_list during other
builtin tools (such as git-fetch) we shouldn't leak temporary memory
like this and instead we need to clean up properly after ourselves.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: a bit more tests
Junio C Hamano [Sat, 10 Nov 2007 09:49:34 +0000 (01:49 -0800)]
git-commit: a bit more tests

Add tests for -s (sign-off) and multiple -m options

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoprint warning/error/fatal messages in one shot
Nicolas Pitre [Fri, 9 Nov 2007 19:33:54 +0000 (14:33 -0500)]
print warning/error/fatal messages in one shot

Not doing so is likely to create a messed up display when sent over the
sideband protocol.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobuiltin-blame: set up the work_tree before the first file access
Johannes Schindelin [Fri, 9 Nov 2007 11:34:07 +0000 (11:34 +0000)]
builtin-blame: set up the work_tree before the first file access

We check in cmd_blame() if the specified path is there, but we
failed to set up the working tree before that.

While at it, make setup_work_tree() just return if it was run
before.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoadd a howto document about corrupted blob recovery
Nicolas Pitre [Fri, 9 Nov 2007 17:28:19 +0000 (12:28 -0500)]
add a howto document about corrupted blob recovery

Extracted from a post by Linus on the mailing list.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-push: plumb in --mirror mode
Andy Whitcroft [Fri, 9 Nov 2007 23:32:25 +0000 (23:32 +0000)]
git-push: plumb in --mirror mode

Plumb in the --mirror mode for git-push.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach send-pack a mirror mode
Andy Whitcroft [Fri, 9 Nov 2007 23:32:10 +0000 (23:32 +0000)]
Teach send-pack a mirror mode

Existing "git push --all" is almost perfect for backing up to
another repository, except that "--all" only means "all
branches" in modern git, and it does not delete old branches and
tags that exist at the back-up repository that you have removed
from your local repository.

This teaches "git-send-pack" a new "--mirror" option.  The
difference from the "--all" option are that (1) it sends all
refs, not just branches, and (2) it deletes old refs you no
longer have on the local side from the remote side.

Original patch by Junio C Hamano.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge master into aw/mirror-push
Junio C Hamano [Sat, 10 Nov 2007 05:13:46 +0000 (21:13 -0800)]
Merge master into aw/mirror-push

17 years agoDocumentation: remove documentation for removed tools.
Junio C Hamano [Fri, 9 Nov 2007 01:22:44 +0000 (17:22 -0800)]
Documentation: remove documentation for removed tools.

Old commit walkers other than http/curl transport have been removed
for some time now.  Remove their documents.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake check-docs target detect removed commands
Junio C Hamano [Fri, 9 Nov 2007 02:38:27 +0000 (18:38 -0800)]
Make check-docs target detect removed commands

The maintainer should remember running "make check-docs" from
time to time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation: lost-found is now deprecated.
Junio C Hamano [Fri, 9 Nov 2007 01:21:48 +0000 (17:21 -0800)]
Documentation: lost-found is now deprecated.

This makes it possible to mark commands that are deprecated in the
command list of the primary manual page git(7), and uses it to
mark "git lost-found" and "git tar-tree" as deprecated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jk/terse-push' into aw/mirror-push
Junio C Hamano [Fri, 9 Nov 2007 09:10:10 +0000 (01:10 -0800)]
Merge branch 'jk/terse-push' into aw/mirror-push

* jk/terse-push:
  send-pack: segfault fix on forced push
  send-pack: require --verbose to show update of tracking refs
  receive-pack: don't mention successful updates
  more terse push output

17 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Fri, 9 Nov 2007 08:32:38 +0000 (00:32 -0800)]
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Fri, 9 Nov 2007 08:21:44 +0000 (00:21 -0800)]
Merge branch 'maint'

* maint:
  Start preparing for 1.5.3.6
  git-send-email: Change the prompt for the subject of the initial message.
  SubmittingPatches: improve the 'Patch:' section of the checklist
  instaweb: Minor cleanups and fixes for potential problems
  stop t1400 hiding errors in tests
  Makefile: add missing dependency on wt-status.h
  refresh_index_quietly(): express "optional" nature of index writing better
  Fix sed string regex escaping in module_name.
  Avoid a few unportable, needlessly nested "...`...".
  git-mailsplit: with maildirs not only process cur/, but also new/

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-bisect.sh: Fix sed script to work with AIX and BSD sed.
Ralf Wildenhues [Thu, 8 Nov 2007 21:48:24 +0000 (22:48 +0100)]
git-bisect.sh: Fix sed script to work with AIX and BSD sed.

\n is not portable in a s/// replacement string, only
in the regex part.  backslash-newline helps.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoStart preparing for 1.5.3.6
Junio C Hamano [Fri, 9 Nov 2007 08:17:26 +0000 (00:17 -0800)]
Start preparing for 1.5.3.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-send-email: Change the prompt for the subject of the initial message.
Benoit Sigoure [Thu, 8 Nov 2007 18:56:28 +0000 (19:56 +0100)]
git-send-email: Change the prompt for the subject of the initial message.

I never understood what this prompt was asking for until I read the actual
source code.  I think this wording is much more understandable.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSubmittingPatches: improve the 'Patch:' section of the checklist
Sergei Organov [Thu, 8 Nov 2007 16:40:25 +0000 (19:40 +0300)]
SubmittingPatches: improve the 'Patch:' section of the checklist

There were 2 items "send patch to..." but having different set of
addresses to send patch to. Merge them together and move the resulting
item to the end of checklist.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoinstaweb: Minor cleanups and fixes for potential problems
Jonas Fonseca [Thu, 8 Nov 2007 23:21:42 +0000 (00:21 +0100)]
instaweb: Minor cleanups and fixes for potential problems

Fix path quoting and test of empty values that some shells do not like.
Remove duplicate check and setting of $browser.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostop t1400 hiding errors in tests
Alex Riesen [Thu, 8 Nov 2007 23:41:39 +0000 (00:41 +0100)]
stop t1400 hiding errors in tests

The last rm in the test was lacking an "&&" before it,
which caused the errors in the commands be silently hidden.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMakefile: add missing dependency on wt-status.h
Junio C Hamano [Fri, 9 Nov 2007 00:41:56 +0000 (16:41 -0800)]
Makefile: add missing dependency on wt-status.h

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorefresh_index_quietly(): express "optional" nature of index writing better
Junio C Hamano [Fri, 9 Nov 2007 00:24:00 +0000 (16:24 -0800)]
refresh_index_quietly(): express "optional" nature of index writing better

The point of the part of the code this patch touches is that if
we modified the active_cache, we try to write it out and make it
the index file for later users to use by calling
"commit_locked_index", but we do not really care about the
failure from this sequence because it is done purely as an
optimization.

The original code called three functions primarily for their
side effects but as condition of an if statement, which is
admittedly a bad style.

Incidentally, it squelches an "empty if body" warning from gcc.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix sed string regex escaping in module_name.
Ralf Wildenhues [Thu, 8 Nov 2007 21:48:49 +0000 (22:48 +0100)]
Fix sed string regex escaping in module_name.

When escaping a string to be used as a sed regex, it is important
to only escape active characters.  Escaping other characters is
undefined according to POSIX, and in practice leads to issues with
extensions such as GNU sed's \+.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAvoid a few unportable, needlessly nested "...`...".
Ralf Wildenhues [Thu, 8 Nov 2007 21:47:36 +0000 (22:47 +0100)]
Avoid a few unportable, needlessly nested "...`...".

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoStyle: place opening brace of a function definition at column 1
Junio C Hamano [Thu, 8 Nov 2007 23:35:32 +0000 (15:35 -0800)]
Style: place opening brace of a function definition at column 1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: remove cruft, $committer is not used
Gerrit Pape [Thu, 8 Nov 2007 12:11:57 +0000 (12:11 +0000)]
contrib/hooks/post-receive-email: remove cruft, $committer is not used

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agohooks--update: decline deleting tags or branches by default, add config options
Gerrit Pape [Thu, 8 Nov 2007 09:47:39 +0000 (09:47 +0000)]
hooks--update: decline deleting tags or branches by default, add config options

Decline deleting tags or branches through git push <remote> :<ref> by
default, support config options hooks.allowdeletetag, hooks.allowdeletebranch
to override this per repository.

Before this patch the update hook interpreted deleting a tag, no matter if
annotated or not, through git push <remote> :<tag> as unannotated tag, and
declined it by default, but with an unappropriate error message:

 $ git push origin :atag
 deleting 'refs/tags/atag'
 *** The un-annotated tag, atag, is not allowed in this repository
 *** Use 'git tag [ -a | -s ]' for tags you want to propagate.
 ng refs/tags/atag hook declined
 error: hooks/update exited with error code 1
 error: hook declined to update refs/tags/atag
 error: failed to push to 'monolith:/git/qm/test-repo'

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agohooks--update: fix test for properly set up project description file
Gerrit Pape [Thu, 8 Nov 2007 14:02:00 +0000 (14:02 +0000)]
hooks--update: fix test for properly set up project description file

The update hook template intends to abort if the project description file
hasn't been adjusted or is empty.  This patch fixes the check for 'being
adjusted'.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-pack: segfault fix on forced push
Junio C Hamano [Thu, 8 Nov 2007 09:38:12 +0000 (01:38 -0800)]
send-pack: segfault fix on forced push

When pushing to overwrite a ref that points at a commit we do
not even have, the recent "terse push" patch tried to get a
unique abbreviation for the non-existent (from our point of
view) object, which resulted in strcpy(buf, NULL) and
segfaulted.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-mailsplit: with maildirs not only process cur/, but also new/
Gerrit Pape [Tue, 6 Nov 2007 08:54:18 +0000 (08:54 +0000)]
git-mailsplit: with maildirs not only process cur/, but also new/

When saving patches to a maildir with e.g. mutt, the files are put into
the new/ subdirectory of the maildir, not cur/.  This makes git-am state
"Nothing to do.".  This patch lets git-mailsplit additional check new/
after reading cur/.

This was reported by Joey Hess through
 http://bugs.debian.org/447396

Signed-off-by: Gerrit Pape <pape@smarden.org>
Acked-by: Jeff King <peff@peff.net>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jc/clean-config'
Junio C Hamano [Thu, 8 Nov 2007 02:19:38 +0000 (18:19 -0800)]
Merge branch 'jc/clean-config'

* jc/clean-config:
  clean: require -f to do damage by default

17 years agoMerge branch 'gp/reset-q'
Junio C Hamano [Thu, 8 Nov 2007 02:18:55 +0000 (18:18 -0800)]
Merge branch 'gp/reset-q'

* gp/reset-q:
  git-reset: add -q option to operate quietly

17 years agoMerge branch 'ds/maint-deflatebound'
Junio C Hamano [Thu, 8 Nov 2007 02:17:20 +0000 (18:17 -0800)]
Merge branch 'ds/maint-deflatebound'

* ds/maint-deflatebound:
  Improve accuracy of check for presence of deflateBound.

17 years agoMerge branch 'cp/p4'
Junio C Hamano [Thu, 8 Nov 2007 02:16:18 +0000 (18:16 -0800)]
Merge branch 'cp/p4'

* cp/p4:
  git-p4: Detect changes to executable bit and include them in p4 submit.
  git-p4: Add a helper function to parse the full git diff-tree output.

17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 8 Nov 2007 02:07:07 +0000 (18:07 -0800)]
Merge branch 'maint'

* maint:
  Add Documentation/CodingGuidelines
  When exec() fails include the failing command in the error message
  RelNotes-1.5.3.5: fix another typo

17 years agoMerge branch 'mh/work-tree'
Junio C Hamano [Thu, 8 Nov 2007 01:37:00 +0000 (17:37 -0800)]
Merge branch 'mh/work-tree'

* mh/work-tree:
  Make git-blame fail when working tree is needed and we're not in one
  Don't always require working tree for git-rm
  Use setup_work_tree() in builtin-ls-files.c
  Refactor working tree setup

17 years agoSmall code readability improvement in show_reference() in builtin-tag.c
Mike Hommey [Sat, 3 Nov 2007 13:08:05 +0000 (14:08 +0100)]
Small code readability improvement in show_reference() in builtin-tag.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-email: apply --suppress-from to S-o-b and cc-cmd
Uwe Kleine-König [Wed, 7 Nov 2007 07:34:12 +0000 (08:34 +0100)]
send-email: apply --suppress-from to S-o-b and cc-cmd

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix minor nits in configure.ac
Ralf Wildenhues [Tue, 6 Nov 2007 20:12:45 +0000 (21:12 +0100)]
Fix minor nits in configure.ac

Avoid "test -o" as it is only XSI not POSIX, and not portable.
Avoid exit(3) in test programs in favor of return, to accommodate
for newer Autoconf not providing a declaration for exit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDeprecate git-lost-found
Johannes Schindelin [Thu, 8 Nov 2007 00:41:22 +0000 (00:41 +0000)]
Deprecate git-lost-found

"git fsck" learnt the option "--lost-found" in v1.5.3-rc0~5, to make
"git lost-found" obsolete.  It is time to deprecate "git lost-found".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoImprove accuracy of check for presence of deflateBound.
David Symonds [Wed, 7 Nov 2007 03:24:28 +0000 (14:24 +1100)]
Improve accuracy of check for presence of deflateBound.

ZLIB_VERNUM isn't defined in some zlib versions, so this patch does a proper
linking test in autoconf to see whether deflateBound exists in zlib. Also,
setting NO_DEFLATE_BOUND will also work for folk not using autoconf.

Signed-off-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd Documentation/CodingGuidelines
Johannes Schindelin [Thu, 8 Nov 2007 00:33:19 +0000 (00:33 +0000)]
Add Documentation/CodingGuidelines

Even if our code is quite a good documentation for our coding style,
some people seem to prefer a document describing it.

The part about the shell scripts is clearly just copied from one of
Junio's helpful mails, and some parts were added from comments by
Junio, Andreas Ericsson and Robin Rosenberg.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: make subject prefix configurable
Gerrit Pape [Tue, 6 Nov 2007 13:49:30 +0000 (13:49 +0000)]
contrib/hooks/post-receive-email: make subject prefix configurable

Email subjects are prefixed with "[SCM] " by default, make this optionally
configurable through the hooks.emailprefix config option.

Suggested by martin f krafft through
 http://bugs.debian.org/428418

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: reformat to wrap comments at 76 chars
Gerrit Pape [Tue, 6 Nov 2007 13:48:34 +0000 (13:48 +0000)]
contrib/hooks/post-receive-email: reformat to wrap comments at 76 chars

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: fix typo
Gerrit Pape [Tue, 6 Nov 2007 13:48:07 +0000 (13:48 +0000)]
contrib/hooks/post-receive-email: fix typo

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorestore fetching with thin-pack capability
Nicolas Pitre [Wed, 7 Nov 2007 22:20:22 +0000 (17:20 -0500)]
restore fetching with thin-pack capability

Broken since commit fa74052922cf39e5a39ad7178d1b13c2da9b4519.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoWhen exec() fails include the failing command in the error message
Ask Bjørn Hansen [Tue, 6 Nov 2007 10:54:01 +0000 (02:54 -0800)]
When exec() fails include the failing command in the error message

git-svn occasionally fails with no details as to what went wrong - this should help debug those situations.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRelNotes-1.5.3.5: fix another typo
David D Kilzer [Sun, 4 Nov 2007 12:45:22 +0000 (04:45 -0800)]
RelNotes-1.5.3.5: fix another typo

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoReteach builtin-ls-remote to understand remotes
Shawn O. Pearce [Wed, 7 Nov 2007 01:29:20 +0000 (20:29 -0500)]
Reteach builtin-ls-remote to understand remotes

Prior to being made a builtin git-ls-remote understood that when
it was given a remote name we wanted it to resolve that to the
pre-configured URL and connect to that location.  That changed when
it was converted to a builtin and many of my automation tools broke.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-reset: add -q option to operate quietly
Gerrit Pape [Sun, 4 Nov 2007 09:37:20 +0000 (09:37 +0000)]
git-reset: add -q option to operate quietly

Many git commands have a -q option to suppress output to stdout, let's
have it for git-reset too.

This was asked for by Joey Hess through
 http://bugs.debian.org/444933

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake git-blame fail when working tree is needed and we're not in one
Mike Hommey [Sat, 3 Nov 2007 12:22:55 +0000 (13:22 +0100)]
Make git-blame fail when working tree is needed and we're not in one

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDon't always require working tree for git-rm
Mike Hommey [Sat, 3 Nov 2007 11:23:13 +0000 (12:23 +0100)]
Don't always require working tree for git-rm

This allows to do git rm --cached -r directory, instead of
git ls-files -z directory | git update-index --remove -z --stdin.
This can be particularly useful for git-filter-branch users.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUse setup_work_tree() in builtin-ls-files.c
Mike Hommey [Sat, 3 Nov 2007 11:23:12 +0000 (12:23 +0100)]
Use setup_work_tree() in builtin-ls-files.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRefactor working tree setup
Mike Hommey [Sat, 3 Nov 2007 11:23:11 +0000 (12:23 +0100)]
Refactor working tree setup

Create a setup_work_tree() that can be used from any command requiring
a working tree conditionally.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoupload-pack: Use finish_{command,async}() instead of waitpid().
Johannes Sixt [Sun, 4 Nov 2007 19:46:48 +0000 (20:46 +0100)]
upload-pack: Use finish_{command,async}() instead of waitpid().

upload-pack spawns two processes, rev-list and pack-objects, and carefully
monitors their status so that it can report failure to the remote end.
This change removes the complicated procedures on the grounds of the
following observations:

- If everything is OK, rev-list closes its output pipe end, upon which
  pack-objects (which reads from the pipe) sees EOF and terminates itself,
  closing its output (and error) pipes. upload-pack reads from both until
  it sees EOF in both. It collects the exit codes of the child processes
  (which indicate success) and terminates successfully.

- If rev-list sees an error, it closes its output and terminates with
  failure. pack-objects sees EOF in its input and terminates successfully.
  Again upload-pack reads its inputs until EOF. When it now collects
  the exit codes of its child processes, it notices the failure of rev-list
  and signals failure to the remote end.

- If pack-objects sees an error, it terminates with failure. Since this
  breaks the pipe to rev-list, rev-list is killed with SIGPIPE.
  upload-pack reads its input until EOF, then collects the exit codes of
  the child processes, notices their failures, and signals failure to the
  remote end.

- If upload-pack itself dies unexpectedly, pack-objects is killed with
  SIGPIPE, and subsequently also rev-list.

The upshot of this is that precise monitoring of child processes is not
required because both terminate if either one of them dies unexpectedly.
This allows us to use finish_command() and finish_async() instead of
an explicit waitpid(2) call.

The change is smaller than it looks because most of it only reduces the
indentation of a large part of the inner loop.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobuiltin-reset: avoid forking "update-index --refresh"
Johannes Schindelin [Sat, 3 Nov 2007 15:21:21 +0000 (15:21 +0000)]
builtin-reset: avoid forking "update-index --refresh"

Instead of forking update-index, call refresh_cache() directly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobuiltin-reset: do not call "ls-files --unmerged"
Johannes Schindelin [Sat, 3 Nov 2007 14:33:01 +0000 (14:33 +0000)]
builtin-reset: do not call "ls-files --unmerged"

Since reset is a builtin now, it can use the full power of libgit.a
and check for unmerged entries itself.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoparse-options: abbreviation engine fix.
Johannes Schindelin [Mon, 5 Nov 2007 13:15:21 +0000 (13:15 +0000)]
parse-options: abbreviation engine fix.

When an option could be an ambiguous abbreviation of two options, the code
used to error out.  Even if an exact match would have occured later.

Test and original patch by Pierre Habouzit.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 6 Nov 2007 06:03:47 +0000 (22:03 -0800)]
Merge branch 'maint'

* maint:
  Remove a couple of duplicated include
  grep with unmerged index
  git-daemon: fix remote port number in log entry
  git-svn: t9114: verify merge commit message in test
  git-svn: fix dcommit clobbering when committing a series of diffs

17 years agoFix comment in strbuf.h to use correct name strbuf_avail()
Steffen Prohaska [Sun, 4 Nov 2007 08:02:21 +0000 (09:02 +0100)]
Fix comment in strbuf.h to use correct name strbuf_avail()

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>