Commit graph

21251 commits

Author SHA1 Message Date
Nicolas Pitre f965c525a4 move encode_in_pack_object_header() to a better place
Commit 1b22b6c897 made duplicated versions of encode_header() into a
common version called encode_in_pack_object_header(). There is however
a better location that sha1_file.c for such a function though, as
sha1_file.c contains nothing related to the creation of packs, and
it is quite populated already.

Also the comment that was moved to the header file should really remain
near the function as it covers implementation details and provides no
information about the actual function interface.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-23 13:10:56 -08:00
Michael Lukashov 1b22b6c897 refactor duplicated encode_header in pack-objects and fast-import
The following function is duplicated:

  encode_header

Move this function to sha1_file.c and rename it 'encode_in_pack_object_header',
as suggested by Junio C Hamano

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 15:30:20 -08:00
Junio C Hamano 44e0f45035 Merge branch 'np/fast-import-idx-v2'
* np/fast-import-idx-v2:
  fast-import: use the diff_delta() max_delta_size argument
  fast-import: honor pack.indexversion and pack.packsizelimit config vars
  fast-import: make default pack size unlimited
  fast-import: use write_idx_file() instead of custom code
  fast-import: use sha1write() for pack data
  fast-import: start using struct pack_idx_entry

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 15:28:50 -08:00
Junio C Hamano c2c85ed5d9 Update draft release notes to 1.7.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 15:01:11 -08:00
Junio C Hamano faa3b4769c Merge branch 'maint'
* maint:
  Update 1.7.0.1 release notes
2010-02-17 15:00:10 -08:00
Junio C Hamano e3ff352c73 Update 1.7.0.1 release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 15:00:00 -08:00
Junio C Hamano c69f921560 Merge branch 'jk/cherry-pick-reword' into maint
* jk/cherry-pick-reword:
  cherry-pick: prettify the advice message
  cherry-pick: show commit name instead of sha1
  cherry-pick: format help message as strbuf
  cherry-pick: refactor commit parsing code
  cherry-pick: rewrap advice message
2010-02-17 14:55:24 -08:00
Junio C Hamano 031f82f751 Merge branch 'jk/grep-double-dash' into maint
* jk/grep-double-dash:
  accept "git grep -- pattern"
2010-02-17 14:55:15 -08:00
Junio C Hamano 07cb9a369e Merge branch 'jc/typo' into maint
* jc/typo:
  Typofixes outside documentation area
2010-02-17 14:55:09 -08:00
Jakub Narebski 1df4876613 gitweb: Protect escaping functions against calling on undef
This is a bit of future-proofing esc_html and friends: when called
with undefined value they would now would return undef... which would
probably mean that error would still occur, but closer to the source
of problem.

This means that we can safely use
  esc_html(shift) || "Internal Server Error"
in die_error() instead of
  esc_html(shift || "Internal Server Error")

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:18:12 -08:00
Jakub Narebski 453541fcfc gitweb: esc_html (short) error message in die_error
The error message (second argument to die_error) is meant to be short,
one-line text description of given error.  A few callers call
die_error with error message containing unescaped user supplied data
($hash, $file_name).  Instead of forcing callers to escape data,
simply call esc_html on the parameter.

Note that optional third parameter, which contains detailed error
description, is meant to be HTML formatted, and therefore should be
not escaped.

While at it update esc_html synopsis/usage, and bring default error
description to read 'Internal Server Error' (titlecased).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:18:09 -08:00
Nicolas Pitre b500d5e11e fast-import: use the diff_delta() max_delta_size argument
This let diff_delta() abort early if it is going to bust the given
size limit.  Also, only objects larger than 20 bytes are considered
as objects smaller than that are most certainly going to produce
larger deltas than the original object due to the additional headers.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:44 -08:00
Nicolas Pitre 8c2ca8dd8a fast-import: honor pack.indexversion and pack.packsizelimit config vars
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:44 -08:00
Nicolas Pitre 89e0a3a131 fast-import: make default pack size unlimited
Now that fast-import is creating packs with index version 2, there is
no point limiting the pack size by default.  A pack split will still
happen if off_t is not sufficiently large to hold large offsets.

