1
0
mirror of https://github.com/git/git.git synced 2024-10-01 11:51:22 +02:00
Commit Graph

25348 Commits

Author SHA1 Message Date
Sylvain Rabot
a1dd7e16ad git-send-email: fix missing space in error message
When the command cannot make a connection to the SMTP server the error
message to diagnose the broken configuration is issued.  However, when an
optional smtp-server-port is given and needs to be reported, the message
lacked a space between "hello=<smtp-domain>" and "port=<smtp-server-port>".

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 11:34:32 -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
Mathias Lafeldt
c54e6be75a t/test-lib.sh: minor readability improvements
Apply parameter expansion. Also use here document to save
test results instead of appending each line with ">>".

Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 08:27:52 -07:00
Jim Meyering
dabdbee10b diffcore-rename.c: avoid set-but-not-used warning
Since 9d8a5a5 (diffcore-rename: refactor "too many candidates" logic,
2011-01-06), diffcore_rename() initializes num_src but does not use it
anymore.  "-Wunused-but-set-variable" in gcc-4.6 complains about this.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 08:20:10 -07:00
Junio C Hamano
50d3062ab2 Merge branch 'jc/diff-irreversible-delete'
* jc/diff-irreversible-delete:
  git diff -D: omit the preimage of deletes
2011-04-28 14:11:47 -07:00
Junio C Hamano
76a89d6d82 Merge branch 'jc/rename-degrade-cc-to-c'
* jc/rename-degrade-cc-to-c:
  diffcore-rename: fall back to -C when -C -C busts the rename limit
  diffcore-rename: record filepair for rename src
  diffcore-rename: refactor "too many candidates" logic
  builtin/diff.c: remove duplicated call to diff_result_code()
2011-04-28 14:11:43 -07:00
Junio C Hamano
78c6e0f3fa Merge branch 'mz/rebase'
* mz/rebase: (34 commits)
  rebase: define options in OPTIONS_SPEC
  Makefile: do not install sourced rebase scripts
  rebase: use @{upstream} if no upstream specified
  rebase -i: remove unnecessary state rebase-root
  rebase -i: don't read unused variable preserve_merges
  git-rebase--am: remove unnecessary --3way option
  rebase -m: don't print exit code 2 when merge fails
  rebase -m: remember allow_rerere_autoupdate option
  rebase: remember strategy and strategy options
  rebase: remember verbose option
  rebase: extract code for writing basic state
  rebase: factor out sub command handling
  rebase: make -v a tiny bit more verbose
  rebase -i: align variable names
  rebase: show consistent conflict resolution hint
  rebase: extract am code to new source file
  rebase: extract merge code to new source file
  rebase: remove $branch as synonym for $orig_head
  rebase -i: support --stat
  rebase: factor out call to pre-rebase hook
  ...
2011-04-28 14:11:39 -07:00
Junio C Hamano
ac9666f84a Merge branch 'en/merge-recursive'
* en/merge-recursive:
  merge-recursive: tweak magic band-aid
  merge-recursive: When we detect we can skip an update, actually skip it
  t6022: New test checking for unnecessary updates of files in D/F conflicts
  t6022: New test checking for unnecessary updates of renamed+modified files
2011-04-28 14:11:35 -07:00
Junio C Hamano
d98a509ec3 Merge branch 'jh/dirstat'
* jh/dirstat:
  --dirstat: In case of renames, use target filename instead of source filename
  Teach --dirstat not to completely ignore rearranged lines within a file
  --dirstat-by-file: Make it faster and more correct
  --dirstat: Describe non-obvious differences relative to --stat or regular diff
2011-04-28 14:11:19 -07:00
Junio C Hamano
11c3e2b7bd Merge branch 'sp/maint-clear-postfields'
* sp/maint-clear-postfields:
  http: clear POSTFIELDS when initializing a slot
2011-04-28 14:10:51 -07:00
Ingo Molnar
1a812f3a70 hashcmp(): inline memcmp() by hand to optimize
This is reported to speed "git gc" by 18%.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28 13:18:30 -07:00
Andrew Wong
c192f9c865 git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff
'git rebase' uses 'git merge' to preserve merges (-p).  This preserves
the original merge commit correctly, except when the original merge
commit was created by 'git merge --no-ff'.  In this case, 'git rebase'
will fail to preserve the merge, because during 'git rebase', 'git
merge' will simply fast-forward and skip the commit.  For example:

               B
              / \
             A---M
            /
    ---o---O---P---Q

If we try to rebase M onto P, we lose the merge commit and this happens:

                 A---B
                /
    ---o---O---P---Q

