From: XZS <d.f.fischer@web.de>
To: git@vger.kernel.org
Cc: XZS <d.f.fischer@web.de>
Subject: [PATCH/RFC/GSoC 0/2] add a add.patch config variable
Date: Thu, 21 Apr 2016 11:15:20 +0200 [thread overview]
Message-ID: <cover.1459946531.git.d.f.fischer@web.de> (raw)
In-Reply-To: <xmqqio0b5ash.fsf@gitster.mtv.corp.google.com>
The following patches try to provide an add.patch configuration variable
while keeping out of the way of other commands. To do so, an environment
variable counts how often git was recursively invoked. The variable is
then only considered in the first recursion.
To ensure other commands work as expected also when add.patch is set, I
added a test exemplifying the case with mergetool. To confirm the same
for other commands, I also reran all tests with an activated add.patch,
all direct invocations of git-add in the tests augmented with
--no-patch. You can reproduce this by running the following commands
from the root of the git source code repository.
sed -i '/add\.patch/,/}/ {
# pretend add.patch to always be active
s/\(patch_interactive = \).*;/\11;/
}' builtin/add.c
find t -type f -exec sed -i ' # in all tests
/(use\|forget\|hint/! { # exclude help texts
# replace git add invocations, also when options are passed to git,
# but not subcommands named add.
s/git\( -[^ ]\+ [^ ]\+\| --[^ ]\+=[^ ]\+\)* add/& --no-patch/g
}
/patch mode can be activated per option/ {
# find add.patched test now invalid and deactivate
s/\(test_expect_\)success/\1failure/
}
' '{}' +
I am unsure whether I placed all the code into the correct locations, so
comments are much appreciated, as well as opinions about the concept of
a recursion counter in general.
Regards,
XZS.
XZS (2):
count recursion depth
add a add.patch config variable
Documentation/config.txt | 6 ++++++
Documentation/git-add.txt | 3 +++
builtin/add.c | 3 +++
cache.h | 1 +
contrib/completion/git-completion.bash | 1 +
git.c | 18 ++++++++++++++++++
t/t0001-init.sh | 1 +
t/t0120-recursion-depth.sh | 17 +++++++++++++++++
t/t3701-add-interactive.sh | 27 +++++++++++++++++++++++++++
9 files changed, 77 insertions(+)
create mode 100755 t/t0120-recursion-depth.sh
--
2.8.0
next prev parent reply other threads:[~2016-04-21 9:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-24 21:09 [GSoC] Proposal XZS
2016-03-24 21:09 ` [PATCH/GSoC] add a add.patch config variable XZS
2016-03-24 21:20 ` Junio C Hamano
2016-03-25 0:43 ` Dominik Fischer
2016-03-25 6:30 ` Junio C Hamano
2016-03-25 7:01 ` Christian Couder
2016-04-21 9:15 ` XZS [this message]
2016-04-21 9:15 ` [PATCH/RFC/GSoC 1/2] count recursion depth XZS
2016-04-21 15:39 ` [PATCH/RFC/GSoC 0/2] add a add.patch config variable Johannes Schindelin
2016-04-21 16:30 ` Dominik Fischer
2016-04-21 16:43 ` Matthieu Moy
2016-04-21 16:47 ` Junio C Hamano
2016-04-21 17:28 ` Dominik Fischer
2016-04-22 6:45 ` Johannes Schindelin
2016-04-22 6:42 ` Johannes Schindelin
2016-04-21 9:15 ` [PATCH/RFC/GSoC 2/2] " XZS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1459946531.git.d.f.fischer@web.de \
--to=d.f.fischer@web.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).