1
0
mirror of https://github.com/git/git.git synced 2024-10-20 23:58:49 +02:00
Commit Graph

800 Commits

Author SHA1 Message Date
Junio C Hamano
f23101bf9f merge: reword the final message
Ever since the merge command was made multi-strategy aware, we said

    Merge made by octopus.

at the end of a session.  Reword it to

    Merge made by the 'octopus' strategy.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-25 13:34:17 -07:00
Junio C Hamano
3c0ae619e6 Merge branch 'ms/ls-remote-exit-with-status'
* ms/ls-remote-exit-with-status:
  ls-remote: the --exit-code option reports "no matching refs"
2011-05-23 10:27:08 -07:00
Junio C Hamano
6bb696c304 Merge branch 'mg/config-symbolic-constants'
* mg/config-symbolic-constants:
  config: Give error message when not changing a multivar
  config: define and document exit codes
2011-05-23 09:59:05 -07:00
Junio C Hamano
be5ab43566 Merge branch 'jc/magic-pathspec'
* jc/magic-pathspec:
  setup.c: Fix some "symbol not declared" sparse warnings
  t3703: Skip tests using directory name ":" on Windows
  revision.c: leave a note for "a lone :" enhancement
  t3703, t4208: add test cases for magic pathspec
  rev/path disambiguation: further restrict "misspelled index entry" diag
  fix overslow :/no-such-string-ever-existed diagnostics
  fix overstrict :<path> diagnosis
  grep: use get_pathspec() correctly
  pathspec: drop "lone : means no pathspec" from get_pathspec()
  Revert "magic pathspec: add ":(icase)path" to match case insensitively"
  magic pathspec: add ":(icase)path" to match case insensitively
  magic pathspec: futureproof shorthand form
  magic pathspec: add tentative ":/path/from/top/level" pathspec support
2011-05-23 09:58:35 -07:00
Junio C Hamano
b7aba2ef34 Merge branch 'jk/blame-line-porcelain'
* jk/blame-line-porcelain:
  blame: add --line-porcelain output format
  blame: refactor porcelain output
  add tests for various blame formats
2011-05-23 09:58:31 -07:00
Junio C Hamano
61d7503da1 Merge branch 'jc/replacing'
* jc/replacing:
  read_sha1_file(): allow selective bypassing of replacement mechanism
  inline lookup_replace_object() calls
  read_sha1_file(): get rid of read_sha1_file_repl() madness
  t6050: make sure we test not just commit replacement
  Declare lookup_replace_object() in cache.h, not in commit.h

Conflicts:
	environment.c
2011-05-19 20:37:21 -07:00
Junio C Hamano
8697083e1d Merge branch 'ms/tagname-does-not-begin-with-dash'
* ms/tagname-does-not-begin-with-dash:
  tag: disallow '-' as tag name
2011-05-19 20:37:20 -07:00
Junio C Hamano
a66fae3827 Merge branch 'jk/git-connection-deadlock-fix'
* jk/git-connection-deadlock-fix:
  test core.gitproxy configuration
  send-pack: avoid deadlock on git:// push with failed pack-objects
  connect: let callers know if connection is a socket
  connect: treat generic proxy processes like ssh processes

Conflicts:
	connect.c
2011-05-19 20:37:20 -07:00
Junio C Hamano
5c359a6658 Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'
* js/maint-send-pack-stateless-rpc-deadlock-fix:
  sideband_demux(): fix decl-after-stmt
2011-05-19 20:37:19 -07:00
Junio C Hamano
6699c959ef Merge branch 'jk/cherry-pick-root-with-resolve'
* jk/cherry-pick-root-with-resolve:
  t3503: test cherry picking and reverting root commits
  revert: allow reverting a root commit
  cherry-pick: handle root commits with external strategies
2011-05-19 20:37:19 -07:00
Michael Schubert
a87247731e ls-remote: the --exit-code option reports "no matching refs"
The "git ls-remote" uses its exit status to indicate if it successfully
talked with the remote repository. A new option "--exit-code" makes the
command exit with status "2" when there is no refs to be listed, even when
the command successfully talked with the remote repository.

This way, the caller can tell if we failed to contact the remote, or the
remote did not have what we wanted to see. Of course, you can inspect the
output from the command, which has been and will continue to be a valid
way to check the same thing.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-18 14:37:46 -07:00
Michael J Gruber
5a2df368c2 config: Give error message when not changing a multivar
When trying to set a multivar with "git config var value", "git config"
issues

