Commit Graph

26796 Commits

Author SHA1 Message Date
Junio C Hamano
40d03c91bc Merge branch 'jp/get-ref-dir-unsorted' into next
* jp/get-ref-dir-unsorted:
  refs.c: free duplicate entries in the ref array instead of leaking them
  refs.c: abort ref search if ref array is empty
  refs.c: ensure struct whose member may be passed to realloc is initialized

Conflicts:
	refs.c
2011-10-10 15:28:31 -07:00
Junio C Hamano
092175e3e5 Merge branch 'jc/request-pull-show-head-4' into next
* jc/request-pull-show-head-4:
  environment.c: Fix an sparse "symbol not declared" warning
  builtin/log.c: Fix an "Using plain integer as NULL pointer" warning
2011-10-10 15:28:29 -07:00
Brandon Casey
17d68a54de refs.c: free duplicate entries in the ref array instead of leaking them
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-10 10:05:39 -07:00
Brandon Casey
687296960d refs.c: abort ref search if ref array is empty
The bsearch() implementation on IRIX 6.5 segfaults if it is passed NULL
for the base array argument even if number-of-elements is zero.  So, let's
work around it by detecting an empty array and aborting early.

This is a useful optimization in its own right anyway, since we avoid a
useless allocation and initialization of the ref_entry when the ref array
is empty.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-10 10:05:22 -07:00
Brandon Casey
43d20a8c50 refs.c: ensure struct whose member may be passed to realloc is initialized
The variable "refs" is allocated on the stack but is not initialized.  It
is passed to read_packed_refs(), and its struct members may eventually be
passed to add_ref() and ALLOC_GROW().  Since the structure has not been
initialized, its members may contain random non-zero values.  So let's
initialize it.

The call sequence looks something like this:

   resolve_gitlink_packed_ref(...) {

       struct cached_refs refs;
       ...
       read_packed_refs(f, &refs);
       ...
   }

   read_packed_refs(FILE*, struct cached_refs *cached_refs) {
       ...
       add_ref(name, sha1, flag, &cached_refs->packed, &last);
       ...
   }

   add_ref(..., struct ref_array *refs, struct ref_entry **) {
       ...
       ALLOC_GROW(refs->refs, refs->nr + 1, refs->alloc);
   }

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-10 10:05:07 -07:00
Ramsay Jones
273c7032e9 environment.c: Fix an sparse "symbol not declared" warning
In particular, sparse issues the following warning:

    environment.c:62:5: warning: symbol 'merge_log_config' was not \
        declared. Should it be static?

In order to supress the warning, we include the "fmt-merge-msg.h"
header file, since it contains an appropriate extern declaration for
the 'merge_log_config' variable.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-09 13:20:54 -07:00
Ramsay Jones
22a8699a6b builtin/log.c: Fix an "Using plain integer as NULL pointer" warning
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-09 12:53:04 -07:00
Junio C Hamano
fbb28a2df5 Merge branch 'js/maint-merge-one-file-osx-expr' into next
* js/maint-merge-one-file-osx-expr:
  merge-one-file: fix "expr: non-numeric argument"
2011-10-07 13:10:27 -07:00
Junio C Hamano
fcaeca081f Merge branch 'jc/request-pull-show-head-4' into next
* jc/request-pull-show-head-4:
  fmt-merge-msg: use branch.$name.description
2011-10-07 13:10:21 -07:00
Junio C Hamano
898eacd8ad fmt-merge-msg: use branch.$name.description
This teaches "merge --log" and fmt-merge-msg to use branch description
information when merging a local topic branch into the mainline. The
description goes between the branch name label and the list of commit
titles.

The refactoring to share the common configuration parsing between
merge and fmt-merge-msg needs to be made into a separate patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-07 10:11:47 -07:00
Junio C Hamano
891b8b6e51 Merge branch 'ph/transport-with-gitfile' into next
* ph/transport-with-gitfile:
  Add test showing git-fetch groks gitfiles
  Teach transport about the gitfile mechanism
  Learn to handle gitfiles in enter_repo
  enter_repo: do not modify input
