1
0
mirror of https://github.com/git/git.git synced 2024-10-23 13:19:24 +02:00
Commit Graph

1332 Commits

Author SHA1 Message Date
Clemens Buchacher
c207e34f77 fix push --quiet: add 'quiet' capability to receive-pack
Currently, git push --quiet produces some non-error output, e.g.:

 $ git push --quiet
 Unpacking objects: 100% (3/3), done.

This fixes a bug reported for the fedora git package:

 https://bugzilla.redhat.com/show_bug.cgi?id=725593

Reported-by: Jesse Keating <jkeating@redhat.com>
Cc: Todd Zullinger <tmz@pobox.com>

Commit 90a6c7d4 (propagate --quiet to send-pack/receive-pack)
introduced the --quiet option to receive-pack and made send-pack
pass that option. Older versions of receive-pack do not recognize
the option, however, and terminate immediately. The commit was
therefore reverted.

This change instead adds a 'quiet' capability to receive-pack,
which is a backwards compatible.

In addition, this fixes push --quiet via http: A verbosity of 0
means quiet for remote helpers.

Reported-by: Tobias Ulmer <tobiasu@tmux.org>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-08 14:27:28 -08:00
Junio C Hamano
f47182c852 server_supports(): parse feature list more carefully
We have been carefully choosing feature names used in the protocol
extensions so that the vocabulary does not contain a word that is a
substring of another word, so it is not a real problem, but we have
recently added "quiet" feature word, which would mean we cannot later
add some other word with "quiet" (e.g. "quiet-push"), which is awkward.

Let's make sure that we can eventually be able to do so by teaching the
clients and servers that feature words consist of non whitespace
letters. This parser also allows us to later add features with parameters
e.g. "feature=1.5" (parameter values need to be quoted for whitespaces,
but we will worry about the detauls when we do introduce them).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-08 14:26:28 -08:00
Junio C Hamano
5de89d3abf Merge branch 'jc/show-sig'
* jc/show-sig:
  log --show-signature: reword the common two-head merge case
  log-tree: show mergetag in log --show-signature output
  log-tree.c: small refactor in show_signature()
  commit --amend -S: strip existing gpgsig headers
  verify_signed_buffer: fix stale comment
  gpg-interface: allow use of a custom GPG binary
  pretty: %G[?GS] placeholders
  test "commit -S" and "log --show-signature"
  log: --show-signature
  commit: teach --gpg-sign option

Conflicts:
	builtin/commit-tree.c
	builtin/commit.c
	builtin/merge.c
	notes-cache.c
	pretty.c
2012-01-06 12:44:07 -08:00
Junio C Hamano
1067f8dd0e Merge branch 'jh/fetch-head-update'
* jh/fetch-head-update:
  write first for-merge ref to FETCH_HEAD first
2012-01-06 12:44:01 -08:00
Junio C Hamano
c871a1d17b commit --amend -S: strip existing gpgsig headers
Any existing commit signature was made against the contents of the old
commit, including its committer date that is about to change, and will
become invalid by amending it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-05 13:02:26 -08:00
Junio C Hamano
9d3d78435f Merge branch 'jc/signed-commit' and 'jc/pull-signed-tag'
They both use the extended headers in commit objects, and the former has
necessary infrastructure to show them that is useful to view the result of
the latter.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-05 11:00:49 -08:00
Joey Hess
96890f4c42 write first for-merge ref to FETCH_HEAD first
The FETCH_HEAD refname is supposed to refer to the ref that was fetched
and should be merged. However all fetched refs are written to
.git/FETCH_HEAD in an arbitrary order, and resolve_ref_unsafe simply
takes the first ref as the FETCH_HEAD, which is often the wrong one,
when other branches were also fetched.

The solution is to write the for-merge ref(s) to FETCH_HEAD first.
Then, unless --append is used, the FETCH_HEAD refname behaves as intended.
If the user uses --append, they presumably are doing so in order to
preserve the old FETCH_HEAD.

