]> asedeno.scripts.mit.edu Git - git.git/log
git.git
17 years agogit-bundle: only die if pack would be empty, warn if ref is skipped
Johannes Schindelin [Fri, 9 Mar 2007 16:30:15 +0000 (17:30 +0100)]
git-bundle: only die if pack would be empty, warn if ref is skipped

A use case for git-bundle expected to be quite common is this:

$ git bundle create daily.bundle --since=10.days.ago --all

The expected outcome is _not_ to error out if only a couple of the
refs were not changed during the last 10 days.

This patch complains loudly about refs which are skipped due to the
pack not containing the corresponding objects, but dies only if
no objects would be in the pack _at all_.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-send-email: configurable bcc and chain-reply-to
Avi Kivity [Sun, 11 Mar 2007 17:19:44 +0000 (19:19 +0200)]
git-send-email: configurable bcc and chain-reply-to

Chain-reply-to is a personal perference, and is unlikely to change from
patchset to patchset.  Similarly, bcc is likely to have the same values
every invocation is one likes to bcc oneself.

So, allow both to be set via configuration variables.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 12 Mar 2007 06:53:52 +0000 (23:53 -0700)]
Merge branch 'maint'

* maint:
  git-send-email: Document configuration options
  git-merge: warn when -m provided on a fast forward

17 years agogit-send-email: Document configuration options
Avi Kivity [Sun, 11 Mar 2007 17:19:43 +0000 (19:19 +0200)]
git-send-email: Document configuration options

Wishing to implement an email aliases file, I found that they were already
implmented.  Document them for the next user.

Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-merge: warn when -m provided on a fast forward
J. Bruce Fields [Sun, 11 Mar 2007 16:28:56 +0000 (12:28 -0400)]
git-merge: warn when -m provided on a fast forward

Warn the user that the "-m" option is ignored in the case of a fast
forward.  That may save some confusion in the case where the user
doesn't know about fast forwards yet and may not realize that the
behavior here is intentional.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'jc/boundary'
Junio C Hamano [Mon, 12 Mar 2007 06:02:52 +0000 (23:02 -0700)]
Merge branch 'jc/boundary'

* jc/boundary:
  git-bundle: prevent overwriting existing bundles
  git-bundle: die if a given ref is not included in bundle
  git-bundle: handle thin packs in subcommand "unbundle"
  git-bundle: Make thin packs
  git-bundle: avoid packing objects which are in the prerequisites
  bundle: fix wrong check of read_header()'s return value & add tests
  revision --boundary: fix uncounted case.
  revision --boundary: fix stupid typo
  git-bundle: make verify a bit more chatty.
  revision traversal: SHOWN means shown
  git-bundle: various fixups
  revision traversal: retire BOUNDARY_SHOW
  revision walker: Fix --boundary when limited

17 years agoChange {pre,post}-receive hooks to use stdin
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:16 +0000 (03:28 -0500)]
Change {pre,post}-receive hooks to use stdin

Sergey Vlasov, Andy Parkins and Alex Riesen all pointed out that it
is possible for a single invocation of receive-pack to be given more
refs than the OS might allow us to pass as command line parameters
to a single hook invocation.

We don't want to break these up into multiple invocations (like
xargs might do) as that makes it impossible for the pre-receive
hook to verify multiple related ref updates occur at the same time,
and it makes it harder for post-receive to send out a single batch
notification.

Instead we pass the reference data on a pipe connected to the
hook's stdin, supplying one ref per line to the hook.  This way a
single hook invocation can obtain an infinite amount of ref data,
without bumping into any operating system limits.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSplit back out update_hook handling in receive-pack
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:13 +0000 (03:28 -0500)]
Split back out update_hook handling in receive-pack

Since we have decided to change the calling conventions for the
pre-receive and post-receive hooks to take the ref data on stdin
rather than on the command line we cannot use the same logic to
invoke the update hook anymore.

So we take a small step backwards towards what we used to have,
and create a specialized function for executing just the update
hook.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRefactor run_command error handling in receive-pack
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:11 +0000 (03:28 -0500)]
Refactor run_command error handling in receive-pack

I'm pulling the error handling used to decode the result of
run_command up into a new function so that I can reuse it.
No changes, just a simple code movement.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoTeach run_command how to setup a stdin pipe
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:08 +0000 (03:28 -0500)]
Teach run_command how to setup a stdin pipe

Sometimes callers trying to use run_command to execute a child
process will want to setup a pipe or file descriptor to redirect
into the child's stdin.

This idea is completely stolen from builtin-bundle's fork_with_pipe,
written by Johannes Schindelin.  All credit (and blame) should lie
with Dscho.  ;-)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSplit run_command into two halves (start/finish)
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:05 +0000 (03:28 -0500)]
Split run_command into two halves (start/finish)

If the calling process wants to send data to stdin of a
child process it will need to arrange for a pipe and get
the child process running, feed data to it, then wait
for the child process to finish.  So we split the run
function into two halves, allowing callers to first
start the child then later finish it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoStart defining a more sophisticated run_command
Shawn O. Pearce [Sat, 10 Mar 2007 08:28:00 +0000 (03:28 -0500)]
Start defining a more sophisticated run_command

There are a number of places where we do some variation of
fork()+exec() but we also need to setup redirection in the process,
much like what run_command does for us already with its option flags.

It would be nice to reuse more of the run_command logic, especially
as that non-fork API helps us to port to odd platforms like Win32.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRemove unused run_command variants
Shawn O. Pearce [Sat, 10 Mar 2007 08:27:52 +0000 (03:27 -0500)]
Remove unused run_command variants

We don't actually use these va_list based variants of run_command
anymore.  I'm removing them before I make further improvements.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSwitch to run_command_v_opt in revert
Shawn O. Pearce [Sat, 10 Mar 2007 08:27:28 +0000 (03:27 -0500)]
Switch to run_command_v_opt in revert

