Code

git.git
15 years agogit-submodule: Avoid printing a spurious message.
Alexandre Julliard [Tue, 11 Nov 2008 21:09:16 +0000 (22:09 +0100)]
git-submodule: Avoid printing a spurious message.

Fix 'git submodule update' to avoid printing a spurious "Maybe you want
to use 'update --init'?" once for every uninitialized submodule it
encounters.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit ls-remote: make usage string match manpage
Stefan Naewe [Tue, 11 Nov 2008 15:52:31 +0000 (16:52 +0100)]
git ls-remote: make usage string match manpage

The usage string of 'git ls-remote' is pretty terse. The manpage
however gives the correct 'synopsis'.

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: help people who run 'make check' by mistake
Junio C Hamano [Tue, 11 Nov 2008 21:12:17 +0000 (13:12 -0800)]
Makefile: help people who run 'make check' by mistake

The target to run self test is 'make test', but there are people who try
'make check' and worse yet do not have sparse installed.

Suggest 'make test' target when they do not have 'sparse'.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocument "git log --source"
Nanako Shiraishi [Mon, 10 Nov 2008 09:58:15 +0000 (18:58 +0900)]
Document "git log --source"

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-gui: Request blame metadata in utf-8.
Alexander Gavrilov [Sun, 9 Nov 2008 15:53:09 +0000 (18:53 +0300)]
git-gui: Request blame metadata in utf-8.

The blame builtin now supports automatic conversion of
metadata encoding. By default it is converted to the
character set specified by i18n.logoutputencoding.

Since gui blame expects the data in utf-8, it is
necessary to specify the desired encoding directly.
An old version of the blame command will simply
ignore the option.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Add the Show SSH Key item to the clone dialog.
Alexander Gavrilov [Sun, 9 Nov 2008 15:51:16 +0000 (18:51 +0300)]
git-gui: Add the Show SSH Key item to the clone dialog.

The user might need to see the key before cloning a repository.
This patch makes the relevant menu item available in the Select
Repository/Clone dialog.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Fix focus transition in the blame viewer.
Alexander Gavrilov [Sun, 9 Nov 2008 15:36:50 +0000 (18:36 +0300)]
git-gui: Fix focus transition in the blame viewer.

Now that the blame viewer has a search panel, it should be
taken into account by the focus transition code. Otherwise
showing a commit tip (by accidentally moving the mouse to
the text frame) causes the focus to transfer away from the
search field.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agot5303: fix printf format string for portability
Junio C Hamano [Sun, 9 Nov 2008 21:11:06 +0000 (13:11 -0800)]
t5303: fix printf format string for portability

printf "\x01" is bad; write printf "\001" for portability.

Testing with dash is a good way to find this kind of POSIX.1 violation
breakages.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5303: work around printf breakage in dash
Junio C Hamano [Sun, 9 Nov 2008 21:08:38 +0000 (13:08 -0800)]
t5303: work around printf breakage in dash

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd autoconf tests for pthreads
David M. Syzdek [Mon, 3 Nov 2008 18:14:28 +0000 (09:14 -0900)]
Add autoconf tests for pthreads

Set the value of PTHREAD_LIBS to the correct flags for linking pthreads on
the current environment.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 9 Nov 2008 18:56:26 +0000 (10:56 -0800)]
Merge branch 'maint'

* maint:
  Documentation: bisect: change a few instances of "git-cmd" to "git cmd"
  Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"
  checkout: Don't crash when switching away from an invalid branch.

15 years agobisect: fix missing "exit"
Christian Couder [Sun, 9 Nov 2008 14:25:55 +0000 (15:25 +0100)]
bisect: fix missing "exit"

Check to see given bad/good/skip sets are valid commit and to exit
otherwise was broken by 6a54d97 (bisect: remove "checkout_done" variable
used when checking merge bases, 2008-09-06).

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: bisect: change a few instances of "git-cmd" to "git cmd"
Christian Couder [Sun, 9 Nov 2008 13:53:14 +0000 (14:53 +0100)]
Documentation: bisect: change a few instances of "git-cmd" to "git cmd"

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: rev-list: change a few instances of "git-cmd" to "git cmd"
Christian Couder [Sun, 9 Nov 2008 13:46:35 +0000 (14:46 +0100)]
Documentation: rev-list: change a few instances of "git-cmd" to "git cmd"

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoreceive-pack: detect push to current branch of non-bare repo
Jeff King [Sun, 9 Nov 2008 01:49:27 +0000 (20:49 -0500)]
receive-pack: detect push to current branch of non-bare repo

Pushing into the currently checked out branch of a non-bare
repository can be dangerous; the HEAD then loses sync with
the index and working tree, and it looks in the receiving
repo as if the pushed changes have been reverted in the
index (since they were never there in the first place).

This patch adds a safety valve that checks for this
condition and either generates a warning or denies the
update. We trigger the check only on a non-bare repository,
since a bare repo does not have a working tree (and in fact,
pushing to the HEAD branch is a common workflow for
publishing repositories).

The behavior is configurable via receive.denyCurrentBranch,
defaulting to "warn" so as not to break existing setups
(though it may, after a deprecation period, switch to
"refuse" by default). For users who know what they are doing
and want to silence the warning (e.g., because they have a
post-receive hook that reconciles the HEAD and working
tree), they can turn off the warning by setting it to false
or "ignore".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot5516: refactor oddball tests
Jeff King [Fri, 7 Nov 2008 22:20:33 +0000 (17:20 -0500)]
t5516: refactor oddball tests

t5516 sets up some utility functions for starting each test
with a clean slate. However, there were a few tests added
that do not use these functions, but instead make their own
repositories.

Let's bring these in line with the rest of the tests. Not
only do we reduce the number of lines, but these tests will
benefit from any further enhancements to the utility
scripts.