While updating the doc, let's remove the "packfiles fit on CDs"
suggestion.  Pack files created by fast-import are still suboptimal and
a 'git repack -a -f -d' or even 'git gc --aggressive' would be a pretty
good idea before considering storage on CDs.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:43 -08:00
Nicolas Pitre 427cb22c40 fast-import: use write_idx_file() instead of custom code
This allows for the creation of pack index version 2 with its object
CRC and the possibility for a pack to be larger than 4 GB.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:43 -08:00
Nicolas Pitre 212818160d fast-import: use sha1write() for pack data
This is in preparation for using write_idx_file().  Also, by using
sha1write() we get some buffering to reduces the number of write
syscalls, and the written data is SHA1 summed which allows for the extra
data integrity validation check performed in fixup_pack_header_footer()
(details on this in commit abeb40e5aa).

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:42 -08:00
Nicolas Pitre 3fc366bdbb fast-import: start using struct pack_idx_entry
This is in preparation for using write_idx_file().

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-17 11:08:42 -08:00
Junio C Hamano 6d816301cd Merge branch 'jc/typo'
* jc/typo:
  Typofixes outside documentation area
2010-02-16 22:45:14 -08:00
Junio C Hamano 72cd63c008 Merge branch 'maint'
* maint:
  Prepare 1.7.0.1 release notes
  Fix use of mutex in threaded grep
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
  Remove hyphen from "git-command" in two error messages
2010-02-16 22:40:45 -08:00
Junio C Hamano d3f69766c4 Prepare 1.7.0.1 release notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-16 22:25:03 -08:00
Junio C Hamano 354d9f861b Merge branch 'jc/maint-grep-one-thread-mutex-fix' into maint
* jc/maint-grep-one-thread-mutex-fix:
  Fix use of mutex in threaded grep
2010-02-16 22:23:25 -08:00
Junio C Hamano 5f02d31597 Fix use of mutex in threaded grep
The program can decide at runtime not to use threading even if the support
is compiled in.  In such a case, mutexes are not necessary and left
uninitialized.  But the code incorrectly tried to take and release the
read_sha1_mutex unconditionally.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Fredrik Kuivinen <frekui@gmail.com>
2010-02-16 19:19:05 -08:00
Junio C Hamano e7b3cea0f7 Merge branch 'maint-1.6.6' into maint
* maint-1.6.6:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
  Remove hyphen from "git-command" in two error messages
2010-02-16 15:05:02 -08:00
Junio C Hamano eb0bcd0fbe Merge branch 'maint-1.6.5' into maint-1.6.6
* maint-1.6.5:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
2010-02-16 15:04:55 -08:00
Jeff King 003c6abdb2 dwim_ref: fix dangling symref warning
If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-16 09:03:58 -08:00
Thomas Rast 460ccd0e19 stash pop: remove 'apply' options during 'drop' invocation
The 'git stash pop' option parsing used to remove the first argument
in --index mode.  At the time this was implemented, this first
argument was always --index.  However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

  git stash drop --index

by running

  git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way.  This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:27 -08:00
Larry D'Anna 8324b977ae diff: make sure --output=/bad/path is caught
The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 21:46:01 -08:00
Pete Harlan 7283bbc70a Remove hyphen from "git-command" in two error messages
Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-15 18:20:54 -08:00
Junio C Hamano 7e5eb8f183 Merge branch 'maint'
* maint:
  fix minor memory leak in get_tree_entry()
2010-02-14 18:59:20 -08:00
Junio C Hamano b599672316 Merge branch 'maint-1.6.6' into maint
* maint-1.6.6:
  fix minor memory leak in get_tree_entry()
2010-02-14 18:59:14 -08:00
René Scharfe ef0065034a fix minor memory leak in get_tree_entry()
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-14 03:04:20 -08:00
Junio C Hamano 7e94805db2 Merge branch 'maint'
* maint:
  Start 1.7.0 maintenance track

Conflicts:
	RelNotes
2010-02-13 15:14:04 -08:00
Junio C Hamano 263830c47b Merge branch 'rs/git-dir-cleanup'
* rs/git-dir-cleanup:
  Resurrect "git grep --no-index"
  setenv(GIT_DIR) clean-up

Conflicts:
	builtin-grep.c
	t/t7002-grep.sh