Another change by me is removing the va_list variants of run_command,
one of which is used by builtin-revert.c.  To avoid compile errors
I'm refactoring builtin-revert to use the char** variant instead,
as that variant is staying.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocvsserver: Use Merged response instead of Update-existing for merged files
Frank Lichtenheld [Tue, 6 Mar 2007 09:42:24 +0000 (10:42 +0100)]
cvsserver: Use Merged response instead of Update-existing for merged files

Using Update-existing leads to the client forgetting about the "locally
modified" status of the file which can lead to loss of local changes on
later updates.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Acked-by: Martin Langhoff <martin.langhoff@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoI like the idea of the new ':/<oneline prefix>' notation, and gave it
Jim Meyering [Sun, 11 Mar 2007 18:49:08 +0000 (19:49 +0100)]
I like the idea of the new ':/<oneline prefix>' notation, and gave it
a try, but all I could get was a segfault.  It was dereferencing a NULL
commit list.  Fix below.  With it, this example now works:

    $ mkdir .j; cd .j; touch f
    $ git-init; git-add f; git-commit -mc f; echo x >f; git-commit -md f
    $ git-diff -p :/c :/d
    diff --git a/f b/f
    index e69de29..587be6b 100644
    --- a/f
    +++ b/f
    @@ -0,0 +1 @@
    +x

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoprepare_packed_git(): sort packs by age and localness.
Junio C Hamano [Fri, 9 Mar 2007 11:52:12 +0000 (03:52 -0800)]
prepare_packed_git(): sort packs by age and localness.

When accessing objects, we first look for them in packs that
are linked together in the reverse order of discovery.

Since younger packs tend to contain more recent objects, which
are more likely to be accessed often, and local packs tend to
contain objects more relevant to our specific projects, sort the
list of packs before starting to access them.  In addition,
favoring local packs over the ones borrowed from alternates can
be a win when alternates are mounted on network file systems.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix broken create_branch() in builtin-branch.
Junio C Hamano [Thu, 8 Mar 2007 21:59:54 +0000 (13:59 -0800)]
Fix broken create_branch() in builtin-branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-branch, git-checkout: autosetup for remote branch tracking
Paolo Bonzini [Thu, 8 Mar 2007 09:58:35 +0000 (10:58 +0100)]
git-branch, git-checkout: autosetup for remote branch tracking

In order to track and build on top of a branch 'topic' you track from
your upstream repository, you often would end up doing this sequence:

  git checkout -b mytopic origin/topic
  git config --add branch.mytopic.remote origin
  git config --add branch.mytopic.merge refs/heads/topic

This would first fork your own 'mytopic' branch from the 'topic'
branch you track from the 'origin' repository; then it would set up two
configuration variables so that 'git pull' without parameters does the
right thing while you are on your own 'mytopic' branch.

This commit adds a --track option to git-branch, so that "git
branch --track mytopic origin/topic" performs the latter two actions
when creating your 'mytopic' branch.

If the configuration variable branch.autosetupmerge is set to true, you
do not have to pass the --track option explicitly; further patches in
this series allow setting the variable with a "git remote add" option.
The configuration variable is off by default, and there is a --no-track
option to countermand it even if the variable is set.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'js/attach'
Junio C Hamano [Sun, 11 Mar 2007 07:38:18 +0000 (23:38 -0800)]
Merge branch 'js/attach'

* js/attach:
  format-patch --attach: not folding some long headers.
  format-patch: add --inline option and make --attach a true attachment

17 years agoMerge branch 'js/diff-ni'
Junio C Hamano [Sun, 11 Mar 2007 07:26:33 +0000 (23:26 -0800)]
Merge branch 'js/diff-ni'

* js/diff-ni:
  Get rid of the dependency to GNU diff in the tests
  diff --no-index: support /dev/null as filename
  diff-ni: fix the diff with standard input
  diff: support reading a file from stdin via "-"

17 years agoMerge branch 'jc/fsck'
Junio C Hamano [Sun, 11 Mar 2007 07:10:26 +0000 (23:10 -0800)]
Merge branch 'jc/fsck'

* jc/fsck:
  fsck: exit with non-zero status upon errors
  unpack_sha1_file(): detect corrupt loose object files.
  fsck: fix broken loose object check.

17 years agoMerge branch 'pb/commit-i'
Junio C Hamano [Sun, 11 Mar 2007 07:00:38 +0000 (23:00 -0800)]
Merge branch 'pb/commit-i'

* pb/commit-i:
  git-commit: add a --interactive option

17 years agoMerge branch 'js/revert-cherry'
Junio C Hamano [Sun, 11 Mar 2007 07:00:11 +0000 (23:00 -0800)]
Merge branch 'js/revert-cherry'

* js/revert-cherry:
  cherry-pick: Bug fix 'cherry picked from' message.
  cherry-pick: Suggest a better method to retain authorship
  Make git-revert & git-cherry-pick a builtin

17 years agoMerge branch 'sp/make'
Junio C Hamano [Sun, 11 Mar 2007 06:33:13 +0000 (22:33 -0800)]
Merge branch 'sp/make'

* sp/make:
  Allow "make -w" generate its usual output
  Support of "make -s": do not output anything of the build itself
  More build output cleaning up
  Make 'make' quiet by default
  Make 'make' quieter while building git

17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 11 Mar 2007 06:07:26 +0000 (22:07 -0800)]
Merge branch 'maint'

