pretty describe: de-const'ify struct commit arg of format_commit_message()
PATCH 4/5 pretty describe: de-const'ify struct commit arg of format_commit_message()
As a preparation to use describe_commit() in format_commit_message(), the const attribute of the struct commit parameter must go, as describe_commit() needs to change the name related members in order to do its work.
This change requires changes in other places, too -- those that call format_commit_message() with a const struct commit, and the places calling those places.
Signed-off-by Rene Scharfe <[email protected]>
--- archive-tar.c | 2 +- archive-zip.c | 2 +- archive.h | 4 ++-- builtin-archive.c | 8 ++++---- commit.c | 4 ++-- commit.h | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-)
archive-tar.c +1 -1
@@ -16,7 +16,7 @@ static unsigned long offset;static time_t archive_time;static int tar_umask =002 ;static int verbose; -static const struct commit *commit; +static struct commit *commit;/* writes out the whole block, but only if it is full */ static void write_if_needed (void )
archive-zip.c +1 -1
@@ -12,7 +12,7 @@static int verbose;static int zip_date;static int zip_time; -static const struct commit *commit; +static struct commit *commit;static unsigned char *zip_dir;static unsigned int zip_dir_size;
archive.h +2 -2
@@ -8,7 +8,7 @@ struct archiver_args {const char *base;struct tree *tree;const unsigned char *commit_sha1; -const struct commit *commit; +struct commit *commit;time_t time;const char **pathspec; unsigned int verbose : 1;
@@ -43,6 +43,6 @@ extern int write_tar_archive(struct archiver_args *);extern int write_zip_archive (struct archiver_args *);extern void *parse_extra_zip_args (int argc,const char **argv); -extern void *sha1_file_to_archive (const char *path,const unsigned char *sha1,unsigned int mode,enum object_type *type,unsigned long *size,const struct commit *commit); +extern void *sha1_file_to_archive (const char *path,const unsigned char *sha1,unsigned int mode,enum object_type *type,unsigned long *size,struct commit *commit);#endif /* ARCHIVE_H */
builtin-archive.c +4 -4
@@ -79,7 +79,7 @@ static int run_remote_archiver(const char *remote, int argc,return !!rv; } -static void format_subst (const struct commit *commit, +static void format_subst (struct commit *commit,const char *src,size_t len,struct strbuf *buf) {
@@ -115,7 +115,7 @@ static void format_subst(const struct commit *commit,static int convert_to_archive (const char *path,const void *src,size_t len,struct strbuf *buf, -const struct commit *commit) +struct commit *commit) {static struct git_attr *attr_export_subst;struct git_attr_check check[1 ];
@@ -139,7 +139,7 @@ static int convert_to_archive(const char *path,void *sha1_file_to_archive (const char *path,const unsigned char *sha1,unsigned int mode,enum object_type *type,unsigned long *sizep, -const struct commit *commit) +struct commit *commit) {void *buffer;
@@ -188,7 +188,7 @@ void parse_treeish_arg(const char **argv, struct archiver_args *ar_args,const unsigned char *commit_sha1;time_t archive_time;struct tree *tree; -const struct commit *commit; +struct commit *commit;unsigned char sha1[20 ];if (get_sha1 (name, sha1))
commit.c +2 -2
@@ -771,7 +771,7 @@ static void fill_person(struct interp *table, const char *msg, int len)interp_set_entry (table,6 ,show_date (date, tz,DATE_ISO8601 )); } -void format_commit_message (const struct commit *commit, +void format_commit_message (struct commit *commit,const void *format,struct strbuf *sb) {struct interp table[] = {
@@ -1064,7 +1064,7 @@ static void pp_remainder(enum cmit_fmt fmt, } } -void pretty_print_commit (enum cmit_fmt fmt,const struct commit *commit, +void pretty_print_commit (enum cmit_fmt fmt,struct commit *commit,struct strbuf *sb,int abbrev,const char *subject,const char *after_subject,enum date_mode dmode)
commit.h +2 -2
@@ -65,9 +65,9 @@ enum cmit_fmt { };extern enum cmit_fmt get_commit_format (const char *arg); -extern void format_commit_message (const struct commit *commit, +extern void format_commit_message (struct commit *commit,const void *format,struct strbuf *sb); -extern void pretty_print_commit (enum cmit_fmt fmt,const struct commit *, +extern void pretty_print_commit (enum cmit_fmt fmt,struct commit *,struct strbuf *,int abbrev,const char *subject,const char *after_subject,enum date_mode );
Signature · 1 line
1.5.3.5.529.ge3d6d