The conversion is pretty straightforward. Most of the tests
created a parent/child clone relationship, for which we now
use 'testrepo' as the parent.  One test looked in testrepo,
but relied on previous tests to have set it up; it now sets
up testrepo explicitly, which makes it a bit more robust to
changes in the script, as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: Don't crash when switching away from an invalid branch.
Alexandre Julliard [Sat, 8 Nov 2008 12:03:59 +0000 (13:03 +0100)]
checkout: Don't crash when switching away from an invalid branch.

When using alternates, it is possible for HEAD to end up pointing to
an invalid commit. git checkout should be able to recover from that
situation without crashing.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'dev'
Paul Mackerras [Sun, 9 Nov 2008 11:05:50 +0000 (22:05 +1100)]
Merge branch 'dev'

15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 9 Nov 2008 05:33:55 +0000 (21:33 -0800)]
Merge branch 'maint'

* maint:
  GIT 1.6.0.4
  Update RPM spec for the new location of git-cvsserver.
  push: fix local refs update if already up-to-date
  do not force write of packed refs

Conflicts:
builtin-revert.c

15 years agoGIT 1.6.0.4 v1.6.0.4
Junio C Hamano [Sun, 9 Nov 2008 01:33:50 +0000 (17:33 -0800)]
GIT 1.6.0.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate RPM spec for the new location of git-cvsserver.
Quy Tonthat [Fri, 12 Sep 2008 16:22:44 +0000 (02:22 +1000)]
Update RPM spec for the new location of git-cvsserver.

git-cvsserver has been moved from libexecdir to bindir.

Signed-off-by: Quy Tonthat <qtonthat@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cb/maint-update-ref-fix' into maint
Junio C Hamano [Sun, 9 Nov 2008 01:32:49 +0000 (17:32 -0800)]
Merge branch 'cb/maint-update-ref-fix' into maint

* cb/maint-update-ref-fix:
  push: fix local refs update if already up-to-date
  do not force write of packed refs

15 years agoMerge branch 'cj/maint-gitpm-fix-maybe-self' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:50:25 +0000 (16:50 -0800)]
Merge branch 'cj/maint-gitpm-fix-maybe-self' into maint

* cj/maint-gitpm-fix-maybe-self:
  Git.pm: do not break inheritance

15 years agoMerge branch 'ar/maint-mksnpath' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:13:19 +0000 (16:13 -0800)]
Merge branch 'ar/maint-mksnpath' into maint

* ar/maint-mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
builtin-revert.c
rerere.c

15 years agoMerge branch 'mv/maint-branch-m-symref' into maint
Junio C Hamano [Sun, 9 Nov 2008 00:07:37 +0000 (16:07 -0800)]
Merge branch 'mv/maint-branch-m-symref' into maint

* mv/maint-branch-m-symref:
  update-ref --no-deref -d: handle the case when the pointed ref is packed
  git branch -m: forbid renaming of a symref
  Fix git update-ref --no-deref -d.
  rename_ref(): handle the case when the reflog of a ref does not exist
  Fix git branch -m for symrefs.

15 years agoMerge branch 'ds/autoconf'
Junio C Hamano [Sun, 9 Nov 2008 00:05:49 +0000 (16:05 -0800)]
Merge branch 'ds/autoconf'

* ds/autoconf:
  autoconf: Add link tests to each AC_CHECK_FUNC() test

15 years agoMerge branch 'rs/blame'
Junio C Hamano [Sun, 9 Nov 2008 00:05:39 +0000 (16:05 -0800)]
Merge branch 'rs/blame'

* rs/blame:
  blame: use xdi_diff_hunks(), get rid of struct patch
  add xdi_diff_hunks() for callers that only need hunk lengths
  Allow alternate "low-level" emit function from xdl_diff
  Always initialize xpparam_t to 0
  blame: inline get_patch()

15 years agot5400: expect success for denying deletion
Jeff King [Fri, 7 Nov 2008 22:09:55 +0000 (17:09 -0500)]
t5400: expect success for denying deletion

Commit a240de11 introduced this test and the code to make it
successful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoxdiff: give up scanning similar lines early
Davide Libenzi [Sat, 8 Nov 2008 05:24:33 +0000 (21:24 -0800)]
xdiff: give up scanning similar lines early

In a corner case of large files whose lines do not match uniquely, the
loop to eliminate a line that matches multiple locations adjacent to a run
of lines that do not uniquely match wasted too much cycles.  Fix this by
giving up early after scanning 100 lines in both direction.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitk: Implement a user-friendly Edit View dialog
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:48 +0000 (21:59 +0300)]
gitk: Implement a user-friendly Edit View dialog

Originally gitk required the user to specify all limiting
options manually in the same field with the list of commits.
It is rather unfriendly for new users, who may not know
which options can be used, or, indeed, that it is possible
to specify them at all.

This commit modifies the dialog to present the most useful
options as individual fields.  Note that options that may
be useful to an extent, but produce a severely broken view,
are deliberately not included.

It is still possible to specify options in the commit list
field, but when the dialog is reopened, they will be extracted
into their own separate fields.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Improve cherry-pick error handling
Paul Mackerras [Sat, 8 Nov 2008 10:37:09 +0000 (21:37 +1100)]
gitk: Improve cherry-pick error handling

This adds to the regexps that are used to work out what sort of error
we encountered in trying to do a cherry-pick so that it recognizes
some additional common error messages.  It adds a confirmation dialog
when the error is a merge conflict so the user can choose whether or
not to run git citool.  Finally, it arranges to update the display
after a cherry-pick failed so that any local changes made by the
cherry-pick become visible.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Make cherry-pick call git-citool on conflicts
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:47 +0000 (21:59 +0300)]
gitk: Make cherry-pick call git-citool on conflicts