* maint:
  git.el: Retrieve commit log information from .dotest directory.
  git.el: Avoid appending a signoff line that is already present.
  setup_git_directory_gently: fix off-by-one error
  user-manual: install user manual stylesheet with other web documents
  user-manual: fix rendering of history diagrams
  user-manual: fix missing colon in git-show example
  user-manual: fix inconsistent use of pull and merge
  user-manual: fix inconsistent example
  glossary: fix overoptimistic automatic linking of defined terms
  Documentation: s/seperator/separator/
  Adjust reflog filemode in shared repository

17 years agogit.el: Retrieve commit log information from .dotest directory.
Alexandre Julliard [Sat, 10 Mar 2007 18:22:26 +0000 (19:22 +0100)]
git.el: Retrieve commit log information from .dotest directory.

If a git-am or git-rebase is in progress, fill the commit log buffer
from the commit information found in the various files in the .dotest
directory.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit.el: Avoid appending a signoff line that is already present.
Alexandre Julliard [Sat, 10 Mar 2007 18:21:25 +0000 (19:21 +0100)]
git.el: Avoid appending a signoff line that is already present.

Also avoid inserting an extra newline if other signoff lines are
present.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agosetup_git_directory_gently: fix off-by-one error
Matthias Lederhofer [Sun, 11 Mar 2007 01:35:00 +0000 (02:35 +0100)]
setup_git_directory_gently: fix off-by-one error

don't tell getcwd that the buffer has one spare byte for an extra /

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint' of git://linux-nfs.org/~bfields/git into maint
Junio C Hamano [Sun, 11 Mar 2007 05:47:01 +0000 (21:47 -0800)]
Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maint

* 'maint' of git://linux-nfs.org/~bfields/git:
  user-manual: install user manual stylesheet with other web documents
  user-manual: fix rendering of history diagrams
  user-manual: fix missing colon in git-show example
  user-manual: fix inconsistent use of pull and merge
  user-manual: fix inconsistent example
  glossary: fix overoptimistic automatic linking of defined terms

17 years agouser-manual: install user manual stylesheet with other web documents
J. Bruce Fields [Sun, 11 Mar 2007 03:58:54 +0000 (22:58 -0500)]
user-manual: install user manual stylesheet with other web documents

Install the stylesheet needed for the user manual.  This should solve
the problem of, e.g.,

http://www.kernel.org/pub/software/scm/git/docs/user-manual.html

lacking a lot of formatting.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: fix rendering of history diagrams
J. Bruce Fields [Sun, 11 Mar 2007 03:38:13 +0000 (22:38 -0500)]
user-manual: fix rendering of history diagrams

Asciidoc appears to interpret a backslash at the end of a line as
escaping the end-of-line character, which screws up the display of
history diagrams like

 o--o--o
\
 o--...