While we are at it, update an old example in the read-tree documentation
that implied that each entry in FETCH_HEAD only has the object name, which
is not true for quite a while.

[jc: adjusted tests]

Signed-off-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-03 16:13:14 -08:00
Junio C Hamano
48de6569eb Sync with 1.7.8.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-28 12:04:25 -08:00
Junio C Hamano
9a8e485430 Merge branch 'jv/maint-config-set' into maint
* jv/maint-config-set:
  Fix an incorrect reference to --set-all.
2011-12-28 12:03:19 -08:00
Junio C Hamano
9b0b0b4f45 Merge branch 'jc/checkout-m-twoway' into maint
* jc/checkout-m-twoway:
  t/t2023-checkout-m.sh: fix use of test_must_fail
  checkout_merged(): squelch false warning from some gcc
  Test 'checkout -m -- path'
  checkout -m: no need to insist on having all 3 stages
2011-12-28 11:44:54 -08:00
Junio C Hamano
b42e81afe2 Merge branch 'jk/maint-strbuf-missing-init' into maint
* jk/maint-strbuf-missing-init:
  commit, merge: initialize static strbuf
2011-12-28 11:42:46 -08:00
Junio C Hamano
770dd00ebd Merge branch 'jn/maint-sequencer-fixes' into maint
* jn/maint-sequencer-fixes:
  revert: stop creating and removing sequencer-old directory
  Revert "reset: Make reset remove the sequencer state"
  revert: do not remove state until sequence is finished
  revert: allow single-pick in the middle of cherry-pick sequence
  revert: pass around rev-list args in already-parsed form
  revert: allow cherry-pick --continue to commit before resuming
  revert: give --continue handling its own function
2011-12-28 11:32:39 -08:00
Junio C Hamano
699eb54876 Merge branch 'jk/maint-mv' into maint
* jk/maint-mv:
  mv: be quiet about overwriting
  mv: improve overwrite warning
  mv: make non-directory destination error more clear
  mv: honor --verbose flag
  docs: mention "-k" for both forms of "git mv"
2011-12-28 11:32:36 -08:00
Junio C Hamano
7a5638a159 Merge branch 'jk/fetch-no-tail-match-refs' into maint
* jk/fetch-no-tail-match-refs:
  connect.c: drop path_match function
  fetch-pack: match refs exactly
  t5500: give fully-qualified refs to fetch-pack
  drop "match" parameter from get_remote_heads
2011-12-28 11:32:36 -08:00
Junio C Hamano
474294963e Merge branch 'ci/stripspace-docs' into maint
* ci/stripspace-docs:
  Update documentation for stripspace
2011-12-28 11:32:35 -08:00
Junio C Hamano
79587741cb Merge branch 'jn/branch-move-to-self' into maint
* jn/branch-move-to-self:
  Allow checkout -B <current-branch> to update the current branch
  branch: allow a no-op "branch -M <current-branch> HEAD"
2011-12-28 11:32:33 -08:00
Jelmer Vernooij
67e223edc4 Fix an incorrect reference to --set-all.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-27 11:14:18 -08:00
Junio C Hamano
35726681d5 Merge branch 'ab/sun-studio-portability'
* ab/sun-studio-portability:
  Appease Sun Studio by renaming "tmpfile"
  Fix a bitwise negation assignment issue spotted by Sun Studio
  Fix an enum assignment issue spotted by Sun Studio
2011-12-22 15:30:33 -08:00
Junio C Hamano
c0129439d0 Merge branch 'rr/revert-cherry-pick'
* rr/revert-cherry-pick:
  t3502, t3510: clarify cherry-pick -m failure
  t3510 (cherry-pick-sequencer): use exit status
  revert: simplify getting commit subject in format_todo()
  revert: tolerate extra spaces, tabs in insn sheet
  revert: make commit subjects in insn sheet optional
  revert: free msg in format_todo()