2011-10-06 15:42:04 -07:00
Junio C Hamano
998462b832 Merge branch 'rs/pending' into next
* rs/pending:
  commit: factor out clear_commit_marks_for_object_array
  checkout: use leak_pending flag
  bundle: use leak_pending flag
  bisect: use leak_pending flag
  revision: add leak_pending flag
  checkout: use add_pending_{object,sha1} in orphan check
  revision: factor out add_pending_sha1
  checkout: check for "Previous HEAD" notice in t2020

Conflicts:
	builtin/checkout.c
	revision.c
2011-10-06 15:42:04 -07:00
Junio C Hamano
46851fe105 Merge branch 'cb/do-not-pretend-to-hijack-long-help' into next
* cb/do-not-pretend-to-hijack-long-help:
  use -h for synopsis and --help for manpage consistently
2011-10-06 15:42:03 -07:00
Junio C Hamano
de8f6f2f1f Merge branch 'js/log-show-children' into next
* js/log-show-children:
  log --children
2011-10-06 15:42:03 -07:00
Junio C Hamano
91f035fe99 Merge branch 'rs/diff-cleanup-records-fix' into next
* rs/diff-cleanup-records-fix:
  diff: resurrect XDF_NEED_MINIMAL with --minimal
  Revert removal of multi-match discard heuristic in 27af01
2011-10-06 15:42:02 -07:00
Junio C Hamano
b8c26d2549 Merge branch 'rs/test-ctype' into next
* rs/test-ctype:
  test-ctype: add test for is_pathspec_magic
  test-ctype: macrofy
2011-10-06 15:42:02 -07:00
Junio C Hamano
e51878e5e1 Merge branch 'rs/name-rev-usage' into next
* rs/name-rev-usage:
  name-rev: split usage string
2011-10-06 15:42:02 -07:00
Junio C Hamano
3d8567417d Merge branch 'jn/no-g-plus-s-on-bsd' into next
* jn/no-g-plus-s-on-bsd:
  Makefile: do not set setgid bit on directories on GNU/kFreeBSD
2011-10-06 15:42:02 -07:00
Junio C Hamano
a68770d8f0 Merge branch 'jn/ident-from-etc-mailname' into next
* jn/ident-from-etc-mailname:
  ident: do not retrieve default ident when unnecessary
  ident: check /etc/mailname if email is unknown
2011-10-06 15:42:02 -07:00
Junio C Hamano
d6c6741b2d Merge branch 'jc/is-url-simplify' into next
* jc/is-url-simplify:
  url.c: simplify is_url()
2011-10-06 15:42:01 -07:00
Junio C Hamano
209126d108 Merge branch 'nd/git-daemon-error-msgs' into next
* nd/git-daemon-error-msgs:
  daemon: return "access denied" if a service is not allowed
2011-10-06 15:42:01 -07:00
Junio C Hamano
0c5f5d073e Merge branch 'nd/document-err-packet' into next
* nd/document-err-packet:
  pack-protocol: document "ERR" line
2011-10-06 15:42:01 -07:00
Junio C Hamano
5f3630f46e Merge branch 'nd/daemon-log-sock-errors' into next
* nd/daemon-log-sock-errors:
  daemon: log errors if we could not use some sockets
2011-10-06 15:42:00 -07:00
Junio C Hamano
7e3083f3fe Merge branch 'il/archive-err-signal' into next
* il/archive-err-signal:
  Support ERR in remote archive like in fetch/push
2011-10-06 15:42:00 -07:00
Junio C Hamano
da42ad07ec Merge branch 'cp/git-web-browse-browsers' into next
* cp/git-web-browse-browsers:
  git-web--browse: avoid the use of eval
2011-10-06 15:42:00 -07:00
Junio C Hamano
b16cffe149 Merge branch 'jc/grep-untracked-exclude' into next
* jc/grep-untracked-exclude:
  grep: teach --untracked and --exclude-standard options
2011-10-06 15:41:59 -07:00
Junio C Hamano
69fe65d498 Merge branch 'jp/get-ref-dir-unsorted' into next
* jp/get-ref-dir-unsorted:
  refs: Use binary search to lookup refs faster
  Don't sort ref_list too early