The obvious fix (replacing "\" by "\\") doesn't work.  The only
workaround I've found is to include all such diagrams in a LiteralBlock.
Asciidoc claims that should be equivalent to a literal paragraph, so I
don't understand why the difference--perhaps it's an asciidoc bug.

Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: fix missing colon in git-show example
J. Bruce Fields [Sun, 11 Mar 2007 03:00:12 +0000 (22:00 -0500)]
user-manual: fix missing colon in git-show example

There should be a colon in this git-show example.

Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: fix inconsistent use of pull and merge
J. Bruce Fields [Sun, 11 Mar 2007 02:52:39 +0000 (21:52 -0500)]
user-manual: fix inconsistent use of pull and merge

I used "git pull ." instead of "git merge" here without any explanation.
Stick instead to "git merge" for now (the equivalent pull syntax is
still covered in a later chapter).

Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: fix inconsistent example
J. Bruce Fields [Sun, 11 Mar 2007 02:45:29 +0000 (21:45 -0500)]
user-manual: fix inconsistent example

The configuration file fragment here is inconsistent with the text
above.  Thanks to Ramsay Jones for the correction.

Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agoglossary: fix overoptimistic automatic linking of defined terms
J. Bruce Fields [Mon, 5 Mar 2007 00:13:09 +0000 (19:13 -0500)]
glossary: fix overoptimistic automatic linking of defined terms

The script sort_glossary.pl turns each use of "term" into a link to the
definition of "term".  To avoid mangling links like

gitlink:git-term[1]

it doesn't replace any occurence of "term" preceded by "link:git-".
This fails for gitlink:git-symbolic-ref[1] when substituting for "ref".

So instead just refuse to replace anything preceded by a "-".
That could result in missing some opportunities, but that's a less
annoying error.

Actually I find the automatic substitution a little distracting; some
day maybe we should just run it once and commit the result, so it can
be hand-tuned.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agoDocumentation: s/seperator/separator/
Jeff King [Fri, 9 Mar 2007 20:21:41 +0000 (15:21 -0500)]
Documentation: s/seperator/separator/

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdjust reflog filemode in shared repository
Matthias Kestenholz [Fri, 9 Mar 2007 22:38:57 +0000 (23:38 +0100)]
Adjust reflog filemode in shared repository

Without this, committing in a group-shared repository would not work
even though all developers are in the same group.

Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoadd: Support specifying an excludes file with a configuration variable
James Bowes [Wed, 28 Feb 2007 03:31:10 +0000 (22:31 -0500)]
add: Support specifying an excludes file with a configuration variable

This adds the 'core.excludesfile' configuration variable. This variable can
hold a path to a file containing patterns of file names to exclude from
git-add, like $GIT_DIR/info/exclude. Patterns in the excludes file are used
in addition to those in info/exclude.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-commit: add a --interactive option
Paolo Bonzini [Mon, 5 Mar 2007 07:57:53 +0000 (08:57 +0100)]
git-commit: add a --interactive option

The --interactive option behaves like "git commit", except that
"git add --interactive" is executed before committing.  It is
incompatible with -a and -i.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: prevent overwriting existing bundles
Johannes Schindelin [Fri, 9 Mar 2007 02:50:06 +0000 (03:50 +0100)]
git-bundle: prevent overwriting existing bundles

Not only does it prevent accidentally losing older bundles, but it
also fixes a subtle bug: when writing into an existing bundle,
git-pack-objects would not truncate the bundle. Therefore,
fetching from the bundle would trigger an error in unpack-objects:
"fatal: pack has junk at the end".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: die if a given ref is not included in bundle
Johannes Schindelin [Fri, 9 Mar 2007 02:48:46 +0000 (03:48 +0100)]
git-bundle: die if a given ref is not included in bundle

The earlier patch tried to be nice by just warning, but it seems
more likely that the user wants to adjust the parameters.

Also, it prevents a bundle containing _all_ revisions in the case
when the user only gave one ref, but also rev-list options which
excluded the ref.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: handle thin packs in subcommand "unbundle"
Johannes Schindelin [Fri, 9 Mar 2007 02:48:27 +0000 (03:48 +0100)]
git-bundle: handle thin packs in subcommand "unbundle"

The patch to make the packs in a bundle thin forgot the receiving side.
D'oh.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'js/config-rename'
Junio C Hamano [Thu, 8 Mar 2007 08:53:38 +0000 (00:53 -0800)]
Merge branch 'js/config-rename'

* js/config-rename:
  git-config: document --rename-section, provide --remove-section

17 years agoMerge branch 'master' of git://repo.or.cz/git/fastimport
Junio C Hamano [Thu, 8 Mar 2007 07:10:05 +0000 (23:10 -0800)]
Merge branch 'master' of git://repo.or.cz/git/fastimport

* 'master' of git://repo.or.cz/git/fastimport:
  Allow fast-import frontends to reload the marks table
  Use atomic updates to the fast-import mark file
  Preallocate memory earlier in fast-import

17 years agogit-bundle: Make thin packs
Johannes Schindelin [Thu, 8 Mar 2007 00:27:44 +0000 (01:27 +0100)]
git-bundle: Make thin packs

Thin packs are way smaller, but they rely on the receiving end to have the
base objects. However, Git's pack protocol also uses thin packs by
default. So make the packs contained in bundles thin, since bundles are
just another transport.

The patch looks a bit bigger than intended, mainly because --thin
_implies_ that pack-objects should run its own rev-list. Therefore, this
patch removes all the stuff we used to roll rev-list ourselves.

This commit also changes behaviour slightly: since we now know early
enough if a specified ref is _not_ contained in the pack, we can avoid
putting that ref into the pack. So, we don't die() here, but warn()
instead, and skip that ref.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: avoid packing objects which are in the prerequisites
Johannes Schindelin [Wed, 7 Mar 2007 23:43:05 +0000 (00:43 +0100)]
git-bundle: avoid packing objects which are in the prerequisites

When saying something like "--since=1.day.ago" or "--max-count=5",
git-bundle finds the boundary commits which are recorded as
prerequisites. However, it failed to tell pack-objects _not_ to
pack the objects which are in these.

Fix that. And add a test for that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAllow fast-import frontends to reload the marks table
Shawn O. Pearce [Wed, 7 Mar 2007 23:07:26 +0000 (18:07 -0500)]
Allow fast-import frontends to reload the marks table

I'm giving fast-import a lesson on how to reload the marks table
using the same format it outputs with --export-marks.  This way
a frontend can reload the marks table from a prior import, making
incremental imports less painful.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoUse atomic updates to the fast-import mark file
Shawn O. Pearce [Wed, 7 Mar 2007 23:05:38 +0000 (18:05 -0500)]
Use atomic updates to the fast-import mark file

When we allow fast-import frontends to reload a mark file from a
prior session we want to let them use the same file as they exported
the marks to.  This makes it very simple for the frontend to save
state across incremental imports.

But we don't want to lose the old marks table if anything goes wrong
while writing our current marks table.  So instead of truncating and
overwriting the path specified to --export-marks we use the standard
lockfile code to write the current marks out to a temporary file,
then rename it over the old marks table.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoTeach receive-pack to run pre-receive/post-receive hooks
Shawn O. Pearce [Wed, 7 Mar 2007 21:52:05 +0000 (16:52 -0500)]
Teach receive-pack to run pre-receive/post-receive hooks

Bill Lear pointed out that it is easy to send out notifications of
changes with the update hook, but successful execution of the update
hook does not necessarily mean that the ref was actually updated.
Lock contention on the ref or being unable to append to the reflog
may prevent the ref from being changed.  Sending out notifications
prior to the ref actually changing is very misleading.

To help this situation I am introducing two new hooks to the
receive-pack flow: pre-receive and post-receive.  These new hooks
are invoked only once per receive-pack execution and are passed
three arguments per ref (refname, old-sha1, new-sha1).

The new post-receive hook is ideal for sending out notifications,
as it has the complete list of all refnames that were successfully
updated as well as the old and new SHA-1 values.  This allows more
interesting notifications to be sent.  Multiple ref updates could
be easily summarized into one email, for example.

The new pre-receive hook is ideal for logging update attempts, as it
is run only once for the entire receive-pack operation.  It can also
be used to verify multiple updates happen at once, e.g. an update
to the `maint` head must also be accompained by a new annotated tag.

Lots of documentation improvements for receive-pack are included
in this change, as we want to make sure the new hooks are clearly
explained.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRefactor handling of error_string in receive-pack
Shawn O. Pearce [Wed, 7 Mar 2007 21:51:59 +0000 (16:51 -0500)]
Refactor handling of error_string in receive-pack

I discovered we did not send an ng line in the report-status feedback
if the ref was not updated because the repository has the config
option receive.denyNonFastForwards enabled.  I think the reason this
happened is that it is simply too easy to forget to set error_string
when returning back a failure from update()

We now return an ng line for a non-fastforward update, which in
turn will cause send-pack to exit with a non-zero exit status.
Hence the modified test.

This refactoring changes update to return a const char* describing
the error, which execute_commands always loads into error_string.
The result is what I think is cleaner code, and allows us to
initialize the error_string member to NULL when we read_head_info.

I want error_string to be NULL in all commands before we call
execute_commands, so that we can reuse the run_hook function to
execute a new pre-receive hook.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoRefactor run_update_hook to be more useful
Shawn O. Pearce [Wed, 7 Mar 2007 21:51:09 +0000 (16:51 -0500)]
Refactor run_update_hook to be more useful

This is a simple refactoring of run_update_hook to allow the function
to be passed the name of the hook it runs and also to build the
argument list from a list of struct commands, rather than just one
struct command.

The refactoring is to support new pre-receive and post-receive
hooks that will be given the entire list of struct commands,
rather than just one struct command.  These new hooks will follow
in another patch.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDon't run post-update hook unless a ref changed
Shawn O. Pearce [Wed, 7 Mar 2007 21:50:43 +0000 (16:50 -0500)]
Don't run post-update hook unless a ref changed

There is little point in executing the post-update hook if all refs
had an error and were unable to be updated.  In this case nothing
new is reachable within the repository, and there is no state change
for the post-update hook to be interested in.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMove post-update hook to after all other activity
Shawn O. Pearce [Wed, 7 Mar 2007 21:50:24 +0000 (16:50 -0500)]
Move post-update hook to after all other activity

As the post-update hook is meant to run after we have completed the
receipt of the pushed changes, and it might actually try to kick off
a `repack -a -d`, we should delay on invoking it until after we have
removed the *.keep file on the uploaded pack (if we kept the pack).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 7 Mar 2007 22:45:25 +0000 (14:45 -0800)]
Merge branch 'maint'