Now that git-gui has facilities to help users resolve
conflicts, it makes sense to launch it from other GUI
tools when they happen.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Make gitk dialog windows transient
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:45 +0000 (21:59 +0300)]
gitk: Make gitk dialog windows transient

Transient windows are always kept above their parent, and don't occupy
any space in the taskbar, which is useful for dialogs.  Also, when
transient is used, it is important to bind windows to the correct
parent.

This commit adds transient annotations to all dialogs, ensures usage
of the correct parent for error and confirmation popups, and, as a
side job, makes gitk preserve the create tag dialog window in case of
errors.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Add Return and Escape bindings to dialogs
Alexander Gavrilov [Sun, 2 Nov 2008 18:59:44 +0000 (21:59 +0300)]
gitk: Add Return and Escape bindings to dialogs

It is often more convenient to dismiss or accept a dialog using the
keyboard, than by clicking buttons on the screen.  This commit adds
key binding to make it possible with gitk's dialogs.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitweb: Fix mod_perl support.
Alexander Gavrilov [Wed, 5 Nov 2008 22:10:07 +0000 (01:10 +0300)]
gitweb: Fix mod_perl support.

ModPerl::Registry precompiles scripts by wrapping them
in a subroutine. This causes ordinary subroutines of the
script to become nested, and warnings appear:

gitweb.cgi: Variable "$path_info" will not stay shared

This warning means that $path_info was declared as 'my',
and thus according to the perl evaluation rules all nested
subroutines will retain a reference to the instance of the
variable used in the first invocation of the master script.

When the script (i.e. the master meta-subroutine) is executed
the second time, it will use a new instance, so the logic
breaks. To avoid this it is necessary to declare all global
variables as 'our', which places them at the package level.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: Add a per-repository authorization hook.
Alexander Gavrilov [Wed, 5 Nov 2008 22:36:23 +0000 (01:36 +0300)]
gitweb: Add a per-repository authorization hook.

Add a configuration variable that can be used to specify an
arbitrary subroutine that will be called in the same situations
where $export_ok is checked, and its return value used
to decide whether the repository is to be shown.

This allows the user to implement custom authentication
schemes, for example by issuing a subrequest through mod_perl
and checking if Apache will authorize it.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: Use single implementation of export_ok check.
Alexander Gavrilov [Wed, 5 Nov 2008 22:15:56 +0000 (01:15 +0300)]
gitweb: Use single implementation of export_ok check.

GitWeb source contains a special function that implements the
export_ok check, but validate_project still uses a separate copy
of essentially the same code.

This patch makes it use the dedicated function, thus ensuring
that all checks are done through a single code path.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoWindows: Make OpenSSH properly detect tty detachment.
Alexander Gavrilov [Sun, 2 Nov 2008 17:11:13 +0000 (20:11 +0300)]
Windows: Make OpenSSH properly detect tty detachment.

Apparently, CREATE_NO_WINDOW makes the OS tell the process
that it has a console, but without actually creating the
window. As a result, when git is started from GUI, ssh
tries to ask its questions on the invisible console.

This patch uses DETACHED_PROCESS instead, which clearly
means that the process should be left without a console.
The downside is that if the process manually calls
AllocConsole, the window will appear. A similar thing
might occur if it calls another console executable.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: proper detection of bare repositories
Deskin Miller [Thu, 6 Nov 2008 05:07:39 +0000 (00:07 -0500)]
git-svn: proper detection of bare repositories

When in a bare repository (or .git, for that matter), git-svn would fail
to initialise properly, since git rev-parse --show-cdup would not output
anything.  However, git rev-parse --show-cdup actually returns an error
code if it's really not in a git directory.

Fix the issue by checking for an explicit error from git rev-parse, and
setting $git_dir appropriately if instead it just does not output.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: respect i18n.commitencoding config
Eric Wong [Thu, 30 Oct 2008 06:49:26 +0000 (23:49 -0700)]
git-svn: respect i18n.commitencoding config

SVN itself always stores log messages in the repository as
UTF-8.  git always stores/retrieves everything as raw binary
data with no transformations whatsoever.

To interact with SVN, we need to encode log messages as UTF-8
before sending them to SVN, as SVN cannot do it for us.  When
retrieving log messages from SVN, we also need to (attempt to)
reencode the UTF-8 log message back to the user-specified commit
encoding.

Note, handling i18n.logoutputencoding for "git svn log" also
needs to be done in a future change.

Also, this change only deals with the encoding of commit
messages and nothing else (path names, blob content, ...).

In-Reply-To: <8b168cfb0810282014r789ac01dnec51824de1078f0@mail.gmail.com>
James North <tocapicha@gmail.com> wrote:
> Hi,
>
> I'm using git-svn on a system with ISO-8859-1 encoding. The problem is
> when I try to use "git svn dcommit" to send changes to a remote svn
> (also ISO-8859-1).
>
> Seems like git-svn is sending commit messages with utf-8 (just a
> guessing...) and they look bad on the remote svn log. E.g. "Ca?\241a
> de cami?\243n"
>
> I have tried using i18n.commitencoding=ISO-8859-1 as suggested by the
> warning when doing "git svn dcommit" but messages still are sent with
> wrong encoding.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: don't escape tilde ('~') for http(s) URLs
Eric Wong [Tue, 21 Oct 2008 21:12:15 +0000 (14:12 -0700)]
git-svn: don't escape tilde ('~') for http(s) URLs

Thanks to Jose Carlos Garcia Sogo and Björn Steinbrink for the
bug report.

