git
15 years agowt-status: refactor initial commit printing
Jeff King [Wed, 12 Nov 2008 08:21:39 +0000 (03:21 -0500)] 
wt-status: refactor initial commit printing

When we showed the initial commit, we had no reference to
diff against, so we went through the cache manually.
Nowadays, however, we have a virtual empty tree commit, so
we can simply diff against that to get the same results.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodefine empty tree sha1 as a macro
Jeff King [Wed, 12 Nov 2008 08:17:52 +0000 (03:17 -0500)] 
define empty tree sha1 as a macro

This can potentially be used in a few places, so let's make
it available to all parts of the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-diff: Add --staged as a synonym for --cached.
David Symonds [Wed, 29 Oct 2008 16:15:36 +0000 (09:15 -0700)] 
git-diff: Add --staged as a synonym for --cached.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-p4: Cache git config for performance
John Chapman [Sat, 8 Nov 2008 03:22:49 +0000 (14:22 +1100)] 
git-p4: Cache git config for performance

This makes git-p4 noticibly faster on Windows.

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-p4: Support purged files and optimize memory usage
John Chapman [Sat, 8 Nov 2008 03:22:48 +0000 (14:22 +1100)] 
git-p4: Support purged files and optimize memory usage

Purged files are handled as if they are merely deleted, which is not
entirely optimal, but I don't know of any other way to handle them.
File data is deleted from memory as early as they can, and they are more
efficiently handled, at (significant) cost to CPU usage.

Still need to handle p4 branches with spaces in their names.
Still need to make git-p4 clone more reliable.
 - Perhaps with a --continue option. (Sometimes the p4 server kills
 the connection)

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix non-literal format in printf-style calls
Daniel Lowe [Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500)] 
Fix non-literal format in printf-style calls

These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 11 Nov 2008 22:46:31 +0000 (14:46 -0800)] 
Merge branch 'maint'

* maint:
  Fix non-literal format in printf-style calls
  git-submodule: Avoid printing a spurious message.
  git ls-remote: make usage string match manpage
  Makefile: help people who run 'make check' by mistake

15 years agoFix non-literal format in printf-style calls
Daniel Lowe [Mon, 10 Nov 2008 21:07:52 +0000 (16:07 -0500)] 
Fix non-literal format in printf-style calls

These were found using gcc 4.3.2-1ubuntu11 with the warning:

    warning: format not a string literal and no format arguments

Incorporated suggestions from Brandon Casey <casey@nrlssc.navy.mil>.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 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 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 '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 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 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 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 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 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 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 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 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 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>
15 years agoDocumentation/gitattributes: Add subsection header for each attribute
Jakub Narebski [Sat, 1 Nov 2008 06:24:55 +0000 (06:24 +0000)] 
Documentation/gitattributes: Add subsection header for each attribute

This makes attributes easier to find; before this patch some
attributes had individual subsections, and some didn't.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit send-email: avoid leaking directory file descriptors.
Pierre Habouzit [Fri, 31 Oct 2008 18:57:10 +0000 (18:57 +0000)] 
git send-email: avoid leaking directory file descriptors.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosend-pack: do not send out single-level refs such as refs/stash
Jeff King [Wed, 29 Oct 2008 05:17:55 +0000 (05:17 +0000)] 
send-pack: do not send out single-level refs such as refs/stash

Since no version of receive-pack accepts these "funny refs", we should
mirror the check when considering the list of refs to send. IOW, don't
even make them eligible for matching or mirroring.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix overlapping memcpy in normalize_absolute_path
Jeff King [Thu, 23 Oct 2008 04:32:23 +0000 (04:32 +0000)] 
fix overlapping memcpy in normalize_absolute_path

The comments for normalize_absolute_path explicitly claim
that the source and destination buffers may be the same
(though they may not otherwise overlap). Thus the call to
memcpy may involve copying overlapping data, and memmove
should be used instead.

This fixes a valgrind error in t1504.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopack-objects: avoid reading uninitalized data
Jeff King [Thu, 23 Oct 2008 04:31:03 +0000 (04:31 +0000)] 
pack-objects: avoid reading uninitalized data

In the main loop of find_deltas, we do:

  struct object_entry *entry = *list++;
  ...
  if (!*list_size)
  ...
  break

Because we look at and increment *list _before_ the check of
list_size, in the very last iteration of the loop we will
look at uninitialized data, and increment the pointer beyond
one past the end of the allocated space. Since we don't
actually do anything with the data until after the check,
this is not a problem in practice.

But since it technically violates the C standard, and
because it provokes a spurious valgrind warning, let's just
move the initialization of entry to a safe place.