* maint:
  Catch write_ref_sha1 failure in receive-pack
  make t8001 work on Mac OS X again

17 years agoPreallocate memory earlier in fast-import
Shawn O. Pearce [Wed, 7 Mar 2007 22:09:21 +0000 (17:09 -0500)]
Preallocate memory earlier in fast-import

I'm about to teach fast-import how to reload the marks file created
by a prior session.  The general approach that I want to use is to
immediately parse the marks file when the specific argument is found
in argv, thereby allowing the caller to supply multiple marks files,
as the mark space can be sparsely populated.

To make that work out we need to allocate our object tables before
we parse the command line options.  Since none of these tables
depend on the command line options, we can easily relocate them.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoCast 64 bit off_t to 32 bit size_t
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:37 +0000 (20:44 -0500)]
Cast 64 bit off_t to 32 bit size_t

Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
This implies that we are able to access and work on files whose
maximum length is around 2^63-1 bytes, but we can only malloc or
mmap somewhat less than 2^32-1 bytes of memory.

On such a system an implicit conversion of off_t to size_t can cause
the size_t to wrap, resulting in unexpected and exciting behavior.
Right now we are working around all gcc warnings generated by the
-Wshorten-64-to-32 option by passing the off_t through xsize_t().

In the future we should make xsize_t on such problematic platforms
detect the wrapping and die if such a file is accessed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse off_t in pack-objects/fast-import when we mean an offset
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:34 +0000 (20:44 -0500)]
Use off_t in pack-objects/fast-import when we mean an offset

Always use an off_t value in pack-objects anytime we are dealing
with an offset to some data within a packfile.

Also fixed a minor uintmax_t that was incorrectly defined before.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse off_t when we really mean a file offset.
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:30 +0000 (20:44 -0500)]
Use off_t when we really mean a file offset.

Not all platforms have declared 'unsigned long' to be a 64 bit value,
but we want to support a 64 bit packfile (or close enough anyway)
in the near future as some projects are getting large enough that
their packed size exceeds 4 GiB.

By using off_t, the POSIX type that is declared to mean an offset
within a file, we support whatever maximum file size the underlying
operating system will handle.  For most modern systems this is up
around 2^60 or higher.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse uint32_t for pack-objects counters.
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:24 +0000 (20:44 -0500)]
Use uint32_t for pack-objects counters.

As we technically try to support up to a maximum of 2**32-1 objects
in a single packfile we should act like it and use unsigned 32 bit
integers for all of our object counts and progress output.

This change does not modify everything in pack-objects that probably
needs to change to fully support the maximum of 2**32-1 objects.
I'm intentionally breaking the improvements into slightly smaller
commits to make them easier to follow.

No logic change should be occuring here, with the exception that
some comparsions will now work properly when the number of objects
exceeds 2**31-1.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoUse uint32_t for all packed object counts.
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:19 +0000 (20:44 -0500)]
Use uint32_t for all packed object counts.

As we permit up to 2^32-1 objects in a single packfile we cannot
use a signed int to represent the object offset within a packfile,
after 2^31-1 objects we will start seeing negative indexes and
error out or compute bad addresses within the mmap'd index.

This is a minor cleanup that does not introduce any significant
logic changes.  It is roach free.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoGeneral const correctness fixes
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:17 +0000 (20:44 -0500)]
General const correctness fixes

We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime.  Likewise we should always be
treating unsigned values as unsigned values, not as signed values.

Most of these are very straightforward.  The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case.  Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDon't build external_grep if its not used
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:14 +0000 (20:44 -0500)]
Don't build external_grep if its not used

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoFix mmap leak caused by reading bad indexes.
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:11 +0000 (20:44 -0500)]
Fix mmap leak caused by reading bad indexes.

