-
Notifications
You must be signed in to change notification settings - Fork 146
[Outreachy] add: use advise API to display hints #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ int advice_graft_file_deprecated = 1; | |
int advice_checkout_ambiguous_remote_branch_name = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Jonathan Tan wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Heba Waly wrote (reply to this):
|
||
int advice_nested_tag = 1; | ||
int advice_submodule_alternate_error_strategy_die = 1; | ||
int advice_add_ignored_file = 1; | ||
int advice_add_empty_pathspec = 1; | ||
|
||
static int advice_use_color = -1; | ||
static char advice_colors[][COLOR_MAXLEN] = { | ||
|
@@ -91,6 +93,8 @@ static struct { | |
{ "checkoutAmbiguousRemoteBranchName", &advice_checkout_ambiguous_remote_branch_name }, | ||
{ "nestedTag", &advice_nested_tag }, | ||
{ "submoduleAlternateErrorStrategyDie", &advice_submodule_alternate_error_strategy_die }, | ||
{ "addIgnoredFile", &advice_add_ignored_file }, | ||
{ "addEmptyPathspec", &advice_add_empty_pathspec }, | ||
|
||
/* make this an alias for backward compatibility */ | ||
{ "pushNonFastForward", &advice_push_update_rejected } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,7 +390,10 @@ static int add_files(struct dir_struct *dir, int flags) | |
fprintf(stderr, _(ignore_error)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Emily Shaffer wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Heba Waly wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Heba Waly wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Heba Waly wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Emily Shaffer wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this):
|
||
for (i = 0; i < dir->ignored_nr; i++) | ||
fprintf(stderr, "%s\n", dir->ignored[i]->name); | ||
fprintf(stderr, _("Use -f if you really want to add them.\n")); | ||
if (advice_add_ignored_file) | ||
advise(_("Use -f if you really want to add them.\n" | ||
"Turn this message off by running\n" | ||
"\"git config advice.addIgnoredFile false\"")); | ||
exit_status = 1; | ||
} | ||
|
||
|
@@ -480,7 +483,10 @@ int cmd_add(int argc, const char **argv, const char *prefix) | |
|
||
if (require_pathspec && pathspec.nr == 0) { | ||
fprintf(stderr, _("Nothing specified, nothing added.\n")); | ||
fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n")); | ||
if (advice_add_empty_pathspec) | ||
advise( _("Maybe you wanted to say 'git add .'?\n" | ||
"Turn this message off by running\n" | ||
"\"git config advice.addEmptyPathspec false\"")); | ||
return 0; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Emily Shaffer wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Heba Waly wrote (reply to this):