git-commit-vandalism/builtin
Jeff King 6680a0874f drop odd return value semantics from userdiff_config
When the userdiff_config function was introduced in be58e70
(diff: unify external diff and funcname parsing code,
2008-10-05), it used a return value convention unlike any
other config callback. Like other callbacks, it used "-1" to
signal error. But it returned "1" to indicate that it found
something, and "0" otherwise; other callbacks simply
returned "0" to indicate that no error occurred.

This distinction was necessary at the time, because the
userdiff namespace overlapped slightly with the color
configuration namespace. So "diff.color.foo" could mean "the
'foo' slot of diff coloring" or "the 'foo' component of the
"color" userdiff driver". Because the color-parsing code
would die on an unknown color slot, we needed the userdiff
code to indicate that it had matched the variable, letting
us bypass the color-parsing code entirely.

Later, in 8b8e862 (ignore unknown color configuration,
2009-12-12), the color-parsing code learned to silently
ignore unknown slots. This means we no longer need to
protect userdiff-matched variables from reaching the
color-parsing code.

We can therefore change the userdiff_config calling
convention to a more normal one. This drops some code from
each caller, which is nice. But more importantly, it reduces
the cognitive load for readers who may wonder why
userdiff_config is unlike every other config callback.

There's no need to add a new test confirming that this
works; t4020 already contains a test that sets
diff.color.external.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-07 10:44:54 -08:00
..
add.c bulk-checkin: replace fast-import based implementation 2011-12-01 11:46:09 -08:00
annotate.c
apply.c Merge branch 'bc/maint-apply-check-no-patch' into maint 2011-12-21 11:42:45 -08:00
archive.c Revert "upload-archive: use start_command instead of fork" 2011-11-15 15:39:33 -08:00
bisect--helper.c
blame.c drop odd return value semantics from userdiff_config 2012-02-07 10:44:54 -08:00
branch.c Merge branch 'jn/branch-move-to-self' into maint 2011-12-28 11:32:33 -08:00
bundle.c
cat-file.c drop odd return value semantics from userdiff_config 2012-02-07 10:44:54 -08:00
check-attr.c Merge branch 'bc/attr-ignore-case' 2011-10-17 21:37:14 -07:00
check-ref-format.c
checkout-index.c
checkout.c clone: print advice on checking out detached HEAD 2012-01-16 16:26:27 -08:00
clean.c
clone.c Merge branch 'nd/clone-detached' 2012-01-31 22:24:23 -08:00
commit-tree.c Merge branch 'jc/show-sig' 2012-01-06 12:44:07 -08:00
commit.c Merge branch 'jc/show-sig' 2012-01-06 12:44:07 -08:00
config.c Merge branch 'jv/maint-config-set' into maint 2011-12-28 12:03:19 -08:00
count-objects.c
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c use struct sha1_array in diff_tree_combined() 2011-12-17 18:21:37 -08:00
fast-export.c Fix an enum assignment issue spotted by Sun Studio 2011-12-21 10:19:04 -08:00
fetch-pack.c fetch-pack: match refs exactly 2011-12-13 10:17:50 -08:00
fetch.c Merge branch 'nd/maint-refname-in-hierarchy-check' 2012-01-29 13:18:51 -08:00
fmt-merge-msg.c Convert resolve_ref+xstrdup to new resolve_refdup function 2011-12-13 09:26:52 -08:00
for-each-ref.c Convert resolve_ref+xstrdup to new resolve_refdup function 2011-12-13 09:26:52 -08:00
fsck.c Rename resolve_ref() to resolve_ref_unsafe() 2011-12-13 09:39:46 -08:00
gc.c prune: handle --progress/no-progress 2011-11-07 22:12:19 -08:00
grep.c drop odd return value semantics from userdiff_config 2012-02-07 10:44:54 -08:00
hash-object.c
help.c
index-pack.c index-pack: eliminate unlimited recursion in get_base_data() 2012-01-16 14:34:33 -08:00
init-db.c builtin/init-db.c: eliminate -Wformat warning on Solaris 2011-12-20 16:02:08 -08:00
log.c Sync with v1.7.8.1 2011-12-21 12:02:44 -08:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c mailinfo: with -b, keep space after [foo] 2012-01-16 16:06:57 -08:00
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c sparse: Fix an "symbol 'merge_file' not decared" warning 2011-04-11 10:35:25 -07:00
merge.c Merge branch 'tr/merge-edit-guidance' 2012-01-31 22:31:03 -08:00
mktag.c
mktree.c Merge "Move 'builtin-*' into a 'builtin/' subdirectory" 2011-11-10 09:10:51 -08:00
mv.c Merge branch 'jk/maint-mv' into maint 2011-12-28 11:32:36 -08:00
name-rev.c Merge branch 'jc/maint-name-rev-all' into maint-1.7.6 2011-12-13 21:12:34 -08:00
notes.c Merge branch 'nd/war-on-nul-in-commit' 2011-12-22 11:27:26 -08:00
pack-objects.c Merge branch 'maint' 2012-01-12 23:33:39 -08:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c prune: handle --progress/no-progress 2011-11-07 22:12:19 -08:00
push.c clone: fix up delay cloning conditions 2012-01-24 10:05:15 -08:00
read-tree.c
receive-pack.c Merge branch 'cb/push-quiet' 2012-01-29 13:18:50 -08:00
reflog.c prune: show progress while marking reachable objects 2011-11-07 22:12:19 -08:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'nd/maint-refname-in-hierarchy-check' 2012-01-29 13:18:51 -08:00
replace.c Convert many resolve_ref() calls to read_ref*() and ref_exists() 2011-11-13 12:21:06 -08:00
rerere.c
reset.c reset: update cache-tree data when appropriate 2011-12-06 15:13:39 -08:00
rev-list.c
rev-parse.c
revert.c Merge branch 'jc/advise-i18n' 2012-01-31 22:01:14 -08:00
rm.c
send-pack.c fix push --quiet: add 'quiet' capability to receive-pack 2012-01-08 14:27:28 -08:00
shortlog.c
show-branch.c Rename resolve_ref() to resolve_ref_unsafe() 2011-12-13 09:39:46 -08:00
show-ref.c Convert many resolve_ref() calls to read_ref*() and ref_exists() 2011-11-13 12:21:06 -08:00
stripspace.c Update documentation for stripspace 2011-12-12 16:48:54 -08:00
symbolic-ref.c Rename resolve_ref() to resolve_ref_unsafe() 2011-12-13 09:39:46 -08:00
tag.c Merge branch 'ks/tag-cleanup' 2011-12-13 23:07:47 -08:00
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c upload-archive: use start_command instead of fork 2011-11-21 14:32:40 -08:00
var.c
verify-pack.c
verify-tag.c Split GPG interface into its own helper library 2011-11-04 21:40:25 -07:00
write-tree.c