If an index is corrupt, or is simply too new for us to understand,
we were leaking the mmap that held the entire content of the index.
This could be a considerable size on large projects, given that
the index is at least 24 bytes * nr_objects.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoDisplay the null SHA-1 as the base for an OBJ_OFS_DELTA.
Shawn O. Pearce [Wed, 7 Mar 2007 01:44:08 +0000 (20:44 -0500)]
Display the null SHA-1 as the base for an OBJ_OFS_DELTA.

Because we are currently cheating and never supplying the delta base
for an OBJ_OFS_DELTA we get a random SHA-1 in the delta base field.
Instead lets clear the hash out so its at least all 0's.  This is
somewhat more obvious that something fishy is going on, like we
don't actually have the SHA-1 of the base handy.  :)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-archimport: allow remapping branch names
Paolo Bonzini [Wed, 7 Mar 2007 09:43:41 +0000 (10:43 +0100)]
git-archimport: allow remapping branch names

This patch adds support to archimport for remapping the branch
names to match those used in git more closely.  This is useful
for projects that migrate to git (as opposed to users that want
to use git on Arch-based projects).  For example, one can choose
an Arch branch name and call it "master".

The new command-line syntax works even if there is a colon in
a branch name, since only the part after the last colon is taken
to be the git name (git does not allow colons in branch names).