This fixes valgrind errors in t5300, t5301, t5302, t303, and
t9400.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocorrect cache_entry allocation
Jeff King [Thu, 23 Oct 2008 04:30:58 +0000 (04:30 +0000)] 
correct cache_entry allocation

Most cache_entry structs are allocated by using the
cache_entry_size macro, which rounds the size of the struct
up to the nearest multiple of 8 bytes (presumably to avoid
memory fragmentation).

There is one exception: the special "conflict entry" is
allocated with an empty name, and so is explicitly given
just one extra byte to hold the NUL.

However, later code doesn't realize that this particular
struct has been allocated differently, and happily tries
reading and copying it based on the ce_size macro, which
assumes the 8-byte alignment.

This can lead to reading uninitalized data, though since
that data is simply padding, there shouldn't be any problem
as a result. Still, it makes sense to hold the padding
assumption so as not to surprise later maintainers.

This fixes valgrind errors in t1005, t3030, t4002, and
t4114.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Sun, 2 Nov 2008 05:31:46 +0000 (22:31 -0700)] 
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui: (27 commits)
  git-gui: Update German translation.
  git-gui: Do not munge conflict marker lines in a normal diff
  git-gui: Add a simple implementation of SSH_ASKPASS.
  git-gui: Add a dialog that shows the OpenSSH public key.
  git-gui: Mark-up strings in show_{other,unmerged}_diff() for localization
  git-gui: Show a round number of bytes of large untracked text files
  git-gui: Fix the blame viewer destroy handler.
  git-gui: Add a search command to the blame viewer.
  git-gui: Fix the blame window shape.
  git-gui: Fix switch statement in lib/merge.tcl
  git-gui: Fix fetching from remotes when adding them
  git-gui: Fix removing non-pushable remotes
  git-gui: Make input boxes in init/clone/open dialogs consistent
  git-gui: Avoid using the term URL when specifying repositories
  git-gui: gui.autoexplore makes explorer to pop up automatically after picking
  git-gui: Add Explore Working Copy to the Repository menu
  git-gui: Use git web--browser for web browsing
  git-gui: mkdir -p when initializing new remote repository
  git-gui: Add support for removing remotes
  git-gui: Add support for adding remotes
  ...

15 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Sun, 2 Nov 2008 05:31:14 +0000 (22:31 -0700)] 
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Help identify aspell version on Windows too

15 years agogit-gui: Update German translation.
Christian Stimming [Sat, 25 Oct 2008 20:51:05 +0000 (22:51 +0200)] 
git-gui: Update German translation.

Not yet completed, though.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Do not munge conflict marker lines in a normal diff
Johannes Sixt [Tue, 14 Oct 2008 11:48:37 +0000 (13:48 +0200)] 
git-gui: Do not munge conflict marker lines in a normal diff

Previously, conflict markers were highlighted in two ways: (1) They
received a distinguishing color; and (2) they had the '+' removed at the
beginning of the line. However, by doing (2), a hunk that contained
conflict markers could not be staged or unstaged because the resulting
patch was corrupted. With this change we no longer modify the diff text
of a 2-way diff, so that "Stage Hunk" and friends work.

Note that 3-way diff of a conflicted file is unaffected by this change,
and '++' before conflict markers is still removed. But this has no negative
impact because in this mode staging hunks or lines is disabled anyway.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Add a simple implementation of SSH_ASKPASS.
Alexander Gavrilov [Wed, 15 Oct 2008 09:28:21 +0000 (13:28 +0400)] 
git-gui: Add a simple implementation of SSH_ASKPASS.

OpenSSH allows specifying an external program to use
for direct user interaction. While most Linux systems
already have such programs, some environments, for
instance, msysgit, lack it. This patch adds a simple
fallback Tcl implementation of the tool.

In msysgit it is also necessary to set a fake value of
the DISPLAY variable, because otherwise ssh won't even
try to use SSH_ASKPASS handlers.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Add a dialog that shows the OpenSSH public key.
Alexander Gavrilov [Wed, 15 Oct 2008 09:28:20 +0000 (13:28 +0400)] 
git-gui: Add a dialog that shows the OpenSSH public key.

Generating a new SSH key or finding an existing one may
be a difficult task for non-technical users, especially
on Windows.

This commit adds a new dialog that shows the public key,
or allows the user to generate a new one if none were found.
Since this is a convenience/informational feature for new
users, and the dialog is mostly read-only, it is located
in the Help menu.

