El 2013-06-08 17:25, Ramkumar Ramachandra escribió:
Jorge Juan Garcia Garcia wrote:
Some people always run 'git status -s'.
The configuration variable status.short allows to set it by default.

Good feature.

@@ -1112,6 +1112,15 @@ static int git_status_config(const char *k, const char *v, void *cb)
                        s->submodule_summary = -1;
                return 0;
        }
+       if (!strcmp(k, "status.short")) {
+               if (!v)
+                       return config_error_nonbool(k);
+               if (git_config_bool(k,v)) {
+                       status_format = STATUS_FORMAT_SHORT;
+                       wt_shortstatus_print(s);
+               }
+               return 0;
+       }

Incorrect.  This is the wrong place to use config_error_nonbool():
this is very much a bool, and a "[status] short" in ~/.gitconfig
should not error out (all boolean variables behave in the same
manner).  When in doubt, consult config_error_nonbool(); there's
clearly a comment stating:

Ok. We will change it.


/*
 * Call this to report error for your variable that should not
 * get a boolean value (i.e. "[my] var" means "true").
 */

Also, why are you calling wt_shortstatus_print() here, instead of
returning control to cmd_status(), which is going to do it anyway?
Yes, it's obviously a mistake.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to