The new feature is implemented so that archives rotated every
year can also be remapped into a single git archive.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agot/t5515-fetch-merge-logic.sh: Add two more tests
Santi B\e,Ai\e(Bjar [Wed, 7 Mar 2007 12:18:59 +0000 (13:18 +0100)]
t/t5515-fetch-merge-logic.sh: Add two more tests

They test the behaviour with just a URL in the command line.

Signed-off-by: Santi B\e,Ai\e(Bjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoCatch write_ref_sha1 failure in receive-pack
Shawn O. Pearce [Wed, 7 Mar 2007 17:04:24 +0000 (12:04 -0500)]
Catch write_ref_sha1 failure in receive-pack

This failure to catch the failure of write_ref_sha1 was noticed
by Bill Lear.  The ref will not update if the log file could not
be appended to (due to file permissions problems).  Such a failure
should be flagged as a failure to update the ref, so that the client
knows the push did not succeed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agobundle: fix wrong check of read_header()'s return value & add tests
Johannes Schindelin [Tue, 6 Mar 2007 21:57:07 +0000 (22:57 +0100)]
bundle: fix wrong check of read_header()'s return value & add tests

If read_header() fails, it returns <0, not 0. Further, an open(/dev/null)
was not checked for errors.

Also, this adds two tests to make sure that the bundle file looks
correct, by checking if it has the header has the expected form, and that
the pack contains the right amount of objects.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Don't escape attributes in CGI.pm HTML methods
Jakub Narebski [Wed, 7 Mar 2007 01:21:25 +0000 (02:21 +0100)]
gitweb: Don't escape attributes in CGI.pm HTML methods

There is no need to escape HTML tag's attributes in CGI.pm
HTML methods (like CGI::a()), because CGI.pm does attribute
escaping automatically.

  $cgi->a({ ... -attribute => atribute_value }, tag_contents)

is translated to

  <a ... attribute="attribute_value">tag_contents</a>

The rules for escaping attribute values (which are string contents) are
different. For example you have to take care about escaping embedded '"'
and "'" characters; CGI::a() does that for us automatically.

CGI::a() does not HTML escape tag_contents; we would need to write

  <a href="URL">some <b>bold</b> text</a>

for example. So we use esc_html (or esc_path) to escape tag_contents
as needed.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAllow "make -w" generate its usual output
Alex Riesen [Tue, 6 Mar 2007 23:05:34 +0000 (00:05 +0100)]
Allow "make -w" generate its usual output

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoSupport of "make -s": do not output anything of the build itself
Alex Riesen [Tue, 6 Mar 2007 23:44:49 +0000 (00:44 +0100)]
Support of "make -s": do not output anything of the build itself

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMore build output cleaning up
Alex Riesen [Tue, 6 Mar 2007 22:37:18 +0000 (23:37 +0100)]
More build output cleaning up

- print output file name for .c files
- suppress output of the names of subdirectories when make changes into them
- use GEN prefix for makefile generation in perl/

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agomake t8001 work on Mac OS X again
Johannes Schindelin [Wed, 7 Mar 2007 00:48:59 +0000 (19:48 -0500)]
make t8001 work on Mac OS X again

The test was recently broken to expect sed to leave the
incomplete line at the end without newline.

POSIX says that output of the pattern space is to be followed by
a newline, while GNU adds the newline back only when it was
stripped when input.  GNU behaviour is arguably more intuitive
and nicer, but we should not depend on it.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-gui: Support of "make -s" in: do not output anything of the build itself
Alex Riesen [Tue, 6 Mar 2007 23:44:37 +0000 (00:44 +0100)]
git-gui: Support of "make -s" in: do not output anything of the build itself

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agorevision --boundary: fix uncounted case.
Junio C Hamano [Tue, 6 Mar 2007 11:20:55 +0000 (03:20 -0800)]
revision --boundary: fix uncounted case.

When the list is truly limited and get_revision_1() returned NULL,
the code incorrectly returned it without switching to boundary emiting
mode.  Silly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogitweb: Change to use explicitly function call cgi->escapHTML()
Li Yang [Tue, 6 Mar 2007 03:58:56 +0000 (11:58 +0800)]
gitweb: Change to use explicitly function call cgi->escapHTML()

Change to use explicitly function call cgi->escapHTML().
This fix the problem on some systems that escapeHTML() is not
functioning, as default CGI is not setting 'escape' parameter.

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorevision --boundary: fix stupid typo
Junio C Hamano [Tue, 6 Mar 2007 11:00:18 +0000 (03:00 -0800)]
revision --boundary: fix stupid typo

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: make verify a bit more chatty.
Junio C Hamano [Tue, 6 Mar 2007 00:17:27 +0000 (16:17 -0800)]
git-bundle: make verify a bit more chatty.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorevision traversal: SHOWN means shown
Junio C Hamano [Tue, 6 Mar 2007 02:23:57 +0000 (18:23 -0800)]
revision traversal: SHOWN means shown

This moves the code to set SHOWN on the commit from get_revision_1()
back to get_revision(), so that the bit means what it originally
meant: this commit has been given back to the caller.

Also it fixes the --reverse breakage Dscho pointed out.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-bundle: various fixups
Junio C Hamano [Tue, 6 Mar 2007 00:16:32 +0000 (16:16 -0800)]
git-bundle: various fixups

verify_bundle() returned with an error early only when all
prerequisite commits were missing.  It should error out much
earlier when some are missing.

When the rev-list is limited in ways other than revision range
(e.g. --max-count or --max-age), create_bundle() listed all
positive refs given from the command line as if they are
available, but resulting pack may not have some of them.  Add a
logic to make sure all of them are included, and error out
otherwise.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorevision traversal: retire BOUNDARY_SHOW
Junio C Hamano [Tue, 6 Mar 2007 00:10:28 +0000 (16:10 -0800)]
revision traversal: retire BOUNDARY_SHOW

This removes the flag internally used by revision traversal to
decide which commits are indeed boundaries and renames it to
CHILD_SHOWN.  builtin-bundle uses the symbol for its
verification, but I think the logic it uses it is wrong.  The
flag is still useful but it is local to the git-bundle, so it is
renamed to PREREQ_MARK.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agorevision walker: Fix --boundary when limited
Junio C Hamano [Mon, 5 Mar 2007 21:10:06 +0000 (13:10 -0800)]
revision walker: Fix --boundary when limited

This cleans up the boundary processing in the commit walker.  It

 - rips out the boundary logic from the commit walker. Placing
   "negative" commits in the revs->commits list was Ok if all we
   cared about "boundary" was the UNINTERESTING limiting case,
   but conceptually it was wrong.

 - makes get_revision_1() function to walk the commits and return
   the results as if there is no funny postprocessing flags such
   as --reverse, --skip nor --max-count.

 - makes get_revision() function the postprocessing phase:

   If reverse is given, wait for get_revision_1() to give
   everything that it would normally give, and then reverse it
   before consuming.

   If skip is given, skip that many before going further.

   If max is given, stop when we gave out that many.

   Now that we are about to return one positive commit, mark
   the parents of that commit to be potential boundaries
   before returning, iff we are doing the boundary processing.

   Return the commit.

 - After get_revision() finishes giving out all the positive
   commits, if we are doing the boundary processing, we look at
   the parents that we marked as potential boundaries earlier,
   see if they are really boundaries, and give them out.

It loses more code than it adds, even when the new gc_boundary()
function, which is purely for early optimization, is counted.

Note that this patch is purely for eyeballing and discussion
only.  It breaks git-bundle's verify logic because the logic
does not use BOUNDARY_SHOW flag for its internal computation
anymore.  After we correct it not to attempt to affect the
boundary processing by setting the BOUNDARY_SHOW flag, we can
remove BOUNDARY_SHOW from revision.h and use that bit assignment
for the new CHILD_SHOWN flag.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMake 'make' quiet by default
Shawn O. Pearce [Tue, 6 Mar 2007 07:09:14 +0000 (02:09 -0500)]
Make 'make' quiet by default

Per Junio's suggestion we are setting 'make' to be quiet by default,
with `make V=1` available to force GNU make back to its default
behavior of showing each command it is running.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMake 'make' quieter while building git
Shawn O. Pearce [Tue, 6 Mar 2007 06:35:01 +0000 (01:35 -0500)]
Make 'make' quieter while building git

I find it difficult to see compiler warnings amongst the massive
spewing produced by GNU make as it works through our productions.
This is especially true if CFLAGS winds up being rather long, due
to a large number of -W options being enabled and due to a number
of -D options being configured/required by my platform.

By defining QUIET_MAKE (e.g. make QUIET_MAKE=YesPlease) during
compilation users will get a less verbose output, such as:

    ...
    CC builtin-grep.c
builtin-grep.c:187: warning: 'external_grep' defined but not used
    CC builtin-init-db.c
    CC builtin-log.c
    CC builtin-ls-files.c
    CC builtin-ls-tree.c
    ...

The verbose (normal make) output is still the default.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 6 Mar 2007 08:45:34 +0000 (00:45 -0800)]
Merge branch 'maint'

* maint:
  git-gui: Make 'make' quieter by default
  git-gui: Remove unnecessary /dev/null redirection.
  git-gui: Don't create empty (same tree as parent) commits.
  git-gui: Add Reset to the Branch menu.
  git-gui: Relocate the menu/transport menu code.

17 years agoMerge branch 'master' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Tue, 6 Mar 2007 08:39:52 +0000 (00:39 -0800)]
Merge branch 'master' of git://repo.or.cz/git-gui into maint

* 'master' of git://repo.or.cz/git-gui:
  git-gui: Make 'make' quieter by default
  git-gui: Remove unnecessary /dev/null redirection.
  git-gui: Don't create empty (same tree as parent) commits.
  git-gui: Add Reset to the Branch menu.
  git-gui: Relocate the menu/transport menu code.

17 years agogit-bundle: fix pack generation.
Junio C Hamano [Tue, 6 Mar 2007 06:48:00 +0000 (22:48 -0800)]
git-bundle: fix pack generation.

The handcrafted built-in rev-list lookalike forgot to mark the trees
and blobs contained in the boundary commits uninteresting, resulting
in unnecessary objects in the pack.

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agogit-gui: Make 'make' quieter by default gitgui-0.6.3
Shawn O. Pearce [Tue, 6 Mar 2007 07:13:23 +0000 (02:13 -0500)]
git-gui: Make 'make' quieter by default