Conflicts:
	refs.c
2011-10-06 15:41:59 -07:00
Junio C Hamano
33ac777f10 Merge branch 'ph/push-to-delete-nothing' into next
* ph/push-to-delete-nothing:
  receive-pack: don't pass non-existent refs to post-{receive,update} hooks

Conflicts:
	builtin/receive-pack.c
2011-10-06 15:41:59 -07:00
Junio C Hamano
64061aaf7f Merge branch 'jc/checkout-from-tree-keep-local-changes' into next
* jc/checkout-from-tree-keep-local-changes:
  checkout $tree $path: do not clobber local changes in $path not in $tree
2011-10-06 15:41:58 -07:00
Junio C Hamano
93c00f0373 Merge branch 'cs/perl-config-path-send-email' into next
* cs/perl-config-path-send-email:
  use new Git::config_path() for aliasesfile
  Add Git::config_path()
2011-10-06 15:41:58 -07:00
Junio C Hamano
78b31cdd9e Merge branch 'zj/send-email-authen-sasl' into next
* zj/send-email-authen-sasl:
  send-email: auth plain/login fix
2011-10-06 15:41:58 -07:00
Junio C Hamano
dd4936cc3f Merge branch 'jc/parse-options-boolean' into next
* jc/parse-options-boolean:
  apply: use OPT_NOOP_NOARG
  revert: use OPT_NOOP_NOARG
  parseopt: add OPT_NOOP_NOARG
  archive.c: use OPT_BOOL()
  parse-options: deprecate OPT_BOOLEAN

Conflicts:
	builtin/revert.c
2011-10-06 15:41:57 -07:00
Junio C Hamano
76e90c3381 Merge branch 'dm/tree-walk' into next
* dm/tree-walk:
  tree-walk: micro-optimization in tree_entry_interesting
  tree-walk: drop unused parameter from match_dir_prefix
2011-10-06 15:41:57 -07:00
Junio C Hamano
9236f5e71f Merge branch 'ps/gitweb-js-with-lineno' into next
* ps/gitweb-js-with-lineno:
  gitweb: Fix links to lines in blobs when javascript-actions are enabled
2011-10-06 15:41:57 -07:00
Junio C Hamano
0af69bb8f1 Merge branch 'mh/maint-notes-merge-pathbuf-fix' into next
* mh/maint-notes-merge-pathbuf-fix:
  notes_merge_commit(): do not pass temporary buffer to other function
2011-10-06 15:41:56 -07:00
Junio C Hamano
f6b8355f7f Merge branch 'nd/sparse-doc' into next
* nd/sparse-doc:
  git-read-tree.txt: update sparse checkout examples
2011-10-06 15:41:56 -07:00
Junio C Hamano
a9dfd8fb8a Merge branch 'jc/apply-blank-at-eof-fix' into next
* jc/apply-blank-at-eof-fix:
  apply --whitespace=error: correctly report new blank lines at end
2011-10-06 15:41:56 -07:00
Junio C Hamano
3a01ef1b55 Merge branch 'di/fast-import-empty-tag-note-fix' into next
* di/fast-import-empty-tag-note-fix:
  fast-import: don't allow to note on empty branch
  fast-import: don't allow to tag empty branch
2011-10-06 15:41:55 -07:00
Junio C Hamano
fa5e0fe777 Merge branch 'jc/request-pull-show-head-4' into next
* jc/request-pull-show-head-4:
  request-pull: use the branch description
  request-pull: state what commit to expect
  request-pull: modernize style
  branch: teach --edit-description option
  format-patch: use branch description in cover letter
  branch: add read_branch_desc() helper function

Conflicts:
	builtin/branch.c