warning: remote.repoor.push has multiple values

leaving the user under the impression that the operation succeeded,
unless one checks the return value.

Instead, make it

warning: remote.repoor.push has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --set-all to change remote.repoor.push.

to be clear and helpful.

Note: The "warning" is raised through other code paths also so that it
needs to remain a warning for these (which do not raise the error). Only
the caller can determine how to go on from that.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-17 21:01:29 -07:00
Junio C Hamano
7a77754cf6 Merge branch 'ci/commit--interactive-atomic'
* ci/commit--interactive-atomic:
  Test atomic git-commit --interactive
  Add commit to list of config.singlekey commands
  Add support for -p/--patch to git-commit
  Allow git commit --interactive with paths
  t7501.8: feed a meaningful command
  Use a temporary index for git commit --interactive
2011-05-16 16:47:10 -07:00
Junio C Hamano
36a45b4fa4 Merge branch 'mg/merge-ff-config'
* mg/merge-ff-config:
  tests: check git does not barf on merge.ff values for future versions of git
  merge: introduce merge.ff configuration variable

Conflicts:
	t/t7600-merge.sh
2011-05-16 16:46:23 -07:00
Jeff King
fad2652673 revert: allow reverting a root commit
Although it is probably an uncommon operation, there is no
reason to disallow it, as it works just fine. It is the
reverse of a cherry-pick of a root commit, which is already
allowed.

We do have to tweak one check on whether we have a merge
commit, which assumed we had at least one parent.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-16 13:01:45 -07:00
Jeff King
161807349a cherry-pick: handle root commits with external strategies
The merge-recursive strategy already handles root commits;
it cherry-picks the difference between the empty tree and
the root commit's tree.

However, for external strategies, we dereference NULL and
segfault while building the argument list. Instead, let's
handle this by passing the empty tree sha1 to the merge
script.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-16 13:00:30 -07:00
Junio C Hamano
06c0f42f94 Merge branch 'cn/format-patch-quiet' into maint
* cn/format-patch-quiet:
  format-patch: document --quiet option
  format-patch: don't pass on the --quiet flag
2011-05-15 16:10:49 -07:00
Junio C Hamano
4bbf5a2615 read_sha1_file(): get rid of read_sha1_file_repl() madness
Most callers want to silently get a replacement object, and they do not
care what the real name of the replacement object is.  Worse yet, no sane
interface to return the underlying object without replacement is provided.

Remove the function and make only the few callers that want the name of
the replacement object find it themselves.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-15 15:23:33 -07:00
Junio C Hamano
2f80de956f Merge branch 'maint'
* maint:
  add, merge, diff: do not use strcasecmp to compare config variable names
2011-05-14 20:44:09 -07:00
Jonathan Nieder
8c2be75fe1 add, merge, diff: do not use strcasecmp to compare config variable names
The config machinery already makes section and variable names
lowercase when parsing them, so using strcasecmp for comparison just
feels wasteful.  No noticeable change intended.

Noticed-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-14 18:53:39 -07:00
Junio C Hamano
e4ae6efb78 Merge branch 'bf/commit-template-no-cleanup'
* bf/commit-template-no-cleanup:
  Do not strip empty lines / trailing spaces from a commit message template
2011-05-13 11:03:08 -07:00
Junio C Hamano
ad29f71d53 Merge branch 'rr/rerere-libify-clear-gc'
* rr/rerere-libify-clear-gc:
  rerere: libify rerere_clear() and rerere_gc()
2011-05-13 11:02:40 -07:00
Junio C Hamano
e9c1a3a426 Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'
* js/maint-send-pack-stateless-rpc-deadlock-fix:
  send-pack: unbreak push over stateless rpc
  send-pack: avoid deadlock when pack-object dies early
2011-05-13 11:02:29 -07:00
Junio C Hamano
f7d59e2568 Merge branch 'jc/fix-add-u-unmerged'
* jc/fix-add-u-unmerged:
  Fix "add -u" that sometimes fails to resolve unmerged paths
2011-05-13 11:01:15 -07:00
Junio C Hamano
2f3e3f573d Merge branch 'cn/log-parse-opt'
* cn/log-parse-opt:
  log: convert to parse-options
2011-05-13 10:59:57 -07:00
Junio C Hamano
bc67ad8c37 Merge branch 'js/blame-parsename' into maint
* js/blame-parsename:
  t/annotate-tests: Use echo & cat instead of sed
  blame: tolerate bogus e-mail addresses a bit better