To fit nicely into the output of the git.git project's own quieter
Makefile, we want to make the git-gui Makefile nice and quiet too.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 6 Mar 2007 07:11:54 +0000 (23:11 -0800)]
Merge branch 'maint'

* maint:
  git-commit: cd to top before showing the final stat

17 years agogit-commit: cd to top before showing the final stat
Junio C Hamano [Mon, 5 Mar 2007 20:35:41 +0000 (12:35 -0800)]
git-commit: cd to top before showing the final stat

Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agocherry-pick: Bug fix 'cherry picked from' message.
Shawn O. Pearce [Tue, 6 Mar 2007 05:46:00 +0000 (00:46 -0500)]
cherry-pick: Bug fix 'cherry picked from' message.

Somewhere along the line (in abd6970a) git-revert.sh learned to
omit the private object name from the new commit message *unless*
-x was supplied on the command line by the user.

The way this was implemented is really non-obvious in the original
script.  Setting replay=t (the default) means we don't include the
the private object name, while setting reply='' (the -x flag) means
we should include the private object name.  These two settings now
relate to the replay=1 and replay=0 cases in the C version, so we
need to negate replay to test it is 0.

I also noticed the C version was adding an extra LF in the -x case,
where the older git-revert.sh was not.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'master-for-junio' of git://repo.or.cz/git/fastimport; branch 'maint'
Junio C Hamano [Tue, 6 Mar 2007 05:23:46 +0000 (21:23 -0800)]
Merge branch 'master-for-junio' of git://repo.or.cz/git/fastimport; branch 'maint'

* 'master-for-junio' of git://repo.or.cz/git/fastimport:
  fast-import: Fail if a non-existant commit is used for merge
  fast-import: Avoid infinite loop after reset

* maint:
  Fix diff-options references in git-diff and git-format-patch
  Add definition of <commit-ish> to the main git man page.
  Begin SubmittingPatches with a check list
  fast-import: Fail if a non-existant commit is used for merge
  fast-import: Avoid infinite loop after reset

17 years agoFix diff-options references in git-diff and git-format-patch
Brian Gernhardt [Tue, 6 Mar 2007 03:27:44 +0000 (22:27 -0500)]
Fix diff-options references in git-diff and git-format-patch

Most of the git-diff-* documentation used [<common diff options>]
instead of [--diff-options], so make that change in git-diff and
git-format-patch.

In addition, git-format-patch didn't include the meanings of the diff
options.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoAdd definition of <commit-ish> to the main git man page.
Theodore Ts'o [Mon, 5 Mar 2007 19:46:05 +0000 (14:46 -0500)]
Add definition of <commit-ish> to the main git man page.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint-for-junio' of git://repo.or.cz/git/fastimport into maint
Junio C Hamano [Tue, 6 Mar 2007 01:07:17 +0000 (17:07 -0800)]
Merge branch 'maint-for-junio' of git://repo.or.cz/git/fastimport into maint

* 'maint-for-junio' of git://repo.or.cz/git/fastimport:
  fast-import: Fail if a non-existant commit is used for merge
  fast-import: Avoid infinite loop after reset

17 years agoBegin SubmittingPatches with a check list
Johannes Schindelin [Mon, 5 Mar 2007 15:37:54 +0000 (16:37 +0100)]
Begin SubmittingPatches with a check list

It seems that some people prefer a short list to a long text. But even for
the latter group, a quick reminder list is useful. So, add a check list to
Documentation/SubmittingPatches of what to do to get your patch accepted.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
17 years agoMerge branch 'maint'
Shawn O. Pearce [Mon, 5 Mar 2007 17:49:02 +0000 (12:49 -0500)]
Merge branch 'maint'

* maint:
  fast-import: Fail if a non-existant commit is used for merge
  fast-import: Avoid infinite loop after reset

[sp: Minor evil merge to deal with type_names array moving
 to be private in 'master'.]

17 years agofast-import: Fail if a non-existant commit is used for merge
Shawn O. Pearce [Mon, 5 Mar 2007 17:43:14 +0000 (12:43 -0500)]
fast-import: Fail if a non-existant commit is used for merge

Johannes Sixt noticed during one of his own imports that fast-import
did not fail if a non-existant commit is referenced by SHA-1 value
as an argument to the 'merge' command.  This allowed the user to
unknowingly create commits that would fail in fsck, as the commit
contents would not be completely reachable.

A side effect of this bug was that a frontend process could mark
any SHA-1 object (blob, tree, tag) as a parent of a merge commit.
This should also fail in fsck, as the commit is not a valid commit.

We now use the same rule as the 'from' command.  If a commit is
referenced in the 'merge' command by hex formatted SHA-1 then the
SHA-1 must be a commit or a tag that can be peeled back to a commit,
the commit must already exist, and must be readable by the core Git
infrastructure code.  This requirement means that the commit must
have existed prior to fast-import starting, or the commit must have
been flushed out by a prior 'checkpoint' command.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agofast-import: Avoid infinite loop after reset
Shawn O. Pearce [Mon, 5 Mar 2007 17:31:09 +0000 (12:31 -0500)]
fast-import: Avoid infinite loop after reset

Johannes Sixt noticed that a 'reset' command applied to a branch that
is already active in the branch LRU cache can cause fast-import to
relink the same branch into the LRU cache twice.  This will cause
the LRU cache to contain a cycle, making unload_one_branch run in an
infinite loop as it tries to select the oldest branch for eviction.

I have trivially fixed the problem by adding an active bit to
each branch object; this bit indicates if the branch is already
in the LRU and allows us to avoid trying to add it a second time.
Converting the pack_id field into a bitfield makes this change take
up no additional memory.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>