2010-02-13 15:09:33 -08:00
Junio C Hamano 67eb5383dd Merge branch 'jk/cherry-pick-reword'
* jk/cherry-pick-reword:
  cherry-pick: prettify the advice message
  cherry-pick: show commit name instead of sha1
  cherry-pick: format help message as strbuf
  cherry-pick: refactor commit parsing code
  cherry-pick: rewrap advice message
2010-02-13 15:09:33 -08:00
Junio C Hamano e7c2466593 Merge branch 'jk/grep-double-dash'
* jk/grep-double-dash:
  accept "git grep -- pattern"
2010-02-13 15:09:33 -08:00
Junio C Hamano 59332d13b2 Resurrect "git grep --no-index"
This reverts commit 3c8f6c8 (Revert 30816237 and 7e62265, 2010-02-05) as
the issue has been sorted out.
2010-02-13 15:07:14 -08:00
Junio C Hamano 9b25048318 Start 1.7.0 maintenance track
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-13 15:04:00 -08:00
Junio C Hamano 318721e3ac Start 1.7.1 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-13 15:01:37 -08:00
Junio C Hamano e923eaeb90 Git 1.7.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:45:05 -08:00
Junio C Hamano ca5812d2e3 Merge branch 'maint'
* maint:
  Fix typo in 1.6.6.2 release notes
  Re-fix check-ref-format documentation mark-up
2010-02-12 15:40:59 -08:00
Junio C Hamano 341d9a48cc Fix typo in 1.6.6.2 release notes
Of course, these are changes since 1.6.6.1; changes since 1.6.6.2
would have been nil.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:40:01 -08:00
Junio C Hamano 8222153d84 Re-fix check-ref-format documentation mark-up
It is not double-backslash we forbid; backslashes are forbidden since
a4c2e699 (Disallow '\' in ref names, 2009-05-08)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 15:39:03 -08:00
Junio C Hamano 9b4c8b0ae8 archive documentation: attributes are taken from the tree by default
By default, git-archive takes attributes from the tree being archived.
People however often wonder why their attempts to affect the way how the
command archives their tree by changing .gitattributes in their work tree
fail.

Add a bit of explanatory note to tell them how to achieve what they want
to do.

Noticed-by: Francois Marier
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:38:20 -08:00
Michael J Gruber f937421702 Documentation: minor fixes to RelNotes-1.7.0
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:38:02 -08:00
SZEDER Gábor 85f6b439f2 bash: support 'git am's new '--continue' option
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-12 09:08:17 -08:00
Junio C Hamano 618d18b5aa Merge branch 'maint'
* maint:
  filter-branch: Fix error message for --prune-empty --commit-filter
2010-02-11 23:06:32 -08:00
Jacob Helwig 5da8171370 filter-branch: Fix error message for --prune-empty --commit-filter
Running filter-branch with --prune-empty and --commit-filter reports:

  "Cannot set --prune-empty and --filter-commit at the same time".

Change it to use the correct option name: --commit-filter

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:12:36 -08:00
Jeff King 4d128884fb cherry-pick: prettify the advice message
It's hard to see the "how to commit" part of this message,
which users may want to cut and paste. On top of that,
having it in paragraph form means that a really long commit
name may cause ugly wrapping. Let's make it prettier, like:

  Automatic cherry-pick failed.  After resolving the conflicts,
  mark the corrected paths with 'git add <paths>' or 'git rm <paths>'
  and commit the result with:

          git commit -c HEAD~23

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:12 -08:00
Jeff King 97915544f8 cherry-pick: show commit name instead of sha1
When we have a conflict, we advise the user to do:

  git commit -c $sha1

This works fine, but is unnecessarily confusing and annoying
for the user to type, when:

  git commit -c $the_thing_you_called_cherry_pick_with

works just as well.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:04 -08:00
Jeff King 08565bdb4b cherry-pick: format help message as strbuf
This gets rid of the fixed-size buffer and an unchecked
sprintf. That sprintf is actually OK as the only
variable-sized thing put in it is an abbreviated sha1, which
is bounded at 40 characters. However, the next patch will
change that to something unbounded.

Note that this function now returns an allocated buffer
instead of a static one; however, it doesn't matter as the
only caller exits immediately.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-11 22:11:03 -08:00