To correct this, we simply do a "no fast-forward" on all merge commits
when rebasing.  Since by the time we decided to do a 'git merge' inside
'git rebase', it means there was a merge originally, so 'git merge'
should always create a merge commit regardless of what the merge
branches look like. This way, when rebase M onto P from the above
example, we get:

                   B
                  / \
                 A---M
                /
    ---o---O---P---Q

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28 09:56:55 -07:00
SZEDER Gábor
da4902a730 completion: remove unnecessary _get_comp_words_by_ref() invocations
In v1.7.4-rc0~11^2~2 (bash: get --pretty=m<tab> completion to work
with bash v4, 2010-12-02) we started to use _get_comp_words_by_ref()
to access completion-related variables.  That was large change, and to
make it easily reviewable, we invoked _get_comp_words_by_ref() in each
completion function and systematically replaced every occurance of
bash's completion-related variables ($COMP_WORDS and $COMP_CWORD) with
variables set by _get_comp_words_by_ref().

This has the downside that _get_comp_words_by_ref() is invoked several
times during a single completion.  The worst offender is perhaps 'git
log mas<TAB>': during the completion of 'master'
_get_comp_words_by_ref() is invoked no less than six times.

However, the variables $prev, $cword, and $words provided by
_get_comp_words_by_ref() are not modified in any of the completion
functions, and the previous commit ensures that the $cur variable is
not modified as well.  This makes it possible to invoke
_get_comp_words_by_ref() to get those variables only once in our
toplevel completion functions _git() and _gitk(), and all other
completion functions will inherit them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28 09:40:20 -07:00
SZEDER Gábor
9244d69b96 completion: don't modify the $cur variable in completion functions
Since v1.7.4-rc0~11^2~2 (bash: get --pretty=m<tab> completion to work
with bash v4, 2010-12-02) we use _get_comp_words_by_ref() to access
completion-related variables, and the $cur variable holds the word
containing the current cursor position in all completion functions.
This $cur variable is left unchanged in most completion functions;
there are only four functions modifying its value, namely __gitcomp(),
__git_complete_revlist_file(), __git_complete_remote_or_refspec(), and
_git_config().

If this variable were never modified, then it would allow us a nice
optimisation and cleanup.  Therefore, this patch assigns $cur to an
other local variable and uses that for later modifications in those
four functions.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28 09:40:20 -07:00
Junio C Hamano
e839fe6c12 Start 1.7.6 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 12:09:04 -07:00
Junio C Hamano
9f5df6fa67 Merge branch 'mg/x-years-12-months'
* mg/x-years-12-months:
  date: avoid "X years, 12 months" in relative dates
2011-04-27 11:36:43 -07:00
Junio C Hamano
5033de916a Merge branch 'cn/format-patch-quiet'
* cn/format-patch-quiet:
  format-patch: document --quiet option
  format-patch: don't pass on the --quiet flag
2011-04-27 11:36:43 -07:00
Junio C Hamano
c5a5f12e5a Merge branch 'ef/maint-strbuf-init'
* ef/maint-strbuf-init:
  config: support values longer than 1023 bytes
  strbuf: make sure buffer is zero-terminated
2011-04-27 11:36:43 -07:00
Junio C Hamano
2a2dbd2770 Merge branch 'rr/doc-content-type'
* rr/doc-content-type:
  Documentation: Allow custom diff tools to be specified in 'diff.tool'
  Documentation: Add diff.<driver>.* to config
  Documentation: Move diff.<driver>.* from config.txt to diff-config.txt
  Documentation: Add filter.<driver>.* to config
2011-04-27 11:36:43 -07:00
Junio C Hamano
89cd2373ea Merge branch 'jc/merge-dash-previous'
* jc/merge-dash-previous:
  merge: allow "-" as a short-hand for "previous branch"
2011-04-27 11:36:42 -07:00
Junio C Hamano
65bc83d704 Merge branch 'dm/stash-k-i-p'
* dm/stash-k-i-p:
  stash: ensure --no-keep-index and --patch can be used in any order
  stash: add two more tests for --no-keep-index
2011-04-27 11:36:42 -07:00
Junio C Hamano
793066e790 Merge branch 'rj/sparse'
* rj/sparse:
  sparse: Fix some "symbol not declared" warnings
  sparse: Fix errors due to missing target-specific variables
  sparse: Fix an "symbol 'merge_file' not decared" warning
  sparse: Fix an "symbol 'format_subject' not declared" warning
  sparse: Fix some "Using plain integer as NULL pointer" warnings
  sparse: Fix an "symbol 'cmd_index_pack' not declared" warning
  Makefile: Use cgcc rather than sparse in the check target
