1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 12:56:31 +02:00
Commit Graph

21717 Commits

Author SHA1 Message Date
Jeff King a941d5e395 introduce notes-cache interface
Notes provide a fast lookup mechanism for data keyed by
sha1. This is ideal for caching certain operations, like
textconv filters.

This patch builds some infrastructure to make it simpler to
use notes trees as caches. In particular, caches:

  1. don't have arbitrary commit messages. They store a
     cache validity string in the commit, and clear the tree
     when the cache validity string changes.

  2. don't keep any commit history. The accumulated history
     of a a cache is just useless cruft.

  3. use a looser form of locking for ref updates. If two
     processes try to write to the cache simultaneously, it
     is OK if one overwrites the other, losing some changes.
     It's just a cache, so we will just end up with an extra
     miss.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:58:30 -07:00
Jeff King 40d52ff77b make commit_tree a library function
Until now, this has been part of the commit-tree builtin.
However, it is already used by other builtins (like commit,
merge, and notes), and it would be useful to access it from
library code.

The check_valid helper has to come along, too, but is given
a more library-ish name of "assert_sha1_type".

Otherwise, the code is unchanged. There are still a few
rough edges for a library function, like printing the utf8
warning to stderr, but we can address those if and when they
come up as inappropriate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:53:54 -07:00
Jeff King b76c056b95 fix textconv leak in emit_rewrite_diff
We correctly free() for the normal diff case, but leak for
rewrite diffs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:49:29 -07:00
Jeff King c00e657df2 fix const-correctness of write_sha1_file
These should take const buffers as input data, but zlib's
next_in pointer is not const-correct. Let's fix it at the
zlib level, though, so the cast happens in one obvious
place. This should be safe, as a similar cast is used in
zlib's example code for a const array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:49:03 -07:00
Junio C Hamano 890a13a452 Sync with 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 15:14:27 -07:00
Junio C Hamano 2be10bb5c1 Git 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 15:12:08 -07:00
Junio C Hamano 970957dbad Merge branch 'jc/maint-refs-dangling' into maint
* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-31 15:09:32 -07:00
Holger Weiß 4318d3ba8f Documentation: show-ref <pattern>s are optional
Specifying one or more <pattern> parameters is optional when calling
show-ref, so mark them as such using brackets in the manual.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:22:17 -07:00
Holger Weiß 2170422790 Link against libiconv on IRIX
On IRIX, "-liconv" must be added to the linker command line in order to
get iconv(3) support; set the according Makefile variable appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:22:06 -07:00
Holger Weiß 21e403a7b9 Don't redefine htonl and ntohl on big-endian
Since commit 0fcabdeb52, compat/bswap.h
redefined htonl and ntohl to bswap32 not only if bswap32 has been
defined earlier in compat/bswap.h (which is done only on selected
platforms), but also if bswap32 has been defined anywhere else.  This
broke Git at least for NetBSD systems running on big-endian machines
(where ntohl and htonl should, of course, be NOOPs), since NetBSD
defines a bswap32 macro in the system headers.

So, we now undefine any previously defined bswap32 in compat/bswap.h
before defining our own.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:21:39 -07:00
Jakub Narebski 7a49c254cd gitweb: git_get_project_config requires only $git_dir, not also $project
Fix overeager early return in git_get_project_config, introduced in 9be3614
(gitweb: Fix project-specific feature override behavior, 2010-03-01).  When
git_get_project_config is called from projects list page via
git_get_project_owner($path) etc., it is called with $git_dir defined (in
git_get_project_owner($path) etc.), but $project variable is not defined.
git_get_project_config doesn't use $project variable anyway.

Reported-by: Tobias Heinlein <keytoaster@gentoo.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 10:57:04 -07:00
Jan Stępień e4762865c8 Updated the usage string of git reset
Make git reset usage string reflect the command's behaviour and contents of
the man page.

Signed-off-by: Jan Stępień <jstepien@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 08:15:02 -07:00
Greg Bacon 09f53b16bc Documentation: Clarify support for smart HTTP backend
In the description of http.getanyfile, replace the vague "older Git
clients" with the earliest release whose client is able to use the
upload pack service.

Signed-off-by: Greg Bacon <gbacon@dbresearch.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 16:49:19 -07:00
Johannes Sixt 852f098c06 Windows: fix utime() for read-only files
Starting with 5256b00 (Use git_mkstemp_mode instead of plain mkstemp to
create object files, 2010-02-22) utime() is invoked on read-only files.
This is not allowed on Windows and results in many warnings of the form

failed utime() on .git/objects/23/tmp_obj_VlgHlc: Permission denied

during a repack.  Fix it by making the file temporarily writable.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 16:34:04 -07:00
Johannes Sixt da1fbed3ff diff: fix textconv error zombies
To make the code simpler, run_textconv lumps all of its
error checking into one conditional. However, the
short-circuit means that an error in reading will prevent us
from calling finish_command, leaving a zombie child.
Clean up properly after errors.

Based-on-work-by: Jeff King <peff@peff.net>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-30 14:46:33 -07:00
Junio C Hamano 87b3c0117a Merge branch 'maint'
* maint:
  format-patch: Squelch 'fatal: Not a range." error