2011-05-13 10:45:00 -07:00
Junio C Hamano
c7fe5b61e1 Merge branch 'jc/maint-branch-mergeoptions'
* jc/maint-branch-mergeoptions:
  merge: make branch.<name>.mergeoptions correctly override merge.<option>

Conflicts:
	builtin/merge.c
2011-05-11 11:38:36 -07:00
Junio C Hamano
f3b173daf4 Merge branch 'jc/maint-add-p-overlapping-hunks'
* jc/maint-add-p-overlapping-hunks:
  t3701: add-p-fix makes the last test to pass
  "add -p": work-around an old laziness that does not coalesce hunks
  add--interactive.perl: factor out repeated --recount option
  t3701: Editing a split hunk in an "add -p" session
  add -p: 'q' should really quit
2011-05-11 11:37:46 -07:00
Boris Faure
8b1ae678a3 Do not strip empty lines / trailing spaces from a commit message template
Templates should be just that: A form that the user fills out, and forms
have blanks. If people are attached to not having extra whitespace in the
editor, they can simply clean up their templates.

Added test with editor adding even more whitespace.

Signed-off-by: Boris Faure <billiob@gmail.com>
Based-on-patch-by:Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-11 11:20:28 -07:00
Junio C Hamano
7c5f3cc4a5 grep: use get_pathspec() correctly
When there is no remaining string in argv, get_pathspec(prefix, argv)
will return a two-element array that has prefix as the first element,
so there is no need to re-roll that logic in the code that uses
get_pathspec().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-10 12:11:01 -07:00
Michael Schubert
4f0accd638 tag: disallow '-' as tag name
Disallow '-' as tag name, as well as tag names starting with '-', as it
would be cumbersome to "git checkout tags/-" because "git checkout -" is
to switch to the previous branch.

Add strbuf_check_tag_ref() as helper to check a refname for a tag.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-10 08:45:37 -07:00
Conrad Irwin
b4bd466820 Add support for -p/--patch to git-commit
The --interactive flag is already shared by git add and git commit,
share the -p and --patch flags too.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09 17:02:33 -07:00
Conrad Irwin
e41fcfe955 Allow git commit --interactive with paths
Make git commit --interactive feel more like git add --interactive by
allowing the user to restrict the list of files they have to deal with.

A test in t7501 used to ensure that this is not allowed; no need for that
anymore.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09 17:02:33 -07:00
Jeff King
ed747dd521 blame: add --line-porcelain output format
This is just like --porcelain, except that we always output
the commit information for each line, not just the first
time it is referenced. This can make quick and dirty scripts
much easier to write; see the example added to the blame
documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09 15:27:50 -07:00
Jeff King
e86226e340 blame: refactor porcelain output
This is in preparation for adding more porcelain output
options. The three changes are:

  1. emit_porcelain now receives the format option flags

  2. emit_one_suspect_detail takes an optional "repeat"
     parameter to suppress the "show only once" behavior

  3. The code for emitting porcelain suspect is factored
     into its own function for repeatability.

There should be no functional changes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-09 15:27:32 -07:00
Junio C Hamano
0f891e7d7e rerere: libify rerere_clear() and rerere_gc()
This moves the two features from builtin/rerere.c to a more library-ish
portion of the codebase.  No behaviour change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-08 12:55:34 -07:00
Conrad Irwin
1020d08786 Use a temporary index for git commit --interactive
Change the behaviour of git commit --interactive so that when you abort
the commit (by leaving the commit message empty) the index remains
unchanged.

Hitherto an aborted commit --interactive has added the selected hunks to
the index regardless of whether the commit succeeded or not.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-08 12:28:30 -07:00
Junio C Hamano
f23e8decd5 merge: introduce merge.ff configuration variable
This variable gives the default setting for --ff, --no-ff or --ff-only
options of "git merge" command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-06 15:12:30 -07:00
Junio C Hamano
541d1fa85c Merge branch 'jc/maint-branch-mergeoptions' into mg/merge-ff-config
* jc/maint-branch-mergeoptions:
  merge: make branch.<name>.mergeoptions correctly override merge.<option>
2011-05-06 15:10:36 -07:00
Junio C Hamano
2190a43c42 Merge branch 'js/blame-parsename'
* js/blame-parsename:
  t/annotate-tests: Use echo & cat instead of sed
  blame: tolerate bogus e-mail addresses a bit better