On 2008.10.18 23:39:19 +0200, Björn Steinbrink wrote:
> Hi,
>
> Jose Carlos Garcia Sogo reported on #git that a git-svn clone of this
> svn repo fails for him:
> https://sucs.org/~welshbyte/svn/backuptool/trunk
>
> I can reproduce that here with:
> git-svn version 1.6.0.2.541.g46dc1.dirty (svn 1.5.1)
>
> The error message I get is:
> Apache got a malformed URI: Unusable URI: it does not refer to this
> repository at /usr/local/libexec/git-core/git-svn line 4057
>
> strace revealed that git-svn url-encodes ~ while svn does not do that.
>
> For svn we have:
> write(5, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/~welshbyte/svn/backuptool/trunk</S:src-path>...
>
> While git-svn shows:
> write(7, "<S:update-report send-all=\"true\" xmlns:S=\"svn:\">
> <S:src-path>https://sucs.org/%7Ewelshbyte/svn/backuptool/trunk</S:src-path>...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agopush: fix local refs update if already up-to-date
Clemens Buchacher [Wed, 5 Nov 2008 20:55:54 +0000 (21:55 +0100)]
push: fix local refs update if already up-to-date

git push normally updates local refs only after a successful push. If the
remote already has the updates -- pushed indirectly through another repository,
for example -- we forget to update local tracking refs.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodo not force write of packed refs
Clemens Buchacher [Wed, 5 Nov 2008 20:55:53 +0000 (21:55 +0100)]
do not force write of packed refs

We force writing a ref if it does not exist. Originally, we only had to look
for the ref file to check if it existed. Now we have to look for a packed ref
as well. Luckily, resolve_ref already does all the work for us.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImplement git remote rename
Miklos Vajna [Mon, 3 Nov 2008 18:26:18 +0000 (19:26 +0100)]
Implement git remote rename

The new rename subcommand does the followings:

1) Renames the remote.foo configuration section to remote.bar

2) Updates the remote.bar.fetch refspecs

3) Updates the branch.*.remote settings

4) Renames the tracking branches: renames the normal refs and rewrites
   the symrefs to point to the new refs.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Wed, 5 Nov 2008 20:20:55 +0000 (12:20 -0800)]
Update draft release notes to 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ar/mksnpath'
Junio C Hamano [Wed, 5 Nov 2008 19:35:53 +0000 (11:35 -0800)]
Merge branch 'ar/mksnpath'

* ar/mksnpath:
  Use git_pathdup instead of xstrdup(git_path(...))
  git_pathdup: returns xstrdup-ed copy of the formatted path
  Fix potentially dangerous use of git_path in ref.c
  Add git_snpath: a .git path formatting routine with output buffer
  Fix potentially dangerous uses of mkpath and git_path
  Fix potentially dangerous uses of mkpath and git_path
  Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
  Add mksnpath which allows you to specify the output buffer

Conflicts:
builtin-revert.c

15 years agoMerge branch 'jc/gitweb-fix-cloud-tag'
Junio C Hamano [Wed, 5 Nov 2008 19:34:28 +0000 (11:34 -0800)]
Merge branch 'jc/gitweb-fix-cloud-tag'

* jc/gitweb-fix-cloud-tag:
  Fix reading of cloud tags

15 years agoMerge branch 'mv/maint-branch-m-symref'
Junio C Hamano [Wed, 5 Nov 2008 19:33:19 +0000 (11:33 -0800)]
Merge branch 'mv/maint-branch-m-symref'

* mv/maint-branch-m-symref:
  update-ref --no-deref -d: handle the case when the pointed ref is packed
  git branch -m: forbid renaming of a symref
  Fix git update-ref --no-deref -d.
  rename_ref(): handle the case when the reflog of a ref does not exist
  Fix git branch -m for symrefs.

15 years agoMerge branch 'mv/parseopt-checkout-index'
Junio C Hamano [Wed, 5 Nov 2008 19:25:58 +0000 (11:25 -0800)]
Merge branch 'mv/parseopt-checkout-index'

* mv/parseopt-checkout-index:
  parse-opt: migrate builtin-checkout-index.

15 years agotag: Add more tests about mixing incompatible modes and options
Samuel Tardieu [Tue, 4 Nov 2008 23:20:36 +0000 (00:20 +0100)]
tag: Add more tests about mixing incompatible modes and options

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotag: Check that options are only allowed in the appropriate mode
Samuel Tardieu [Tue, 4 Nov 2008 23:20:31 +0000 (00:20 +0100)]
tag: Check that options are only allowed in the appropriate mode

If "git tag -d -l -v ..." is called, only "-l" is honored, which is
arbitrary and wrong. Also, unrecognized options are accepted in the
wrong modes, causing for example "git tag -n 100" to create a tag
named "100" while the user may have wanted to type "git tag -n100".

This patch checks that "git tag" knows in what mode it operates before
performing any operation and accepts only the related options.

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 4 Nov 2008 23:11:26 +0000 (15:11 -0800)]
Merge branch 'maint'

* maint:
  format-patch documentation: mention the special case of showing a single commit

15 years agocontrib/hooks/post-receive-email: Make revision display configurable
Pete Harlan [Tue, 4 Nov 2008 07:19:54 +0000 (23:19 -0800)]
contrib/hooks/post-receive-email: Make revision display configurable

Add configuration option hooks.showrev, letting the user override how
revisions will be shown in the commit email.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocontrib/hooks/post-receive-email: Put rev display in separate function
Pete Harlan [Tue, 4 Nov 2008 07:19:53 +0000 (23:19 -0800)]
contrib/hooks/post-receive-email: Put rev display in separate function

The display of a revision in an email-appropriate format is done in
two places with similar code.  In preparation for making that display
more complex, move it into a separate function that handles both cases.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitk: Cope with unmerged files in local changes
Paul Mackerras [Tue, 4 Nov 2008 10:09:00 +0000 (21:09 +1100)]
gitk: Cope with unmerged files in local changes