2011-12-22 15:30:22 -08:00
Junio C Hamano
1aea303d7e Merge branch 'jk/maint-strbuf-missing-init'
* jk/maint-strbuf-missing-init:
  commit, merge: initialize static strbuf

Conflicts:
	builtin/merge.c
2011-12-22 11:27:31 -08:00
Junio C Hamano
e927c16751 Merge branch 'rs/diff-tree-combined-clean-up'
* rs/diff-tree-combined-clean-up:
  submodule: use diff_tree_combined_merge() instead of diff_tree_combined()
  pass struct commit to diff_tree_combined_merge()
  use struct sha1_array in diff_tree_combined()
2011-12-22 11:27:29 -08:00
Junio C Hamano
ced7469f07 Merge branch 'tr/grep-threading'
* tr/grep-threading:
  grep: disable threading in non-worktree case
  grep: enable threading with -p and -W using lazy attribute lookup
  grep: load funcname patterns for -W
2011-12-22 11:27:28 -08:00
Junio C Hamano
f35ccd9be2 Merge branch 'nd/war-on-nul-in-commit'
* nd/war-on-nul-in-commit:
  commit_tree(): refuse commit messages that contain NULs
  Convert commit_tree() to take strbuf as message
  merge: abort if fails to commit

Conflicts:
	builtin/commit.c
	commit.c
	commit.h
2011-12-22 11:27:26 -08:00
Junio C Hamano
e443bdfe1e Sync with v1.7.8.1 2011-12-21 12:02:44 -08:00
Junio C Hamano
406cc9b822 Merge branch 'bc/maint-apply-check-no-patch' into maint
* bc/maint-apply-check-no-patch:
  builtin/apply.c: report error on failure to recognize input
  t/t4131-apply-fake-ancestor.sh: fix broken test
2011-12-21 11:42:45 -08:00
Carlos Martín Nieto
a31275d6ff clone: the -o option has nothing to do with <branch>
It is to give an alternate <name> instead of "origin" to the remote
we are cloning from.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21 11:26:30 -08:00
Michael Schubert
967cf9867d builtin/log: remove redundant initialization
"abbrev" and "commit_format" in struct rev_info get initialized in
init_revisions - no need to reinit in cmd_log_init_defaults.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21 11:15:56 -08:00
Junio C Hamano
f1f509cc45 Merge branch 'ms/commit-cc-option-helpstring' into maint
* ms/commit-cc-option-helpstring:
  builtin/commit: add missing '/' in help message
2011-12-21 10:50:20 -08:00
Ævar Arnfjörð Bjarmason
ab1900a36e Appease Sun Studio by renaming "tmpfile"
On Solaris the system headers define the "tmpfile" name, which'll
cause Git compiled with Sun Studio 12 Update 1 to whine about us
redefining the name:

    "pack-write.c", line 76: warning: name redefined by pragma redefine_extname declared static: tmpfile     (E_PRAGMA_REDEFINE_STATIC)
    "sha1_file.c", line 2455: warning: name redefined by pragma redefine_extname declared static: tmpfile    (E_PRAGMA_REDEFINE_STATIC)
    "fast-import.c", line 858: warning: name redefined by pragma redefine_extname declared static: tmpfile   (E_PRAGMA_REDEFINE_STATIC)
    "builtin/index-pack.c", line 175: warning: name redefined by pragma redefine_extname declared static: tmpfile    (E_PRAGMA_REDEFINE_STATIC)

Just renaming the "tmpfile" variable to "tmp_file" in the relevant
places is the easiest way to fix this.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21 10:21:04 -08:00
Ævar Arnfjörð Bjarmason
d7a10c3140 Fix an enum assignment issue spotted by Sun Studio
In builtin/fast-export.c we'd assign to variables of the
tag_of_filtered_mode enum type with constants defined for the
signed_tag_mode enum.

