Commit graph

1104 commits

Author SHA1 Message Date
Johannes Schindelin 1ad7341d97 fixup! grep -I: do not bother to read known-binary files 2011-10-08 15:17:31 -05:00
Johannes Schindelin a3fc7b6164 Amend "git grep -O -i: if the pager is 'less', pass the '-i' option"
This change was left in the stash, for some reason. Squash this in with
the next rebasing merge.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:55:29 -05:00
Johannes Schindelin 81c5a08574 git grep -O -i: if the pager is 'less', pass the '-i' option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:55:29 -05:00
Johannes Schindelin 97adaf0310 grep -I: do not bother to read known-binary files
Incidentally, this makes grep -I respect the "binary" attribute (actually,
the "-text" attribute, but "binary" implies that).

Since the attributes are not thread-safe, we now need to switch off
threading if -I was passed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:55:27 -05:00
Johannes Schindelin 308f835490 Let deny.currentBranch=updateInstead ignore submodules
They are not affected by the update anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:55:27 -05:00
Johannes Schindelin 9369839d7d add -e: ignore dirty submodules
We cannot add untracked/modified files in submodules anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:55:26 -05:00
Erik Faye-Lund 9cc96c9646 config.c: trivial fix for compile-time warning
The warning ("builtin/config.c:351: warning: initialization
discards qualifiers from pointer target type") was introduced
in commit 6754497c.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:47:12 -05:00
Johannes Schindelin eb8fa8ca2c Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:38 -05:00
Johannes Schindelin f9ef98f9d3 Add a few more values for receive.denyCurrentBranch
For a long time, this developer thought that Git's insistence that
pushing into the current branch is evil was completely merited.

Just for fun, the original patch tried to show people that Git is right
there, and that it causes more trouble than it does good when Git allows
you to try to update the working tree for fast-forwards, or to detach the
HEAD, depending on some config settings.

Surprisingly, the opposite was shown.

So here is the support for two new options you can give the config
variable receive.denyCurrentBranch:

'updateInstead':
	Try to merge the working tree with the new tip of the branch
	(which can lead to really horrible merge conflicts).

'detachInstead':
	Detach the HEAD, thereby avoiding a disagreement between the
	HEAD and the index (as well as the working tree), possibly
	leaving the local user wondering how on earth her HEAD became
	so detached.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:37 -05:00
Erik Faye-Lund dab4396724 core.hidedotfiles: hide '.git' dir by default
At least for cross-platform projects, it makes sense to hide the
files starting with a dot, as this is the behavior on Unix/MacOSX.

However, at least Eclipse has problems interpreting the hidden flag
correctly, so the default is to hide only the .git/ directory.

The config setting core.hideDotFiles therefore supports not only
'true' and 'false', but also 'dotGitOnly'.

[jes: clarified the commit message, made git init respect the setting
by marking the .git/ directory only after reading the config, and added
documentation, and rebased on top of current junio/next]

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:34 -05: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 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 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 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 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 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 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 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 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 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
Junio C Hamano 3526bb9cde Merge branch 'fg/submodule-git-file-git-dir' into next
* fg/submodule-git-file-git-dir:
  Move git-dir for submodules
  rev-parse: add option --resolve-git-dir <path>

Conflicts:
	cache.h
	git-submodule.sh
2011-10-06 15:41:51 -07:00
Junio C Hamano b7200e8397 branch: teach --edit-description option
Using branch.$name.description as the configuration key, give users a
place to write about what the purpose of the branch is and things like
that, so that various subsystems, e.g. "push -s", "request-pull", and
"format-patch --cover-letter", can later be taught to use this
information.

The "-m" option similar to "commit/tag" is deliberately omitted, as the
whole point of branch description is about giving descriptive information
(the name of the branch itself is a better place for information that fits
on a single-line).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 14:51:26 -07:00
Junio C Hamano 739453a3fb format-patch: use branch description in cover letter
Use the description for the branch when preparing the cover letter
when available.

While at it, mark a loosely written codepath that would do a random and
useless thing given an unusual input (e.g. "^master HEAD HEAD^"), which
we may want to fix someday.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 14:50:46 -07:00
Michael Haggerty a40e6fb67a Change check_refname_format() to reject unnormalized refnames
Since much of the infrastructure does not work correctly with
unnormalized refnames, change check_refname_format() to reject them.

Similarly, change "git check-ref-format" to reject unnormalized
refnames by default.  But add an option --normalize, which causes "git
check-ref-format" to normalize the refname before checking its format,
and print the normalized refname.  This is exactly the behavior of the
old --print option, which is retained but deprecated.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 13:45:30 -07:00
Michael Haggerty a5e4ec063a Inline function refname_format_print()
Soon we will make printing independent of collapsing.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 13:45:30 -07:00
Michael Haggerty 7f748c7cb2 Make collapse_slashes() allocate memory for its result
This will make upcoming changes a tiny bit easier.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 13:45:30 -07:00
Michael Haggerty 8d9c50105f Change check_ref_format() to take a flags argument
Change check_ref_format() to take a flags argument that indicates what
is acceptable in the reference name (analogous to "git
check-ref-format"'s "--allow-onelevel" and "--refspec-pattern").  This
is more convenient for callers and also fixes a failure in the test
suite (and likely elsewhere in the code) by enabling "onelevel" and
"refspec-pattern" to be allowed independently of each other.

Also rename check_ref_format() to check_refname_format() to make it
obvious that it deals with refnames rather than references themselves.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 13:45:29 -07:00
Michael Haggerty e4ed6105ec git check-ref-format: add options --allow-onelevel and --refspec-pattern
Also add tests of the new options.  (Actually, one big reason to add
the new options is to make it easy to test check_ref_format(), though
the options should also be useful to other scripts.)

Interpret the result of check_ref_format() based on which types of
refnames are allowed.  However, because check_ref_format() can only
return a single value, one test case is still broken.  Specifically,
the case "git check-ref-format --onelevel '*'" incorrectly succeeds
because check_ref_format() returns CHECK_REF_FORMAT_ONELEVEL for this
refname even though the refname is also CHECK_REF_FORMAT_WILDCARD.
The type of check that leads to this failure is used elsewhere in
"real" code and could lead to bugs; it will be fixed over the next few
commits.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 13:45:29 -07:00
Junio C Hamano 83d6b33db6 Merge branch 'js/check-attr-cached'
* js/check-attr-cached:
  t0003: remove extra whitespaces
  Teach '--cached' option to check-attr
2011-10-05 12:36:27 -07:00
Junio C Hamano f52237576a Merge branch 'jc/ls-remote-short-help'
* jc/ls-remote-short-help:
  ls-remote: a lone "-h" is asking for help
2011-10-05 12:36:26 -07:00
Junio C Hamano 7a95d1be03 Merge branch 'jk/argv-array'
* jk/argv-array:
  run_hook: use argv_array API
  checkout: use argv_array API
  bisect: use argv_array API
  quote: provide sq_dequote_to_argv_array
  refactor argv_array into generic code
  quote.h: fix bogus comment
  add sha1_array API docs
2011-10-05 12:36:24 -07:00
Junio C Hamano 1077bf1ff6 Merge branch 'mg/branch-list'
* mg/branch-list:
  t3200: clean up checks for file existence
  branch: -v does not automatically imply --list
  branch: allow pattern arguments
  branch: introduce --list option
  git-branch: introduce missing long forms for the options
  git-tag: introduce long forms for the options
  t6040: test branch -vv

Conflicts:
	Documentation/git-tag.txt
	t/t3200-branch.sh
2011-10-05 12:36:23 -07:00
Junio C Hamano 4e20e36799 Merge branch 'jk/for-each-ref'
* jk/for-each-ref:
  for-each-ref: add split message parts to %(contents:*).
  for-each-ref: handle multiline subjects like --pretty
  for-each-ref: refactor subject and body placeholder parsing
  t6300: add more body-parsing tests
  t7004: factor out gpg setup
2011-10-05 12:36:22 -07:00
Junio C Hamano 7451aee8e5 Merge branch 'jc/run-receive-hook-cleanup'
* jc/run-receive-hook-cleanup:
  refactor run_receive_hook()
2011-10-05 12:36:22 -07:00
Junio C Hamano 6f62cd7ab1 Merge branch 'jc/receive-verify'
* jc/receive-verify:
  receive-pack: check connectivity before concluding "git push"
  check_everything_connected(): libify
  check_everything_connected(): refactor to use an iterator
  fetch: verify we have everything we need before updating our ref

Conflicts:
	builtin/fetch.c
2011-10-05 12:36:21 -07:00
Junio C Hamano 2e2e7e9dd0 Merge branch 'jc/fetch-verify'
* jc/fetch-verify:
  fetch: verify we have everything we need before updating our ref
  rev-list --verify-object
  list-objects: pass callback data to show_objects()
2011-10-05 12:36:20 -07:00
Junio C Hamano ca0c9764bf Merge branch 'jc/fetch-pack-fsck-objects'
* jc/fetch-pack-fsck-objects:
  test: fetch/receive with fsckobjects
  transfer.fsckobjects: unify fetch/receive.fsckobjects
  fetch.fsckobjects: verify downloaded objects

Conflicts:
	Documentation/config.txt
	builtin/fetch-pack.c
2011-10-05 12:36:20 -07:00
Junio C Hamano f817f2fbb5 Merge branch 'jc/traverse-commit-list'
* jc/traverse-commit-list:
  revision.c: update show_object_with_name() without using malloc()
  revision.c: add show_object_with_name() helper function
  rev-list: fix finish_object() call
2011-10-05 12:36:19 -07:00
Junio C Hamano cd4093b603 Merge branch 'rr/revert-cherry-pick-continue'
* rr/revert-cherry-pick-continue:
  builtin/revert.c: make commit_list_append() static
  revert: Propagate errors upwards from do_pick_commit
  revert: Introduce --continue to continue the operation
  revert: Don't implicitly stomp pending sequencer operation
  revert: Remove sequencer state when no commits are pending
  reset: Make reset remove the sequencer state
  revert: Introduce --reset to remove sequencer state
  revert: Make pick_commits functionally act on a commit list
  revert: Save command-line options for continuing operation
  revert: Save data for continuing after conflict resolution
  revert: Don't create invalid replay_opts in parse_args
  revert: Separate cmdline parsing from functional code
  revert: Introduce struct to keep command-line options
  revert: Eliminate global "commit" variable
  revert: Rename no_replay to record_origin
  revert: Don't check lone argument in get_encoding
  revert: Simplify and inline add_message_to_msg
  config: Introduce functions to write non-standard file
  advice: Introduce error_resolve_conflict
2011-10-05 12:36:19 -07:00
Junio C Hamano 75abfa62fb Merge branch 'ms/patch-id-with-overlong-line'
* ms/patch-id-with-overlong-line:
  patch-id.c: use strbuf instead of a fixed buffer
2011-10-05 12:35:55 -07:00
Junio C Hamano 9e3e789e70 Merge branch 'jc/maint-bundle-too-quiet'
* jc/maint-bundle-too-quiet:
  Teach progress eye-candy to fetch_refs_from_bundle()
2011-10-05 12:35:55 -07:00
Junio C Hamano c672f01c04 Merge branch 'jc/want-commit'
* jc/want-commit:
  Allow git merge ":/<pattern>"
2011-10-05 12:35:55 -07:00
Junio C Hamano e2b1405b94 Merge branch 'jc/maint-fsck-fwrite-size-check'
* jc/maint-fsck-fwrite-size-check:
  fsck: do not abort upon finding an empty blob
2011-10-05 12:35:54 -07:00
Junio C Hamano 00723b0291 Merge branch 'nm/grep-object-sha1-lock'
* nm/grep-object-sha1-lock:
  grep: Fix race condition in delta_base_cache

Conflicts:
	builtin/grep.c
2011-10-05 12:35:53 -07:00
Ilari Liusvaara 908aaceb92 Support ERR in remote archive like in fetch/push
Make ERR as first packet of remote snapshot reply work like it does in
fetch/push. Lets servers decline remote snapshot with message the same
way as declining fetch/push with a message.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-10-05 09:27:29 -07:00
Junio C Hamano dbfae86a7b Merge branch 'jc/maint-grep-untracked-exclude' into jc/grep-untracked-exclude
* jc/maint-grep-untracked-exclude:
  grep: teach --untracked and --exclude-standard options
  grep --no-index: don't use git standard exclusions
  grep: do not use --index in the short usage output

Conflicts:
	Documentation/git-grep.txt
	builtin/grep.c
2011-10-04 18:40:41 -07:00