The command line used to invoke ssh-keygen is designed to
force it to use SSH_ASKPASS if available, or accept empty
passphrases, but _never_ wait for user response on the tty.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoupdate-ref --no-deref -d: handle the case when the pointed ref is packed
Miklos Vajna [Fri, 31 Oct 2008 23:25:44 +0000 (00:25 +0100)] 
update-ref --no-deref -d: handle the case when the pointed ref is packed

In this case we did nothing in the past, but we should delete the
reference in fact.

The problem was that when the symref is not packed but the referenced
ref is packed, then we assumed that the symref is packed as well, but
symrefs are never packed.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 31 Oct 2008 08:42:58 +0000 (01:42 -0700)] 
Merge branch 'maint'

* maint:
  git-svn: change dashed git-commit-tree to git commit-tree
  Documentation: clarify information about 'ident' attribute
  bash completion: add doubledash to "git show"
  Use test-chmtime -v instead of perl in t5000 to get mtime of a file
  Add --verbose|-v to test-chmtime
  asciidoc: add minor workaround to add an empty line after code blocks
  Plug a memleak in builtin-revert
  Add file delete/create info when we overflow rename_limit
  Install git-cvsserver in $(bindir)
  Install git-shell in bindir, too

15 years agogit-svn: change dashed git-commit-tree to git commit-tree
Deskin Miller [Fri, 31 Oct 2008 04:10:25 +0000 (00:10 -0400)] 
git-svn: change dashed git-commit-tree to git commit-tree

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: clarify information about 'ident' attribute
Jan Krüger [Thu, 30 Oct 2008 18:14:33 +0000 (19:14 +0100)] 
Documentation: clarify information about 'ident' attribute

The documentation spoke of the attribute being set "to" a path; this can
mistakenly be interpreted as "the attribute needs to have its value set to
some kind of path". This clarifies things.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: add doubledash to "git show"
Markus Heidelberg [Fri, 31 Oct 2008 00:04:46 +0000 (01:04 +0100)] 
bash completion: add doubledash to "git show"

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse test-chmtime -v instead of perl in t5000 to get mtime of a file
Alex Riesen [Thu, 30 Oct 2008 10:20:27 +0000 (11:20 +0100)] 
Use test-chmtime -v instead of perl in t5000 to get mtime of a file

The test was broken on admittedly broken combination of Windows, Cygwin,
and ActiveState Perl.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd --verbose|-v to test-chmtime
Alex Riesen [Thu, 30 Oct 2008 09:00:29 +0000 (10:00 +0100)] 
Add --verbose|-v to test-chmtime

This allows us replace perl when getting the mtime of a file because
of time zone conversions, though at the moment only one platform which
does this has been identified: Cygwin when used with ActiveState Perl
(as usual).

The output format is:

    <mtime1> TAB <filename1> <LF>
    <mtime2> TAB <filename2> <LF>
    ...

which, if only mtime is needed can be parsed with cut(1):

    test-chmtime -v +0 filename1 | cut -f 1

Also, the change adds a description of programs features, with examples.

Signed-off-by: Alex Riesen <ariesen@harmanbecker.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoasciidoc: add minor workaround to add an empty line after code blocks
Jonas Fonseca [Thu, 30 Oct 2008 10:45:03 +0000 (11:45 +0100)] 
asciidoc: add minor workaround to add an empty line after code blocks

Insert an empty <simpara> in manpages after code blocks to force and
empty line.

The problem can be seen on the manpage for the git tutorial, where an
example command and the following paragraph is printed with no empty
line between them:

     First, note that you can get documentation for a command such as git
     log --graph with:

         $ man git-log
     It is a good idea to introduce yourself to git [...]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ar/maint-mksnpath' into ar/mksnpath
Junio C Hamano [Fri, 31 Oct 2008 01:08:58 +0000 (18:08 -0700)] 
Merge branch 'ar/maint-mksnpath' into ar/mksnpath

* 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

Conflicts:
builtin-revert.c
refs.c
rerere.c

15 years agoUse git_pathdup instead of xstrdup(git_path(...))
Alex Riesen [Mon, 27 Oct 2008 10:22:09 +0000 (11:22 +0100)] 
Use git_pathdup instead of xstrdup(git_path(...))

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit_pathdup: returns xstrdup-ed copy of the formatted path
Alex Riesen [Mon, 27 Oct 2008 10:17:51 +0000 (11:17 +0100)] 
git_pathdup: returns xstrdup-ed copy of the formatted path

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix potentially dangerous use of git_path in ref.c
Alex Riesen [Mon, 27 Oct 2008 10:11:40 +0000 (11:11 +0100)] 
Fix potentially dangerous use of git_path in ref.c

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd git_snpath: a .git path formatting routine with output buffer
Alex Riesen [Mon, 27 Oct 2008 09:22:21 +0000 (10:22 +0100)] 
Add git_snpath: a .git path formatting routine with output buffer

