Age | Commit message (Collapse) | Author | Files | Lines |
|
Teaches the "rev-parse --parseopt" mechanism used by scripted
Porcelains to parse command line options and give help text how to
supply argv-help (the placeholder string for an option parameter,
e.g. "key-id" in "--gpg-sign=<key-id>").
* ib/rev-parse-parseopt-argh:
t1502: protect runs of SPs used in the indentation
rev-parse --parseopt: option argument name hints
|
|
* dp/makefile-charset-lib-doc:
Makefile: describe CHARSET_LIB better
|
|
Improves the pattern to match the hunk-header for C/C++.
* js/userdiff-cc:
userdiff: have 'cpp' hunk header pattern catch more C++ anchor points
t4018: test cases showing that the cpp pattern misses many anchor points
t4018: test cases for the built-in cpp pattern
t4018: reduce test files for pattern compilation tests
t4018: convert custom pattern test to the new infrastructure
t4018: convert java pattern test to the new infrastructure
t4018: convert perl pattern tests to the new infrastructure
t4018: an infrastructure to test hunk headers
userdiff: support unsigned and long long suffixes of integer constants
userdiff: support C++ ->* and .* operators in the word regexp
|
|
* dw/doc-status-no-longer-shows-pound-prefix:
doc: status, remove leftover statement about '#' prefix
|
|
* ca/doc-config-third-party:
config.txt: third-party tools may and do use their own variables
|
|
* hs/simplify-bit-setting-in-fsck-tree:
fsck: use bitwise-or assignment operator to set flag
|
|
* dt/tests-with-env-not-subshell:
tests: use "env" to run commands with temporary env-var settings
|
|
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
* ys/fsck-commit-parsing:
fsck.c:fsck_commit(): use skip_prefix() to verify and skip constant
fsck.c:fsck_ident(): ident points at a const string
|
|
* bg/rebase-off-of-previous-branch:
rebase: allow "-" short-hand for the previous branch
|
|
When it is not necessary to edit a commit log message (e.g. "git
commit -m" is given a message without specifying "-e"), we used to
disable the spawning of the editor by overriding GIT_EDITOR, but
this means all the uses of the editor, other than to edit the
commit log message, are also affected.
* bp/commit-p-editor:
run-command: mark run_hook_with_custom_index as deprecated
merge hook tests: fix and update tests
merge: fix GIT_EDITOR override for commit hook
commit: fix patch hunk editing with "commit -p -m"
test patch hunk editing with "commit -p -m"
merge hook tests: use 'test_must_fail' instead of '!'
merge hook tests: fix missing '&&' in test
|
|
* ah/doc-gitk-config:
Documentation/gitk: document the location of the configulation file
|
|
* fr/add-interactive-argv-array:
add: use struct argv_array in run_add_interactive()
|
|
A stray environment variable $prefix could have leaked into and
affected the behaviour of the "subtree" script.
* jk/subtree-prefix:
subtree: initialize "prefix" variable
|
|
The progress output while repacking and transferring objects showed
an apparent large silence while writing the objects out of existing
packfiles, when the reachability bitmap was in use.
* jk/pack-bitmap-progress:
pack-objects: show reused packfile objects in "Counting objects"
pack-objects: show progress for reused packfiles
|
|
Instead of dying when asked to (re)pack with the reachability
bitmap when a bitmap cannot be built, just (re)pack without
producing a bitmap in such a case, with a warning.
* jk/pack-bitmap:
pack-objects: turn off bitmaps when skipping objects
|
|
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
* ss/test-on-mingw-rsync-path-no-absolute:
t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync
|
|
* bb/diff-no-index-dotdot:
diff-no-index: replace manual "."/".." check with is_dot_or_dotdot()
diff-no-index: rename read_directory()
|
|
* us/printf-not-echo:
test-lib.sh: do not "echo" caller-supplied strings
rebase -i: do not "echo" random user-supplied strings
|
|
* rr/doc-merge-strategies:
Documentation/merge-strategies: avoid hyphenated commands
|
|
* nd/index-pack-error-message:
index-pack: report error using the correct variable
|
|
The test helper lib-terminal always run an actual test_expect_* when
included, which screwed up with the use of skil-all that may have to
be done later.
* jk/lib-terminal-lazy:
t/lib-terminal: make TTY a lazy prerequisite
|
|
* dm/configure-iconv-locale-charset:
configure.ac: link with -liconv for locale_charset()
|
|
"git commit --cleanup=<mode>" learned a new mode, scissors.
* nd/commit-editor-cleanup:
commit: add --cleanup=scissors
wt-status.c: move cut-line print code out to wt_status_add_cut_line
wt-status.c: make cut_line[] const to shrink .data section a bit
|
|
* jk/warn-on-object-refname-ambiguity:
rev-list: disable object/refname ambiguity check with --stdin
cat-file: restore warn_on_object_refname_ambiguity flag
cat-file: fix a minor memory leak in batch_objects
cat-file: refactor error handling of batch_objects
|
|
* mh/remove-subtree-long-pathname-fix:
entry.c: fix possible buffer overflow in remove_subtree()
checkout_entry(): use the strbuf throughout the function
|
|
* nd/indent-fix-connect-c:
connect.c: SP after "}", not TAB
|
|
"git mv" that moves a submodule forgot to adjust the array that uses
to keep track of which submodules were to be moved to update its
configuration.
* jk/mv-submodules-fix:
mv: prevent mismatched data when ignoring errors.
builtin/mv: fix out of bounds write
|
|
* cp/am-patch-format-doc:
Documentation/git-am: typofix
Documentation/git-am: Document supported --patch-format options
|
|
The expected output from the argument help use runs of SPs to align
the description of each option; a careless use of --whitespace=fix
can turn leading parts of them into appropriate number of HTs.
Prevent such a breakage by prefixing all the expected lines with
leading vertical bars in the original and stripping them with a
small sed script.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
Built-in commands can specify names for option arguments when usage text
is generated for a command. sh based commands should be able to do the
same.
Option argument name hint is any text that comes after [*=?!] after the
argument name up to the first whitespace.
Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
The original explanation was not even grammatically correct or
readable.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
The hunk header pattern 'cpp' is intended for C and C++ source code, but
it is actually not particularly useful for the latter, and even misses
some use-cases for the former.
The parts of the pattern have the following flaws:
- The first part matches an identifier followed immediately by a colon
and arbitrary text and is intended to reject goto labels and C++
access specifiers (public, private, protected). But this pattern also
rejects C++ constructs, which look like this:
MyClass::MyClass()
MyClass::~MyClass()
MyClass::Item MyClass::Find(...
- The second part matches an identifier followed by a list of qualified
names (i.e. identifiers separated by the C++ scope operator '::')
separated by space or '*' followed by an opening parenthesis (with
space between the tokens). It matches function declarations like
struct item* get_head(...
int Outer::Inner::Func(...
Since the pattern requires at least two identifiers, GNU-style
function definitions are ignored:
void
func(...
Moreover, since the pattern does not allow punctuation other than '*',
the following C++ constructs are not recognized:
. template definitions:
template<class T> int func(T arg)
. functions returning references:
const string& get_message()
. functions returning templated types:
vector<int> foo()
. operator definitions:
Value operator+(Value l, Value r)
- The third part of the pattern finally matches compound definitions.
But it forgets about unions and namespaces, and also skips single-line
definitions
struct random_iterator_tag {};
because no semicolon can occur on the line.
Change the first pattern to require a colon at the end of the line
(except for trailing space and comments), so that it does not reject
constructor or destructor definitions.
Notice that all interesting anchor points begin with an identifier or
keyword. But since there is a large variety of syntactical constructs
after the first "word", the simplest is to require only this word and
accept everything else. Therefore, this boils down to a line that begins
with a letter or underscore (optionally preceded by the C++ scope
operator '::' to accept functions returning a type anchored at the
global namespace). Replace the second and third part by a single pattern
that picks such a line.
This has the following desirable consequence:
- All constructs mentioned above are recognized.
and the following likely desirable consequences:
- Definitions of global variables and typedefs are recognized:
int num_entries = 0;
extern const char* help_text;
typedef basic_string<wchar_t> wstring;
- Commonly used marco-ized boilerplate code is recognized:
BEGIN_MESSAGE_MAP(CCanvas,CWnd)
Q_DECLARE_METATYPE(MyStruct)
PATTERNS("tex",...)
(The last one is from this very patch.)
but also the following possibly undesirable consequence:
- When a label is not on a line by itself (except for a comment) it is
no longer rejected, but can appear as a hunk header if it occurs at
the beginning of a line:
next:;
IMO, the benefits of the change outweigh the (possible) regressions by a
large margin.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
Most of the tests show C++ code, but there is also a union definition and
a GNU style function definition that are not recognized.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
A later patch changes the built-in cpp pattern. These test cases
demonstrate aspects of the pattern that we do not want to change.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
All test cases that need a file with specific text patterns have been
converted to utilize texts in the t4018/ directory. The remaining tests
in the test script deal only with the validity of the regular
expressions. These tests do not depend on the contents of files that
'git diff' is invoked on. Remove the largish here-document and use only
tiny files.
While we are touching these tests, convert grep to test_i18ngrep as the
texts checked for may undergo translation in the future.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
For the test case "matches to end of line", extend the pattern by a few
wildcards so that the pattern captures the "RIGHT" token, which is needed
for verification, without mentioning it in the pattern.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
There is one subtlety: The old test case 'perl pattern gets full line of
POD header' does not have its own new test case, but the feature is
tested nevertheless by placing the RIGHT tag at the end of the expected
hunk header in t4018/perl-skip-sub-in-pod.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
Add an infrastructure that simplifies adding new tests of the hunk
header regular expressions.
To add new tests, a file with the syntax to test can be dropped in the
directory t4018. The README file explains how a test file must contain;
the README itself tests the default behavior.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
Do not split constants such as 123U, 456ll, 789UL at the first U or
second L.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
The character sequences ->* and .* are valid C++ operators. Keep them
together in --word-diff mode.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
|
|
Discard the accumulated "heuristics" to guess from which branch the
result wants to be pulled from and make sure what the end user
specified is not second-guessed by "git request-pull", to avoid
mistakes.
* lt/request-pull:
request-pull: documentation updates
request-pull: resurrect "pretty refname" feature
request-pull: test updates
request-pull: pick up tag message as before
request-pull: allow "local:remote" to specify names on both ends
request-pull: more strictly match local/remote branches
|
|
* es/sh-i18n-envsubst:
sh-i18n--envsubst: retire unused string_list_member()
|
|
Serving objects from a shallow repository needs to write a
temporary file to be used, but the serving upload-pack may not have
write access to the repository which is meant to be read-only.
Instead feed these temporary shallow bounds from the standard input
of pack-objects so that we do not have to use a temporary file.
* nd/upload-pack-shallow:
upload-pack: send shallow info over stdin to pack-objects
|
|
Unify the codepaths that format new/modified/changed sections and
conflicted paths in the "git status" output and make it possible to
properly internationalize their output.
* jn/wt-status:
wt-status: lift the artificual "at least 20 columns" floor
wt-status: i18n of section labels
wt-status: extract the code to compute width for labels
wt-status: make full label string to be subject to l10n
|
|
"stash pop", upon failing to apply the stash, refrains from
discarding the stash to avoid information loss. Be more explicit
in the error message.
The wording may want to get a bit more bikeshedding.
* jc/stash-pop-not-popped:
stash pop: mention we did not drop the stash upon failing to apply
|
|
Update implementation of skip_prefix() to scan only once; given
that most "prefix" arguments to the inline function are constant
strings whose strlen() can be determined at the compile time, this
might actually make things worse with a compiler with sufficient
intelligence.
* dk/skip-prefix-scan-only-once:
skip_prefix(): scan prefix only once
|