This modifies gettreediffline so that it when we get both a "U" line
and an "M" line for the same file in the output from git diff-files
or git diff-index --cached (used when the user clicks on a fake commit)
we don't add the same filename to the treediff list twice.

This also makes getblobdiffline recognize the "* Unmerged path ..."
lines we get when we ask for the actual diffs, and makes a tiny
optimization in makediffhdr.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agorevision traversal: '--simplify-by-decoration'
Linus Torvalds [Mon, 3 Nov 2008 19:25:46 +0000 (11:25 -0800)]
revision traversal: '--simplify-by-decoration'

With this, you can simplify history not by the contents of the tree, but
whether a commit has been named (ie it's referred to by some branch or
tag) or not.

This makes it possible to see the relationship between different named
commits, without actually seeing any of the details.

When used with pathspec, you would get the usual view that is limited to
the commits that change the contents of the tree plus commits that are
named.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake '--decorate' set an explicit 'show_decorations' flag
Linus Torvalds [Mon, 3 Nov 2008 19:23:57 +0000 (11:23 -0800)]
Make '--decorate' set an explicit 'show_decorations' flag

We will want to add decorations without necessarily showing them, so add
an explicit revisions info flag as to whether we're showing decorations
or not.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorevision: make tree comparison functions take commits rather than trees
Linus Torvalds [Mon, 3 Nov 2008 18:45:41 +0000 (10:45 -0800)]
revision: make tree comparison functions take commits rather than trees

This will make it easier to do various clever things that don't depend
on the pure tree contents.  It also makes the parameter passing much
simpler - the callers doesn't really look at trees anywhere else, and
it's really the function that should look at the low-level details.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd a 'source' decorator for commits
Linus Torvalds [Mon, 27 Oct 2008 19:51:59 +0000 (12:51 -0700)]
Add a 'source' decorator for commits

We already support decorating commits by tags or branches that point to
them, but especially when we are looking at multiple branches together,
we sometimes want to see _how_ we reached a particular commit.

We can abuse the '->util' field in the commit to keep track of that as
we walk the commit lists, and get a reasonably useful view into which
branch or tag first reaches that commit.

Of course, if the commit is reachable through multiple sources (which is
common), our particular choice of "first" reachable is entirely random
and depends on the particular path we happened to follow.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitk: Make "show origin of this line" work on fake commits
Paul Mackerras [Tue, 4 Nov 2008 01:57:44 +0000 (12:57 +1100)]
gitk: Make "show origin of this line" work on fake commits

This makes the "Show origin of this line" menu item work correctly
on the fake commits that gitk shows for local uncommitted changes.
With the fake commit for changes that aren't checked in to the index,
we can actually get a 3-way diff shown, which means we might have to
blame either the parent or the commit being merged in (which we get
from .git/MERGE_HEAD).

If the parent is the fake commit which shows the changes that have
been checked in to the index, then we need to get the SHA1 of the blob
for the version of the file that is in the index, then use git cat-file
blob to get the contents of the blob, and give that to git blame with --contents - so that git blame will do the blame on the index version
of the file.  In that case, we might get the all-zeroes SHA1 back from
git blame, meaning that the line is new in the index version of the
file, so then we have to use $nullid2 (the pseudo-SHA1 of the fake
commit for the checked-in changes).

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agoMakefile: add install-man rules (quick and normal)
Markus Heidelberg [Sun, 2 Nov 2008 17:53:03 +0000 (18:53 +0100)]
Makefile: add install-man rules (quick and normal)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoformat-patch documentation: mention the special case of showing a single commit
Junio C Hamano [Mon, 3 Nov 2008 04:45:55 +0000 (20:45 -0800)]
format-patch documentation: mention the special case of showing a single commit

Even long timers seem to have missed that "format-patch -1 $commit" is a
much simpler and more obvious way to say "format-patch $commit^..$commit"
from the current documentation (and an example "format-patch -3 $commit"
to get three patches).  Add an explicit instruction in a much earlier part
of the documentation to make it easier to find.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: embed snapshot format parameter in PATH_INFO
Giuseppe Bilotta [Sun, 2 Nov 2008 09:21:39 +0000 (10:21 +0100)]
gitweb: embed snapshot format parameter in PATH_INFO

When PATH_INFO is active, get rid of the sf CGI parameter by embedding
the snapshot format information in the PATH_INFO URL, in the form of an
appropriate extension.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: retrieve snapshot format from PATH_INFO
Giuseppe Bilotta [Sun, 2 Nov 2008 09:21:38 +0000 (10:21 +0100)]
gitweb: retrieve snapshot format from PATH_INFO

We parse requests for $project/snapshot/$head.$sfx as equivalent to
$project/snapshot/$head?sf=$sfx, where $sfx is any of the known
(although not necessarily supported) snapshot formats (or its default
suffix).

The filename for the resulting package preserves the requested
extensions (so asking for a .tgz gives a .tgz, and asking for a .tar.gz
gives a .tar.gz), although for obvious reasons it doesn't preserve the
basename (git/snapshot/next.tgz returns a file names git-next.tgz).

This introduces a potential case for ambiguity if a project has a head
that ends with a snapshot-like suffix (.zip, .tgz, .tar.gz, etc) and the
sf CGI parameter is not present; however, gitweb only produces URLs with
the sf parameter currently, so this is only a potential issue for
hand-coded URLs for extremely unusual project.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake Pthread link flags configurable
David M. Syzdek [Sun, 2 Nov 2008 23:43:20 +0000 (14:43 -0900)]
Make Pthread link flags configurable

FreeBSD 4.x systems use the linker flags `-pthread' instead of the
linker flags `-lpthread' when linking against the pthread library.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Sun, 2 Nov 2008 23:21:02 +0000 (15:21 -0800)]
Update draft release notes to 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 3 Nov 2008 00:36:40 +0000 (16:36 -0800)]
Merge branch 'maint'