2010-03-29 21:29:24 -07:00
Kevin Ballard 657ab61efa format-patch: Squelch 'fatal: Not a range." error
Don't output an error on `git format-patch --ignore-if-in-upstream HEAD`.
This matches the behavior of `git format-patch HEAD`.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-29 21:22:37 -07:00
Junio C Hamano 6a6955134b Update draft release notes to 1.7.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 21:57:59 -07:00
Junio C Hamano 99f5b0845a Merge branch 'cc/cherry-pick-ff'
* cc/cherry-pick-ff:
  revert: fix tiny memory leak in cherry-pick --ff
  rebase -i: use new --ff cherry-pick option
  Documentation: describe new cherry-pick --ff option
  cherry-pick: add tests for new --ff option
  revert: add --ff option to allow fast forward when cherry-picking
  builtin/merge: make checkout_fast_forward() non static
  parse-options: add parse_options_concat() to concat options
2010-03-28 21:52:28 -07:00
Junio C Hamano 3b37d9c17e Merge branch 'sb/notes-parse-opt'
* sb/notes-parse-opt:
  notes: rework subcommands and parse options

Conflicts:
	builtin/notes.c
2010-03-28 21:52:28 -07:00
Junio C Hamano ff0a181fa6 Merge branch 'maint'
* maint:
  Prepare for 1.7.0.4

Conflicts:
	RelNotes
2010-03-28 21:52:18 -07:00
Thomas Rast 0acb62f202 rebase -i: make post-rewrite work for 'edit'
The post-rewrite support, in the form of the call to
'record_in_rewritten', was hidden in the arm where we have to record a
new commit for the user.  This meant that it was never invoked in the
case where the user has already amended the commit by herself.

[The test is designed to exercise both arms of the 'if' in question.]

Furthermore, recording the stopped-sha (the SHA1 of the commit before
the editing) suffered from a cut&paste error from die_with_patch and
used the wrong variable, hence it never recorded anything.

Noticed by Junio.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 21:34:40 -07:00
Junio C Hamano e07665e524 Prepare for 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 21:32:25 -07:00
Junio C Hamano cc64c6970a Merge branch 'cp/add-u-pathspec' into maint
* cp/add-u-pathspec:
  test for add with non-existent pathspec
  git add -u: die on unmatched pathspec
2010-03-28 21:21:42 -07:00
Junio C Hamano faf752693a Merge branch 'maint'
* maint:
  t9350: fix careless use of "cd"
  difftool: Fix '--gui' when diff.guitool is unconfigured
  fast-export: don't segfault when marks file cannot be opened
2010-03-28 17:42:58 -07:00
Junio C Hamano 4c367c6ae9 t9350: fix careless use of "cd"
Upon failure of any of these tests (or when a test that is marked as
expecting a failure is fixed), we will end up running later tests in
random places.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 17:42:11 -07:00
David Aguilar 42accaec01 difftool: Fix '--gui' when diff.guitool is unconfigured
When diff.guitool is unconfigured and "--gui" is specified
git-difftool dies with the following error message:

	config diff.guitool: command returned error: 1

Catch the error so that the "--gui" flag is a no-op when
diff.guitool is unconfigured.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 09:29:12 -07:00
Sverre Rabbelier bb6ad28c23 fast-export: don't segfault when marks file cannot be opened
The error function only prints an error message, resulting in a
segfault if we later on try to fprintf to a NULL handle.

Fix this by using die_errno instead.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 09:26:16 -07:00
Chris Webb 10439d89eb imap-send: suppress warning about cleartext password with CRAM-MD5
If a CRAM-MD5 challenge-response is used to authenticate to the IMAP server,
git imap-send shouldn't warn about the password being sent in the clear.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-28 09:24:25 -07:00
Junio C Hamano 5e4f614742 Merge branch 'jh/maint-submodule-status-in-void'
* jh/maint-submodule-status-in-void:
  git submodule summary: Handle HEAD as argument when on an unborn branch
  submodule summary: do not fail before the first commit
2010-03-24 16:55:37 -07:00
Junio C Hamano a86ed83cce Merge branch 'tr/notes-display'
* tr/notes-display:
  git-notes(1): add a section about the meaning of history
  notes: track whether notes_trees were changed at all
  notes: add shorthand --ref to override GIT_NOTES_REF
  commit --amend: copy notes to the new commit
  rebase: support automatic notes copying
  notes: implement helpers needed for note copying during rewrite
  notes: implement 'git notes copy --stdin'
  rebase -i: invoke post-rewrite hook
  rebase: invoke post-rewrite hook
  commit --amend: invoke post-rewrite hook
  Documentation: document post-rewrite hook
  Support showing notes from more than one notes tree
  test-lib: unset GIT_NOTES_REF to stop it from influencing tests

Conflicts:
	git-am.sh
	refs.c