The function's purpose is to replace git_path where the buffer of
formatted path may not be reused by subsequent calls of the function
or will be copied anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoPlug a memleak in builtin-revert
Alex Riesen [Tue, 28 Oct 2008 17:27:33 +0000 (18:27 +0100)] 
Plug a memleak in builtin-revert

Probably happened when working around git_path's problem with returned
buffer being reused.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit branch -m: forbid renaming of a symref
Miklos Vajna [Wed, 29 Oct 2008 00:05:27 +0000 (01:05 +0100)] 
git branch -m: forbid renaming of a symref

There may be cases where one would really want to rename the symbolic
ref without changing its value, but "git branch -m" is not such a
use-case.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompat/cygwin.c: make runtime detection of lstat/stat lessor impact
Junio C Hamano [Fri, 24 Oct 2008 05:54:09 +0000 (22:54 -0700)] 
compat/cygwin.c: make runtime detection of lstat/stat lessor impact

The original patch that lead to an earlier commit adbc0b6 (cygwin: Use
native Win32 API for stat, 2008-09-30) did not call git_default_config()
and it was a good thing.  The lazy config reading when lstat/stat is
called for the first time to find out if core.filemode is set can happen
anytime in the calling program.  If it happens after the calling program
parsed the configuration file to prime its default parameter settings and
processed its command line parameters to tweak them, this will overwrite
the values set by the program with the values read from the config file.

This essentially reverts the code to the version as submitted by Mark,
with a bit more comments to clarify why we do not fall back on the default
configuration parser from git_cygwin_config().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd file delete/create info when we overflow rename_limit
Linus Torvalds [Mon, 27 Oct 2008 20:06:16 +0000 (13:06 -0700)] 
Add file delete/create info when we overflow rename_limit

When we refuse to do rename detection due to having too many files
created or deleted, let the user know the numbers.  That way there is a
reasonable starting point for setting the diff.renamelimit option.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoInstall git-cvsserver in $(bindir)
Nanako Shiraishi [Wed, 10 Sep 2008 11:03:18 +0000 (20:03 +0900)] 
Install git-cvsserver in $(bindir)

It is one of the server side programs and needs to be found on usual $PATH.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoInstall git-shell in bindir, too
Tommi Virtanen [Sun, 24 Aug 2008 20:23:25 +0000 (23:23 +0300)] 
Install git-shell in bindir, too

/etc/passwd shell field must be something execable, you can't enter
"/usr/bin/git shell" there. git-shell must be present as a separate
executable, or it is useless.

Signed-off-by: Tommi Virtanen <tv@eagain.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix potentially dangerous uses of mkpath and git_path
Alex Riesen [Sun, 26 Oct 2008 22:08:52 +0000 (23:08 +0100)] 
Fix potentially dangerous uses of mkpath and git_path

Replace them with mksnpath/git_snpath and a local buffer
for the resulting string.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ar/maint-mksnpath' into HEAD
Junio C Hamano [Mon, 27 Oct 2008 05:24:44 +0000 (22:24 -0700)] 
Merge branch 'ar/maint-mksnpath' into HEAD

* ar/maint-mksnpath:
  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

15 years agoFix potentially dangerous uses of mkpath and git_path
Alex Riesen [Sun, 26 Oct 2008 22:08:52 +0000 (23:08 +0100)] 
Fix potentially dangerous uses of mkpath and git_path

Replace them with mksnpath/git_snpath and a local buffer
for the resulting string.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix mkpath abuse in dwim_ref and dwim_log of sha1_name.c
Alex Riesen [Sun, 26 Oct 2008 22:07:24 +0000 (23:07 +0100)] 
Fix mkpath abuse in dwim_ref and dwim_log of sha1_name.c

Otherwise the function sometimes fail to resolve obviously correct
refnames, because the string data pointed to by "str" argument were
reused.

The change in dwim_log does not fix anything, just optimizes away
strcpy code as the path can be created directly in the available
buffer.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd mksnpath which allows you to specify the output buffer
Alex Riesen [Sun, 26 Oct 2008 21:59:13 +0000 (22:59 +0100)] 
Add mksnpath which allows you to specify the output buffer

This is just vsnprintf's but additionally calls cleanup_path() on the
result. To be used as alternatives to mkpath() where the buffer for the
created path may not be reused by subsequent calls of the same formatting
function.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>