* maint:
  Add reference for status letters in documentation.
  Document that git-log takes --all-match.
  Update draft 1.6.0.4 release notes

15 years agoMerge branch 'np/index-pack'
Junio C Hamano [Mon, 3 Nov 2008 00:36:37 +0000 (16:36 -0800)]
Merge branch 'np/index-pack'

* np/index-pack:
  index-pack: don't leak leaf delta result
  improve index-pack tests
  fix multiple issues in index-pack
  index-pack: smarter memory usage during delta resolution
  index-pack: rationalize delta resolution code

15 years agoMerge branch 'sh/rebase-i-p'
Junio C Hamano [Mon, 3 Nov 2008 00:36:33 +0000 (16:36 -0800)]
Merge branch 'sh/rebase-i-p'

* sh/rebase-i-p:
  git-rebase--interactive.sh: comparision with == is bashism
  rebase-i-p: minimum fix to obvious issues
  rebase-i-p: if todo was reordered use HEAD as the rewritten parent
  rebase-i-p: do not include non-first-parent commits touching UPSTREAM
  rebase-i-p: only list commits that require rewriting in todo
  rebase-i-p: fix 'no squashing merges' tripping up non-merges
  rebase-i-p: delay saving current-commit to REWRITTEN if squashing
  rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEAD
  rebase-i-p: test to exclude commits from todo based on its parents

15 years agoMerge branch 'ag/blame-encoding'
Junio C Hamano [Mon, 3 Nov 2008 00:36:30 +0000 (16:36 -0800)]
Merge branch 'ag/blame-encoding'

* ag/blame-encoding:
  builtin-blame: Reencode commit messages according to git-log rules.

15 years agoMerge branch 'gb/gitweb-pathinfo'
Junio C Hamano [Mon, 3 Nov 2008 00:36:25 +0000 (16:36 -0800)]
Merge branch 'gb/gitweb-pathinfo'

* gb/gitweb-pathinfo:
  gitweb: generate parent..current URLs
  gitweb: parse parent..current syntax from PATH_INFO
  gitweb: use_pathinfo filenames start with /
  gitweb: generate project/action/hash URLs
  gitweb: parse project/action/hash_base:filename PATH_INFO

15 years agoMerge branch 'cj/maint-gitpm-fix-maybe-self'
Junio C Hamano [Mon, 3 Nov 2008 00:36:21 +0000 (16:36 -0800)]
Merge branch 'cj/maint-gitpm-fix-maybe-self'

* cj/maint-gitpm-fix-maybe-self:
  Git.pm: do not break inheritance

15 years agoAdd reference for status letters in documentation.
Yann Dirson [Sun, 2 Nov 2008 13:37:28 +0000 (14:37 +0100)]
Add reference for status letters in documentation.

Also fix error in diff_filepair::status documentation, and point to
the in-code reference as well as the doc.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocument that git-log takes --all-match.
Mikael Magnusson [Sun, 2 Nov 2008 18:32:46 +0000 (19:32 +0100)]
Document that git-log takes --all-match.

Signed-off-by: Mikael Magnusson <mikachu@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoautoconf: Add link tests to each AC_CHECK_FUNC() test
David M. Syzdek [Sun, 26 Oct 2008 11:52:19 +0000 (03:52 -0800)]
autoconf: Add link tests to each AC_CHECK_FUNC() test