2011-04-27 11:36:42 -07:00
Junio C Hamano
982f6c90ee Merge branch 'jk/maint-upload-pack-shallow'
* jk/maint-upload-pack-shallow:
  upload-pack: start pack-objects before async rev-list
2011-04-27 11:36:42 -07:00
Junio C Hamano
18b33bf425 Merge branch 'nk/blame-abbrev'
* nk/blame-abbrev:
  blame: add --abbrev command line option and make it honor core.abbrev
2011-04-27 11:36:42 -07:00
Junio C Hamano
fcbf164fcb Merge branch 'jk/maint-stash-oob'
* jk/maint-stash-oob:
  stash: fix false positive in the invalid ref test.
  stash: fix accidental apply of non-existent stashes

Conflicts:
	t/t3903-stash.sh
2011-04-27 11:36:42 -07:00
Junio C Hamano
29dba37f1f Merge branch 'dm/color-palette'
* dm/color-palette:
  Share color list between graph and show-branch
2011-04-27 11:36:41 -07:00
Junio C Hamano
6213ccaac9 Merge branch 'jk/stash-loosen-safety'
* jk/stash-loosen-safety:
  stash: drop dirty worktree check on apply
2011-04-27 11:36:41 -07:00
Junio C Hamano
9cedd16c62 Merge branch 'jc/pack-objects-bigfile'
* jc/pack-objects-bigfile:
  Teach core.bigfilethreashold to pack-objects
2011-04-27 11:36:41 -07:00
Junio C Hamano
698a9ab3f1 Merge branch 'mh/git-svn-automkdirs'
* mh/git-svn-automkdirs:
  git-svn: add an option to skip the creation of empty directories
2011-04-27 11:36:41 -07:00
Junio C Hamano
95fd6e21f1 Merge branch 'mg/reflog-with-options'
* 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-04-27 11:36:41 -07:00
Junio C Hamano
1de0746d84 Merge branch 'ar/clean-rmdir-empty'
* ar/clean-rmdir-empty:
  clean: unreadable directory may still be rmdir-able if it is empty
2011-04-27 11:36:41 -07:00
Junio C Hamano
385185403e Merge branch 'mg/sha1-path-advise'
* mg/sha1-path-advise:
  sha1_name: Suggest commit:./file for path in subdir
  t1506: factor out test for "Did you mean..."
2011-04-27 11:36:40 -07:00
Michael J Gruber
6999c54029 config.txt,diff-options.txt: porcelain vs. plumbing for color.diff
Reading the diff-family and config man pages one may think that the
color.diff and color.ui settings apply to all diff commands. Make it
clearer that they do not apply to the plumbing variants
diff-{files,index,tree}.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 11:25:47 -07:00
René Scharfe
7141efab24 strbuf: clarify assertion in strbuf_setlen()
Commit a8f3e2219 introduced the strbuf_grow() call to strbuf_setlen() to
make ensure that there was at least one byte available to write the
mandatory trailing NUL, even for previously unallocated strbufs.

Then b315c5c0 added strbuf_slopbuf for the same reason, only globally for
all uses of strbufs.

Thus the strbuf_grow() call can be removed now.  This avoids readers of
strbuf.h from mistakenly thinking that strbuf_setlen() can be used to
extend a strbuf.

The following assert() needs to be changed to cope with the fact that
sb->alloc can now be zero, which is OK as long as len is also zero.  As
suggested by Junio, use the chance to convert it to a die() with a short
explanatory message.  The pattern of 'die("BUG: ...")' is already used in
strbuf.c.

This was the only assert() in strbuf.[ch], so assert.h doesn't have to be
included anymore either.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 10:52:15 -07:00
Michael J Gruber
7cf16a14f5 handle_alias: provide GIT_PREFIX to !alias
Provide an environment variable GIT_PREFIX which contains the subdirectory
from which a !alias was called (i.e. 'git rev-parse --show-prefix') since
these cd to the to level directory before they are executed.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 10:50:05 -07:00
Michael J Gruber
0daed41791 t1020: test !alias in subdirectory
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 10:49:59 -07:00
Marius Storm-Olsen
b5a49471f0 Automatically autoload bashcompinit for ZSH, when needed
If bashcompinit has not already been autoloaded, do so
automatically, as it is required to properly parse the
git-completion file with ZSH.

Helped-by: Felipe Contreras
Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27 10:48:20 -07:00
Jeff King
4d03c18a3e pretty: quote rfc822 specials in email addresses
If somebody has a name that includes an rfc822 special, we
will output it literally in the "From:" header. This is
usually OK, but certain characters (like ".") are supposed
to be enclosed in double-quotes in a mail header.

