MCPcopy Create free account
hub / github.com/git/git / userformat_find_requirements

Function userformat_find_requirements

pretty.c:1966–1998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1964}
1965
1966void userformat_find_requirements(const char *fmt, struct userformat_want *w)
1967{
1968 if (!fmt) {
1969 if (!user_format)
1970 return;
1971 fmt = user_format;
1972 }
1973 while ((fmt = strchr(fmt, '%'))) {
1974 fmt++;
1975 if (skip_prefix(fmt, "%", &fmt))
1976 continue;
1977
1978 if (*fmt == '+' || *fmt == '-' || *fmt == ' ')
1979 fmt++;
1980
1981 switch (*fmt) {
1982 case 'N':
1983 w->notes = 1;
1984 break;
1985 case 'S':
1986 w->source = 1;
1987 break;
1988 case 'd':
1989 case 'D':
1990 w->decorate = 1;
1991 break;
1992 case '(':
1993 if (starts_with(fmt + 1, "decorate"))
1994 w->decorate = 1;
1995 break;
1996 }
1997 }
1998}
1999
2000void repo_format_commit_message(struct repository *r,
2001 const struct commit *commit,

Callers 3

cmd_log_init_finishFunction · 0.85
cmd_format_revFunction · 0.85
cmd_diff_treeFunction · 0.85

Calls 1

starts_withFunction · 0.85

Tested by

no test coverage detected