We'd get the intended value since both the value we were assigning
with and the one we actually wanted had the same positional within
their respective enums, but doing it this way makes no sense.

This issue was spotted by Sun Studio 12 Update 1:

    "builtin/fast-export.c", line 54: warning: enum type mismatch: op "=" (E_ENUM_TYPE_MISMATCH_OP)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-21 10:19:04 -08:00
Junio C Hamano
3daff7c319 Merge branch 'maint'
* maint:
  builtin/init-db.c: eliminate -Wformat warning on Solaris
2011-12-20 16:34:20 -08:00
Ævar Arnfjörð Bjarmason
97f261b1e7 builtin/init-db.c: eliminate -Wformat warning on Solaris
On Solaris systems we'd warn about an implicit cast of mode_t when we
printed things out with the %d format. We'd get this warning under GCC
4.6.0 with Solaris headers:

    builtin/init-db.c: In function ‘separate_git_dir’:
    builtin/init-db.c:354:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘mode_t’ [-Wformat]

We've been doing this ever since v1.7.4.1-296-gb57fb80. Just work
around this by adding an explicit cast.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-20 16:02:08 -08:00
Junio C Hamano
4d466b69fe Merge branch 'jc/pull-signed-tag'
* jc/pull-signed-tag:
  commit: do not lose mergetag header when not amending
2011-12-20 13:24:12 -08:00
Junio C Hamano
0074d18dc0 commit: do not lose mergetag header when not amending
The earlier ed7a42a (commit: teach --amend to carry forward extra headers,
2011-11-08) broke "git merge/pull; edit to fix conflict; git commit"
workflow by forgetting that commit_tree_extended() takes the whole extra
header list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-20 13:22:41 -08:00
Junio C Hamano
7f1068e21e Merge branch 'jc/checkout-m-twoway'
* jc/checkout-m-twoway:
  checkout_merged(): squelch false warning from some gcc
  Test 'checkout -m -- path'
  checkout -m: no need to insist on having all 3 stages
2011-12-19 16:06:22 -08:00
Junio C Hamano
b3ae9d8e57 Merge branch 'jk/fetch-no-tail-match-refs'
* jk/fetch-no-tail-match-refs:
  connect.c: drop path_match function
  fetch-pack: match refs exactly
  t5500: give fully-qualified refs to fetch-pack
  drop "match" parameter from get_remote_heads
2011-12-19 16:05:55 -08:00
Junio C Hamano
2e05710a16 Merge branch 'nd/resolve-ref'
* nd/resolve-ref:
  Rename resolve_ref() to resolve_ref_unsafe()
  Convert resolve_ref+xstrdup to new resolve_refdup function
  revert: convert resolve_ref() to read_ref_full()
2011-12-19 16:05:50 -08:00
Junio C Hamano
b8fc5abd73 Merge branch 'jn/maint-sequencer-fixes'
* jn/maint-sequencer-fixes:
  revert: stop creating and removing sequencer-old directory
  Revert "reset: Make reset remove the sequencer state"
  revert: do not remove state until sequence is finished
  revert: allow single-pick in the middle of cherry-pick sequence
  revert: pass around rev-list args in already-parsed form
  revert: allow cherry-pick --continue to commit before resuming
  revert: give --continue handling its own function
2011-12-19 16:05:45 -08:00
Junio C Hamano
b052781fef Merge branch 'jk/maint-mv'
* jk/maint-mv:
  mv: be quiet about overwriting
  mv: improve overwrite warning
  mv: make non-directory destination error more clear
  mv: honor --verbose flag
  docs: mention "-k" for both forms of "git mv"
2011-12-19 16:05:34 -08:00
Junio C Hamano
ab2fadefab Merge branch 'ci/stripspace-docs'
* ci/stripspace-docs:
  Update documentation for stripspace