2011-10-06 15:41:55 -07:00
Junio C Hamano
c2774985d8 Merge branch 'mh/check-ref-format-3' into next
* mh/check-ref-format-3: (23 commits)
  add_ref(): verify that the refname is formatted correctly
  resolve_ref(): expand documentation
  resolve_ref(): also treat a too-long SHA1 as invalid
  resolve_ref(): emit warnings for improperly-formatted references
  resolve_ref(): verify that the input refname has the right format
  remote: avoid passing NULL to read_ref()
  remote: use xstrdup() instead of strdup()
  resolve_ref(): do not follow incorrectly-formatted symbolic refs
  resolve_ref(): extract a function get_packed_ref()
  resolve_ref(): turn buffer into a proper string as soon as possible
  resolve_ref(): only follow a symlink that contains a valid, normalized refname
  resolve_ref(): use prefixcmp()
  resolve_ref(): explicitly fail if a symlink is not readable
  Change check_refname_format() to reject unnormalized refnames
  Inline function refname_format_print()
  Make collapse_slashes() allocate memory for its result
  Do not allow ".lock" at the end of any refname component
  Refactor check_refname_format()
  Change check_ref_format() to take a flags argument
  Change bad_ref_char() to return a boolean value
  ...
2011-10-06 15:41:54 -07:00
Junio C Hamano
c083e6915d Merge branch 'nd/maint-autofix-tag-in-head' into next
* nd/maint-autofix-tag-in-head:
  Accept tags in HEAD or MERGE_HEAD
  merge: remove global variable head[]
  merge: use return value of resolve_ref() to determine if HEAD is invalid
  merge: keep stash[] a local variable

Conflicts:
	builtin/merge.c
2011-10-06 15:41:54 -07:00
Junio C Hamano
e3cbb90185 Merge branch 'nd/maint-sparse-errors' into next
* nd/maint-sparse-errors:
  Add explanation why we do not allow to sparse checkout to empty working tree
  sparse checkout: show error messages when worktree shaping fails
2011-10-06 15:41:54 -07:00
Junio C Hamano
325270b0a6 Merge branch 'bw/grep-no-index-no-exclude' into next
* bw/grep-no-index-no-exclude:
  grep --no-index: don't use git standard exclusions
  grep: do not use --index in the short usage output
2011-10-06 15:41:53 -07:00
Junio C Hamano
0354e94b6b Merge branch 'js/bisect-no-checkout' into next
* js/bisect-no-checkout:
  bisect: fix exiting when checkout failed in bisect_start()
2011-10-06 15:41:53 -07:00
Junio C Hamano
02f99826d9 Merge branch 'sp/smart-http-failure' into next
* sp/smart-http-failure:
  remote-curl: Fix warning after HTTP failure
2011-10-06 15:41:53 -07:00
Junio C Hamano
c7a33e5ffe Merge branch 'mh/iterate-refs' into next
* mh/iterate-refs:
  refs.c: make create_cached_refs() static
  Retain caches of submodule refs
  Store the submodule name in struct cached_refs
  Allocate cached_refs objects dynamically
  Change the signature of read_packed_refs()
  Access reference caches only through new function get_cached_refs()
  Extract a function clear_cached_refs()
2011-10-06 15:41:52 -07:00
Junio C Hamano
b8e830fdb1 Merge branch 'jm/mergetool-pathspec' into next
* jm/mergetool-pathspec:
  mergetool: no longer need to save standard input
  mergetool: Use args as pathspec to unmerged files
2011-10-06 15:41:52 -07:00
Junio C Hamano
36c972d2e3 Merge branch 'jc/maint-diffstat-numstat-context' into next
* jc/maint-diffstat-numstat-context:
  diff: teach --stat/--numstat to honor -U$num
2011-10-06 15:41:52 -07:00
Junio C Hamano
96db20de26 Merge branch 'mz/remote-rename' into next
* mz/remote-rename:
  remote: only update remote-tracking branch if updating refspec
  remote rename: warn when refspec was not updated
  remote: "rename o foo" should not rename ref "origin/bar"
  remote: write correct fetch spec when renaming remote 'remote'
2011-10-06 15:41:52 -07:00
Junio C Hamano
8349bca15d Merge branch 'cb/common-prefix-unification' into next
* cb/common-prefix-unification:
  rename pathspec_prefix() to common_prefix() and move to dir.[ch]
  consolidate pathspec_prefix and common_prefix
  remove prefix argument from pathspec_prefix
2011-10-06 15:41:51 -07:00