Update configure.ac to test libraries for getaddrinfo, strcasestr, memmem,
strlcpy, strtoumax, setenv, unsetenv, and mkdtemp.  The default compilers
on FreeBSD 4.9-SECURITY and FreeBSD 6.2-RELEASE-p4 do not generate warnings
for missing prototypes unless `-Wall' is used. This behavior renders the
results of AC_CHECK_FUNC() void on these platforms. The test AC_SEARCH_LIBS()
verifies a function is valid by linking to symbol within the system libraries.

Since this pattern needs to be repeated for many functions that are
checked with AC_CHECK_FUNC(), we add GIT_CHECK_FUNC() to drive the two
autoconf macros together.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: make the supported snapshot formats array global
Giuseppe Bilotta [Sun, 2 Nov 2008 09:21:37 +0000 (10:21 +0100)]
gitweb: make the supported snapshot formats array global

The array of supported snapshot format is used and defined (with two
different names) in two routines, one of which (format_snapshot_links)
is often called multiple times per page.

Simplify code and speed up page generation by making the array global.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopack-objects: don't leak pack window reference when splitting packs
Nicolas Pitre [Wed, 29 Oct 2008 23:02:52 +0000 (19:02 -0400)]
pack-objects: don't leak pack window reference when splitting packs

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoextend test coverage for latest pack corruption resilience improvements
Nicolas Pitre [Wed, 29 Oct 2008 23:02:51 +0000 (19:02 -0400)]
extend test coverage for latest pack corruption resilience improvements

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopack-objects: allow "fixing" a corrupted pack without a full repack
Nicolas Pitre [Wed, 29 Oct 2008 23:02:50 +0000 (19:02 -0400)]
pack-objects: allow "fixing" a corrupted pack without a full repack

When the pack data to be reused is found to be bad, let's fall back to
full object access through the generic path which has its own strategies
to find alternate object sources in that case.  This allows for "fixing"
a corrupted pack simply by copying either another pack containing the
object(s) found to be bad, or the loose object itself, into the object
store and launch a repack without the need for -f.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake find_pack_revindex() aware of the nasty world
Nicolas Pitre [Wed, 29 Oct 2008 23:02:49 +0000 (19:02 -0400)]
make find_pack_revindex() aware of the nasty world

It currently calls die() whenever given offset is not found thinking
that such thing should never happen.  But this offset may come from a
corrupted pack whych _could_ happen and not be found.  Callers should
deal with this possibility gracefully instead.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake check_object() resilient to pack corruptions
Nicolas Pitre [Wed, 29 Oct 2008 23:02:48 +0000 (19:02 -0400)]
make check_object() resilient to pack corruptions

The check_object() function tries to get away with the least amount of
pack access possible when it already has partial information on given
object rather than calling the more costly packed_object_info().

When things don't look right, it should just give up and fall back to
packed_object_info() directly instead of die()'ing.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake packed_object_info() resilient to pack corruptions
Nicolas Pitre [Wed, 29 Oct 2008 23:02:47 +0000 (19:02 -0400)]
make packed_object_info() resilient to pack corruptions

In the same spirit as commit 8eca0b47ff, let's try to survive a pack
corruption by making packed_object_info() able to fall back to alternate
packs or loose objects.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomake unpack_object_header() non fatal
Nicolas Pitre [Wed, 29 Oct 2008 23:02:46 +0000 (19:02 -0400)]
make unpack_object_header() non fatal

It is possible to have pack corruption in the object header.  Currently
unpack_object_header() simply die() on them instead of letting the caller
deal with that gracefully.

So let's have unpack_object_header() return an error instead, and find
a better name for unpack_object_header_gently() in that context.  All
callers of unpack_object_header() are ready for it.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobetter validation on delta base object offsets
Nicolas Pitre [Wed, 29 Oct 2008 23:02:45 +0000 (19:02 -0400)]
better validation on delta base object offsets

In one case, it was possible to have a bad offset equal to 0 effectively
pointing a delta onto itself and crashing git after too many recursions.
In the other cases, a negative offset could result due to off_t being
signed.  Catch those.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclose another possibility for propagating pack corruption
Nicolas Pitre [Fri, 31 Oct 2008 15:31:08 +0000 (11:31 -0400)]
close another possibility for propagating pack corruption

Abstract
--------

With index v2 we have a per object CRC to allow quick and safe reuse of
pack data when repacking.  This, however, doesn't currently prevent a
stealth corruption from being propagated into a new pack when _not_
reusing pack data as demonstrated by the modification to t5302 included
here.

The Context
-----------

The Git database is all checksummed with SHA1 hashes.  Any kind of
corruption can be confirmed by verifying this per object hash against
corresponding data.  However this can be costly to perform systematically
and therefore this check is often not performed at run time when
accessing the object database.

First, the loose object format is entirely compressed with zlib which
already provide a CRC verification of its own when inflating data.  Any
disk corruption would be caught already in this case.

Then, packed objects are also compressed with zlib but only for their
actual payload.  The object headers and delta base references are not
deflated for obvious performance reasons, however this leave them
vulnerable to potentially undetected disk corruptions.  Object types
are often validated against the expected type when they're requested,
and deflated size must always match the size recorded in the object header,
so those cases are pretty much covered as well.

Where corruptions could go unnoticed is in the delta base reference.
Of course, in the OBJ_REF_DELTA case,  the odds for a SHA1 reference to
get corrupted so it actually matches the SHA1 of another object with the
same size (the delta header stores the expected size of the base object
to apply against) are virtually zero.  In the OBJ_OFS_DELTA case, the
reference is a pack offset which would have to match the start boundary
of a different base object but still with the same size, and although this
is relatively much more "probable" than in the OBJ_REF_DELTA case, the
probability is also about zero in absolute terms.  Still, the possibility
exists as demonstrated in t5302 and is certainly greater than a SHA1
collision, especially in the OBJ_OFS_DELTA case which is now the default
when repacking.

Again, repacking by reusing existing pack data is OK since the per object
CRC provided by index v2 guards against any such corruptions. What t5302
failed to test is a full repack in such case.

The Solution
------------

As unlikely as this kind of stealth corruption can be in practice, it
certainly isn't acceptable to propagate it into a freshly created pack.
But, because this is so unlikely, we don't want to pay the run time cost
associated with extra validation checks all the time either.  Furthermore,
consequences of such corruption in anything but repacking should be rather
visible, and even if it could be quite unpleasant, it still has far less
severe consequences than actively creating bad packs.

So the best compromize is to check packed object CRC when unpacking
objects, and only during the compression/writing phase of a repack, and
only when not streaming the result.  The cost of this is minimal (less
than 1% CPU time), and visible only with a full repack.

Someone with a stats background could provide an objective evaluation of
this, but I suspect that it's bad RAM that has more potential for data
corruptions at this point, even in those cases where this extra check
is not performed.  Still, it is best to prevent a known hole for
corruption when recreating object data into a new pack.

What about the streamed pack case?  Well, any client receiving a pack
must always consider that pack as untrusty and perform full validation
anyway, hence no such stealth corruption could be propagated to remote
repositoryes already.  It is therefore worthless doing local validation
in that case.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft 1.6.0.4 release notes
Junio C Hamano [Sun, 2 Nov 2008 22:35:41 +0000 (14:35 -0800)]
Update draft 1.6.0.4 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/maint-fetch-update-head' into maint
Junio C Hamano [Sun, 2 Nov 2008 21:37:16 +0000 (13:37 -0800)]
Merge branch 'js/maint-fetch-update-head' into maint

* js/maint-fetch-update-head:
  pull: allow "git pull origin $something:$current_branch" into an unborn branch
  Fix fetch/pull when run without --update-head-ok

15 years agoMerge branch 'jk/maint-ls-files-other' into maint
Junio C Hamano [Sun, 2 Nov 2008 21:37:13 +0000 (13:37 -0800)]
Merge branch 'jk/maint-ls-files-other' into maint

* jk/maint-ls-files-other:
  refactor handling of "other" files in ls-files and status

15 years agoMerge branch 'jc/maint-reset-remove-unmerged-new' into maint
Junio C Hamano [Sun, 2 Nov 2008 21:36:20 +0000 (13:36 -0800)]
Merge branch 'jc/maint-reset-remove-unmerged-new' into maint

* jc/maint-reset-remove-unmerged-new:
  reset --hard/read-tree --reset -u: remove unmerged new paths

15 years agoMerge branch 'jc/maint-co-track' into maint
Junio C Hamano [Sun, 2 Nov 2008 21:36:14 +0000 (13:36 -0800)]
Merge branch 'jc/maint-co-track' into maint

* jc/maint-co-track:
  Enhance hold_lock_file_for_{update,append}() API
  demonstrate breakage of detached checkout with symbolic link HEAD
  Fix "checkout --track -b newbranch" on detached HEAD

15 years agogitk: Unify handling of merge diffs with normal 2-way diffs
Paul Mackerras [Sun, 2 Nov 2008 11:34:47 +0000 (22:34 +1100)]
gitk: Unify handling of merge diffs with normal 2-way diffs

This adds code to getblobdiffline to make it able to recognize and
display merge diffs (i.e. N-way diffs for N >= 3) as well as normal
two-way diffs.  This means that it can also correctly display the
3-way diff of the local changes when the git repository is in the
middle of a merge with conflicts.

This also removes getmergediffline and changes mergediff to invoke
getblobdiffline rather than getmergediffline.

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agoUpdate draft release notes to 1.6.1
Junio C Hamano [Sun, 2 Nov 2008 07:36:07 +0000 (00:36 -0700)]
Update draft release notes to 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoStop using compat/regex.c on platforms with working regexp library
Junio C Hamano [Fri, 24 Oct 2008 02:44:27 +0000 (19:44 -0700)]
Stop using compat/regex.c on platforms with working regexp library

We used to have non-POSIX comformant BRE in our code, and linked with GNU
regexp library on a few platforms (Darwin, FreeBSD and AIX) to work it
around.  This was backwards.

We've fixed the broken regexps to use ERE that native regexp libraries on
these platforms can handle just fine.  There is no need to link with GNU
regexp library on these platforms anymore.

Tested-on-AIX-by: Mike Ralphson <mike@abacus.co.uk>
Tested-on-FreeBSD-by: Jeff King <peff@peff.net>
Tested-on-Darwin-by: Arjen Laarhoven <arjen@yaph.org>
Tested-on-Darwin-by: Pieter de Bie <pieter@frim.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconnect.c: add a way for git-daemon to pass an error back to client
Tom Preston-Werner [Sat, 1 Nov 2008 18:44:45 +0000 (11:44 -0700)]
connect.c: add a way for git-daemon to pass an error back to client

The current behavior of git-daemon is to simply close the connection on
any error condition. This leaves the client without any information as
to the cause of the failed fetch/push/etc.

This patch allows get_remote_heads to accept a line prefixed with "ERR"
that it can display to the user in an informative fashion. Once clients
can understand this ERR line, git-daemon can be made to properly report
"repository not found", "permission denied", or other errors.

Example

S: ERR No matching repository.
C: fatal: remote error: No matching repository.

Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoIntroduce receive.denyDeletes
Jan Krüger [Sat, 1 Nov 2008 14:42:16 +0000 (15:42 +0100)]
Introduce receive.denyDeletes

Occasionally, it may be useful to prevent branches from getting deleted from
a centralized repository, particularly when no administrative access to the
server is available to undo it via reflog. It also makes
receive.denyNonFastForwards more useful if it is used for access control
since it prevents force-updating by deleting and re-creating a ref.

Signed-off-by: Jan Krüger <jk@jk.gs>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd Makefile check for FreeBSD 4.9-SECURITY
David M. Syzdek [Sun, 26 Oct 2008 11:52:47 +0000 (03:52 -0800)]
Add Makefile check for FreeBSD 4.9-SECURITY

If the system is FreeBSD 4.9, then NO_UINTMAX_T and NO_STRTOUMAX is defined.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoBuild: add NO_UINTMAX_T to support ancient systems
David M. Syzdek [Sun, 26 Oct 2008 11:52:37 +0000 (03:52 -0800)]
Build: add NO_UINTMAX_T to support ancient systems

This adds NO_UINTMAX_T for ancient systems, such as FreeBSD 4.9-SECURITY.
If NO_UINTMAX_T is defined, then uintmax_t is defined as uint32_t.

Signed-off-by: David M. Syzdek <david.syzdek@acsalaska.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 2 Nov 2008 07:15:22 +0000 (00:15 -0700)]
Merge branch 'maint'

* maint:
  Start 1.6.0.4 cycle
  add instructions on how to send patches to the mailing list with Gmail
  Documentation/gitattributes: Add subsection header for each attribute
  git send-email: avoid leaking directory file descriptors.
  send-pack: do not send out single-level refs such as refs/stash
  fix overlapping memcpy in normalize_absolute_path
  pack-objects: avoid reading uninitalized data
  correct cache_entry allocation

Conflicts:
RelNotes

15 years agoStart 1.6.0.4 cycle
Junio C Hamano [Sun, 2 Nov 2008 07:14:04 +0000 (00:14 -0700)]
Start 1.6.0.4 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd instructions on how to send patches to the mailing list with Gmail
Tom Preston-Werner [Sat, 1 Nov 2008 15:28:18 +0000 (15:28 +0000)]
add instructions on how to send patches to the mailing list with Gmail

Gmail is one of the most popular email providers in the world. Now that Gmail
supports IMAP, sending properly formatted patches via `git imap-send` is
trivial. This section in SubmittingPatches explains how to do so.

Signed-off-by: Tom Preston-Werner <tom@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>