2011-12-19 16:05:31 -08:00
Junio C Hamano
33e7fefef6 Merge branch 'tr/cache-tree'
* tr/cache-tree:
  reset: update cache-tree data when appropriate
  commit: write cache-tree data when writing index anyway
  Refactor cache_tree_update idiom from commit
  Test the current state of the cache-tree optimization
  Add test-scrap-cache-tree
2011-12-19 16:05:20 -08:00
Junio C Hamano
03f94ae9f9 Update jk/maint-strbuf-missing-init to builtin/ rename 2011-12-18 00:28:16 -08:00
René Scharfe
0041f09de6 use struct sha1_array in diff_tree_combined()
Maintaining an array of hashes is easier using sha1_array than
open-coding it.  This patch also fixes a leak of the SHA1 array
in  diff_tree_combined_merge().

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-17 18:21:37 -08:00
Junio C Hamano
a2add8570c Merge branch 'jc/commit-amend-no-edit'
* jc/commit-amend-no-edit:
  test: commit --amend should honor --no-edit
  commit: honour --no-edit
  t7501 (commit): modernize style
  test: remove a porcelain test that hard-codes commit names
  test: add missing "&&" after echo command
2011-12-16 22:33:56 -08:00
Junio C Hamano
48b303675a Merge branch 'jc/stream-to-pack'
* jc/stream-to-pack:
  bulk-checkin: replace fast-import based implementation
  csum-file: introduce sha1file_checkpoint
  finish_tmp_packfile(): a helper function
  create_tmp_packfile(): a helper function
  write_pack_header(): a helper function

Conflicts:
	pack.h
2011-12-16 22:33:40 -08:00
Junio C Hamano
0bbaa5c076 Merge branch 'jk/upload-archive-use-start-command'
* jk/upload-archive-use-start-command:
  upload-archive: use start_command instead of fork
2011-12-16 22:33:30 -08:00
Thomas Rast
53b8d931b6 grep: disable threading in non-worktree case
Measurements by various people have shown that grepping in parallel is
not beneficial when the object store is involved.  For example, with a
simple regex:

  Threads     | --cached case            | worktree case
  ----------------------------------------------------------------
  8 (default) | 2.88u 0.21s 0:02.94real  | 0.19u 0.32s 0:00.16real
  4           | 2.89u 0.29s 0:02.99real  | 0.16u 0.34s 0:00.17real
  2           | 2.83u 0.36s 0:02.87real  | 0.18u 0.32s 0:00.26real
  NO_PTHREADS | 2.16u 0.08s 0:02.25real  | 0.12u 0.17s 0:00.31real

This happens because all the threads contend on read_sha1_mutex almost
all of the time.  A more complex regex allows the threads to do more
work in parallel, but as Jeff King found out, the "super boost" (much
higher clock when only one core is active) feature of recent CPUs
still causes the unthreaded case to win by a large margin.

So until the pack machinery allows unthreaded access, we disable
grep's threading in all but the worktree case.

Helped-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-16 15:47:25 -08:00
Thomas Rast
0579f91dd7 grep: enable threading with -p and -W using lazy attribute lookup
Lazily load the userdiff attributes in match_funcname().  Use a
separate mutex around this loading to protect the (not thread-safe)
attributes machinery.  This lets us re-enable threading with -p and
-W while reducing the overhead caused by looking up attributes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-16 15:47:10 -08:00
Ramkumar Ramachandra
9e1313648d revert: simplify getting commit subject in format_todo()
format_todo() calls get_message(), but uses only the subject line of
the commit message.  As a minor optimization, save work and
unnecessary memory allocations by using find_commit_subject() instead.
Also, remove the unnecessary check on cur->item->buffer: the
lookup_commit_reference() call in parse_insn_line() has already made
sure of this.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15 13:16:52 -08:00
Ramkumar Ramachandra
0db76962d1 revert: tolerate extra spaces, tabs in insn sheet
Tolerate extra spaces and tabs as part of the the field separator in
'.git/sequencer/todo', for people with fat fingers.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-15 13:15:46 -08:00