In practice, whether this matters may depend on your MUA.
Some MUAs will happily take in:

   From: Foo B. Bar <author@example.com>

without quotes, and properly quote the "." when they send
the actual mail.  Others may not, or may screw up harder
things like:

  From: Foo "The Baz" Bar <author@example.com>

For example, mutt will strip the quotes, thinking they are
actual syntactic rfc822 quotes.

So let's quote properly, and then (if necessary) we still
apply rfc2047 encoding on top of that, which should make all
MUAs happy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 15:07:02 -07:00
Fraser Tweedale
0c8c385ef1 gitweb: supply '-n' to gzip for identical output
For projects that do not release official archives, gitweb's snapshot
feature would be an excellent alternative, and but without the '-n'
('--no-name') argument, gzip includes a timestamp in output which results
in different files.  Because some systems hash/checksum downloaded files
to ensure integrity of the tarball (e.g FreeBSD), it is desirable to
produce tarballs in a reproducible way for that purpose.

Whilst '--no-name' is more descriptive, the long version of the flag is
not supported on all systems.  In particular, OpenBSD does not appear to
support it.

Supply '-n' to gzip to exclude timestamp from output and produce idential
output every time.

Signed-off-by: Fraser Tweedale <frase@frase.id.au>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 13:14:02 -07:00
Michael J Gruber
b388e14b89 rev-list --count: separate count for --cherry-mark
When --count is used with --cherry-mark, omit the patch equivalent
commits from the count for left and right commits and print the count of
equivalent commits separately.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 13:13:20 -07:00
Valentin Haenel
7733b27933 git-svn.txt: small typeface improvements
Mark subcommand names as 'subcommand' to make them stand out.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 11:48:48 -07:00
Valentin Haenel
c88d18fff8 git-svn.txt: move option descriptions
The options '---use-log-author' and '--add-author-from' are applicable to other
subcommands except 'fetch' -- therefore move them from the 'fetch' section to
the more general 'options' section.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 11:48:43 -07:00
Valentin Haenel
12d30657d4 git-svn.txt: fix usage of --add-author-from
The option '--add-author-from' is used in 'commit-diff', 'set-tree', and
'dcommit' subcommands.

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 11:48:34 -07:00
Mathias Lafeldt
72942a617c t/README: unify documentation of test function args
Document all test function arguments in the same way.

While at it, tweak the description of test_path_is_* (thanks to Junio),
and correct some grammatical errors.

Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-26 11:45:56 -07:00
Junio C Hamano
1e41827d2d http: clear POSTFIELDS when initializing a slot
After posting a short request using CURLOPT_POSTFIELDS, if the slot
is reused for posting a large payload, the slot ends up having both
POSTFIELDS (which now points at a random garbage) and READFUNCTION,
in which case the curl library tries to use the stale POSTFIELDS.

Clear it as part of the general slot initialization in get_active_slot().

Heavylifting-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn Pearce <spearce@spearce.org>
2011-04-26 10:44:33 -07:00
Junio C Hamano
ec014eac0e Git 1.7.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.5
2011-04-23 23:36:32 -07:00
Junio C Hamano
095ce9538b diff-files: show unmerged entries correctly
Earlier, e9c8409 (diff-index --cached --raw: show tree entry on the LHS
for unmerged entries., 2007-01-05) taught the command to show the object
name and the mode from the entry coming from the tree side when comparing
a tree with an unmerged index.

This is a belated companion patch that teaches diff-files to show the mode
from the entry coming from the working tree side, when comparing an
unmerged index and the working tree.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23 22:35:13 -07:00
Junio C Hamano
fa7b290895 diff: remove often unused parameters from diff_unmerge()
e9c8409 (diff-index --cached --raw: show tree entry on the LHS for
unmerged entries., 2007-01-05) added a <mode, object name> pair as
parameters to this function, to store them in the pre-image side of an
unmerged file pair.  Now the function is fixed to return the filepair it
queued, we can make the caller on the special case codepath to do so.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23 22:34:43 -07:00
Junio C Hamano
76399c0195 diff.c: return filepair from diff_unmerge()
The underlying diff_queue() returns diff_filepair so that the caller can
further add information to it, and the helper function diff_unmerge()
utilizes the feature itself, but does not expose it to its callers, which
was kind of selfish.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23 22:34:43 -07:00
Junio C Hamano
3749fde561 test: use $_z40 from test-lib
There is no need to duplicate the definition of $_z40 and $_x40 that
test-lib.sh supplies the test scripts.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23 22:34:43 -07:00