2011-05-06 10:50:32 -07:00
Junio C Hamano
1273738f05 Merge branch 'nd/struct-pathspec'
* nd/struct-pathspec:
  pathspec: rename per-item field has_wildcard to use_wildcard
  Improve tree_entry_interesting() handling code
  Convert read_tree{,_recursive} to support struct pathspec
  Reimplement read_tree_recursive() using tree_entry_interesting()
2011-05-06 10:50:06 -07:00
Junio C Hamano
117374fe3c Merge branch 'mg/rev-list-count-cherry'
* mg/rev-list-count-cherry:
  rev-list --count: separate count for --cherry-mark
2011-05-04 15:51:53 -07:00
Junio C Hamano
014d298b1d Merge branch 'vr/merge-base-doc'
* vr/merge-base-doc:
  Restructure documentation for git-merge-base.
  Documentation: update to git-merge-base --octopus
2011-05-04 15:51:37 -07:00
Junio C Hamano
f28d2e33c6 Merge branch 'jc/pack-objects-bigfile' into maint
* jc/pack-objects-bigfile:
  Teach core.bigfilethreashold to pack-objects
2011-05-04 14:57:38 -07:00
Junio C Hamano
f6bfe76714 Merge branch 'mg/reflog-with-options' into maint
* mg/reflog-with-options:
  reflog: fix overriding of command line options
  t/t1411: test reflog with formats
  builtin/log.c: separate default and setup of cmd_log_init()
2011-05-04 14:57:33 -07:00
Junio C Hamano
23f536cf62 Merge branch 'jk/notes-ui-updates'
* jk/notes-ui-updates:
  contrib/completion: --notes, --no-notes
  log/pretty-options: Document --[no-]notes and deprecate old notes options
  revision.c: make --no-notes reset --notes list
  revision.c: support --notes command-line option
  notes: refactor display notes default handling
  notes: refactor display notes extra refs field
  revision.c: refactor notes ref expansion
  notes: make expand_notes_ref globally accessible
2011-05-02 15:58:50 -07:00
Junio C Hamano
a75c3523d3 Merge branch 'ab/i18n-fixup'
* ab/i18n-fixup: (24 commits)
  i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
  i18n: use test_i18n{grep,cmp} in t7508
  i18n: use test_i18ngrep in t7506
  i18n: use test_i18ngrep and test_i18ncmp in t7502
  i18n: use test_i18ngrep in t7501
  i18n: use test_i18ncmp in t7500
  i18n: use test_i18ngrep in t7201
  i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110
  i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060
  i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014
  i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507
  i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200
  i18n: use test_i18ngrep in lib-httpd and t2019
  i18n: do not overuse C_LOCALE_OUTPUT (grep)
  i18n: use test_i18ncmp in t1200 and t2200
  i18n: .git file is not a human readable message (t5601)
  i18n: do not overuse C_LOCALE_OUTPUT
  i18n: mark init-db messages for translation
  i18n: mark checkout plural warning for translation
  i18n: mark checkout --detach messages for translation
  ...
2011-05-02 15:58:40 -07:00
Junio C Hamano
2d23c64ba2 Merge branch 'jh/notes-add-ui'
* jh/notes-add-ui:
  Make "git notes add" more user-friendly when there are existing notes

Conflicts:
	builtin/notes.c
2011-05-02 15:58:32 -07:00
Junio C Hamano
933e44d3a0 "add -p": work-around an old laziness that does not coalesce hunks
Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),
"git add--interactive" behaves lazily and passes overlapping hunks to the
underlying "git apply" without coalescing.  This was partially corrected
by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are
still passed when the patch is edited.

Teach "git apply" the --allow-overlap option that disables a safety
feature that avoids misapplication of patches by not applying patches
to overlapping hunks, and pass this option form "add -p" codepath.

Do not even advertise the option, as this is merely a workaround, and the
correct fix is to make "add -p" correctly coalesce adjacent patch hunks.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 15:27:59 -07:00
Josh Stone
9b01f0038b blame: tolerate bogus e-mail addresses a bit better
The names and e-mails are sanitized by fmt_ident() when creating commits,
so that they do not contain "<" nor ">", and the "committer" and "author"
lines in the commit object will always be in the form:

    ("author" | "committer") name SP "<" email ">" SP timestamp SP zone

When parsing the email part out, the current code looks for SP starting
from the end of the email part, but the author could obfuscate the address
as "author at example dot com".

We should instead look for SP followed by "<", to match the logic of the
side that formats these lines.

Signed-off-by: Josh Stone <jistone@redhat.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 11:09:42 -07:00