Skip to content

Commit 5f1ad9e

Browse files
committed
git fucked
1 parent e2d9c46 commit 5f1ad9e

File tree

9 files changed

+586
-0
lines changed

9 files changed

+586
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -2780,3 +2780,4 @@ cover_db: coverage-report
27802780
cover_db_html: cover_db
27812781
cover -report html -outputdir cover_db_html cover_db
27822782

2783+
NO_GETTEXT = YesPlease

builtin.h

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
6666
extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
6767
extern int cmd_format_patch(int argc, const char **argv, const char *prefix);
6868
extern int cmd_fsck(int argc, const char **argv, const char *prefix);
69+
extern int cmd_fucked(int argc, const char **argv, const char *prefix);
6970
extern int cmd_gc(int argc, const char **argv, const char *prefix);
7071
extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
7172
extern int cmd_grep(int argc, const char **argv, const char *prefix);

builtin/help.c

+61
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,64 @@ int cmd_help(int argc, const char **argv, const char *prefix)
508508

509509
return 0;
510510
}
511+
512+
513+
int cmd_fucked(int argc, const char **argv, const char *prefix)
514+
{
515+
int nongit;
516+
enum help_format parsed_help_format;
517+
518+
argc = parse_options(argc, argv, prefix, builtin_help_options,
519+
builtin_help_usage, 0);
520+
parsed_help_format = help_format;
521+
522+
if (show_all) {
523+
git_config(git_help_config, NULL);
524+
printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
525+
load_command_list("git-", &main_cmds, &other_cmds);
526+
list_commands(colopts, &main_cmds, &other_cmds);
527+
}
528+
529+
if (show_guides)
530+
list_common_guides_help();
531+
532+
if (show_all || show_guides) {
533+
printf("%s\n", _(git_more_info_string));
534+
/*
535+
* We're done. Ignore any remaining args
536+
*/
537+
return 0;
538+
}
539+
540+
if (!argv[0]) {
541+
printf(_("usage: %s%s"), _(git_usage_string), "\n\n");
542+
list_common_cmds_help();
543+
printf("\n%s\n", _(git_more_info_string));
544+
return 0;
545+
}
546+
547+
setup_git_directory_gently(&nongit);
548+
git_config(git_help_config, NULL);
549+
550+
if (parsed_help_format != HELP_FORMAT_NONE)
551+
help_format = parsed_help_format;
552+
if (help_format == HELP_FORMAT_NONE)
553+
help_format = parse_help_format(DEFAULT_HELP_FORMAT);
554+
555+
argv[0] = check_git_cmd(argv[0]);
556+
557+
switch (help_format) {
558+
case HELP_FORMAT_NONE:
559+
case HELP_FORMAT_MAN:
560+
show_man_page(argv[0]);
561+
break;
562+
case HELP_FORMAT_INFO:
563+
show_info_page(argv[0]);
564+
break;
565+
case HELP_FORMAT_WEB:
566+
show_html_page(argv[0]);
567+
break;
568+
}
569+
570+
return 0;
571+
}

command-list.txt

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ git-fmt-merge-msg purehelpers
5959
git-for-each-ref plumbinginterrogators
6060
git-format-patch mainporcelain
6161
git-fsck ancillaryinterrogators
62+
git-fucked ancillaryinterrogators
6263
git-gc mainporcelain
6364
git-get-tar-commit-id ancillaryinterrogators
6465
git-grep mainporcelain info

contrib/completion/git-completion.bash

+17
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,23 @@ _git_fsck ()
15251525
esac
15261526
}
15271527

1528+
_git_fucked ()
1529+
{
1530+
case "$cur" in
1531+
--*)
1532+
__gitcomp "--all --guides --info --man --web"
1533+
return
1534+
;;
1535+
esac
1536+
__git_compute_all_commands
1537+
__gitcomp "$__git_all_commands $(__git_aliases)
1538+
attributes cli core-tutorial cvs-migration
1539+
diffcore everyday gitk glossary hooks ignore modules
1540+
namespaces repository-layout revisions tutorial tutorial-2
1541+
workflows
1542+
"
1543+
}
1544+
15281545
_git_gc ()
15291546
{
15301547
case "$cur" in

0 commit comments

Comments
 (0)