2010-03-24 16:26:43 -07:00
Junio C Hamano b6a7a06aa6 Merge branch 'jl/submodule-diff-dirtiness'
* jl/submodule-diff-dirtiness:
  git status: ignoring untracked files must apply to submodules too
  git status: Fix false positive "new commits" output for dirty submodules
  Refactor dirty submodule detection in diff-lib.c
  git status: Show detailed dirty status of submodules in long format
  git diff --submodule: Show detailed dirty status of submodules
2010-03-24 16:25:43 -07:00
Junio C Hamano 797d44343c Merge branch 'pb/log-first-parent-p-m'
* pb/log-first-parent-p-m:
  show --first-parent/-m: do not default to --cc
  show -c: show patch text
  revision: introduce setup_revision_opt
  t4013: add tests for log -p -m --first-parent
  git log -p -m: document -m and honor --first-parent
2010-03-24 16:25:39 -07:00
Junio C Hamano 954f7cfdac Merge branch 'jc/maint-refs-dangling'
* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-24 16:25:34 -07:00
Junio C Hamano a5ee8faaee Merge branch 'maint'
* maint:
  Documentation: explain the meaning of "-g" in git-describe output
2010-03-24 16:24:21 -07:00
Junio C Hamano 0476228de5 Merge branch 'jc/color-attrs' into maint
* jc/color-attrs:
  color: allow multiple attributes
2010-03-24 16:24:13 -07:00
Junio C Hamano bcbbe4f9d9 Merge branch 'jk/maint-add-ignored-dir' into maint
* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such
2010-03-24 16:24:03 -07:00
Junio C Hamano 7b676b1bb5 Merge branch 'bg/apply-fix-blank-at-eof' into maint
* bg/apply-fix-blank-at-eof:
  t3417: Add test cases for "rebase --whitespace=fix"
  t4124: Add additional tests of --whitespace=fix
  apply: Allow blank context lines to match beyond EOF
  apply: Remove the quick rejection test
  apply: Don't unnecessarily update line lengths in the preimage
2010-03-24 16:23:50 -07:00
Markus Heidelberg 846b8f681a Documentation: explain the meaning of "-g" in git-describe output
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-24 11:31:45 -07:00
Junio C Hamano 4503bd5c37 Sync with Git 1.7.0.3
* maint:
  Git 1.7.0.3
  .mailmap: Map the the first submissions of MJG by e-mail
  Documentation/git-clone: Transform description list into item list
  Documentation/urls: Remove spurious example markers
  Documentation/gitdiffcore: Remove misleading date in heading
  Documentation/git-reflog: Fix formatting of command lists
2010-03-21 17:03:57 -07:00
Junio C Hamano 0b3dcfe721 Git 1.7.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 17:01:22 -07:00
Junio C Hamano d16a5dafdc Merge branch 'maint-1.6.6' into maint
* maint-1.6.6:
  Documentation/git-clone: Transform description list into item list
  Documentation/urls: Remove spurious example markers
  Documentation/gitdiffcore: Remove misleading date in heading
  Documentation/git-reflog: Fix formatting of command lists
2010-03-21 17:00:22 -07:00
Michael J Gruber 11f54989da .mailmap: Map the the first submissions of MJG by e-mail
so that git shortlog with '-e' coalesces all my commits.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 16:30:17 -07:00
Michael J Gruber 476386858c Documentation/git-clone: Transform description list into item list
so that the list of examples is formatted in the same way as for
git-fetch, and, more importantly, the different identation for the
code blocks in the examples (compared to the immediately preceding code
blocks from url.txt) doesn't look like misformatted, but is clarified by
the items' bullets.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 14:45:05 -07:00
Michael J Gruber a3cfb7f83f Documentation/urls: Remove spurious example markers
In urls.txt (which is included from git-{clone,fetch,push}.txt)
several item lists are surrounded by example block markers. This is
problematic for two reasons:

- None of these lists are example lists, so they should not be marked as
  such semantically.
- The html output looks weird (bulleted list with left sidebar).

Therefore, remove the example block markers. Output by the man backend
is unaffected.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 14:42:24 -07:00
Michael J Gruber dddfb3f126 Documentation/gitdiffcore: Remove misleading date in heading
Ever since the automatic conversion into man form, the heading
contained a misidentified subheading reading "June 2005".
Remove this since the documentation is more recent, and the correct
date is in the footer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 14:40:18 -07:00
Michael J Gruber b6c7c41b17 Documentation/git-reflog: Fix formatting of command lists
A misplaced list continuation mark appears literally in the
rendered doc. Fix this by removing it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-21 14:40:02 -07:00
Jonathan Nieder 28db756fee revert: fix tiny memory leak in cherry-pick --ff
We forgot to free defmsg when returning early for a fast-forward.

Fixing this should reduce noise during test suite runs with valgrind.
More importantly, once cherry-pick learns to pick multiple commits,
the amount of memory leaked would start to add up.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20 19:25:48 -07:00
Junio C Hamano 0d0925c5e2 Update draft release notes to 1.7.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20 11:42:34 -07:00
Junio C Hamano 4e7d08a229 Merge branch 'jk/maint-add-ignored-dir'
* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such
2010-03-20 11:29:36 -07:00