Skip to content

Commit

Permalink
lib-imap: Add revision field for ID command
Browse files Browse the repository at this point in the history
Returns short commit ID of the revision dovecot was built from.
  • Loading branch information
Siavash Tavakoli authored and sirainen committed Jan 21, 2020
1 parent a333079 commit c9edfc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lib-imap/imap-id.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "imap-parser.h"
#include "imap-quote.h"
#include "imap-id.h"
#include "dovecot-version.h"

#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
Expand Down Expand Up @@ -40,6 +41,8 @@ static const char *imap_id_get_default(const char *key)
return PACKAGE_NAME;
if (strcasecmp(key, "version") == 0)
return PACKAGE_VERSION;
if (strcasecmp(key, "revision") == 0)
return DOVECOT_REVISION;
if (strcasecmp(key, "support-url") == 0)
return PACKAGE_WEBPAGE;
if (strcasecmp(key, "support-email") == 0)
Expand Down
3 changes: 2 additions & 1 deletion update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ if true; then
#ifndef DOVECOT_VERSION_H
#define DOVECOT_VERSION_H
#define DOVECOT_VERSION_FULL VERSION" (${GITID})"
#define DOVECOT_REVISION "${GITID}"
#define DOVECOT_VERSION_FULL VERSION" ("DOVECOT_REVISION")"
#define DOVECOT_BUILD_INFO ${DOVECOT_BUILD_INFO}
#endif /* DOVECOT_VERSION_H */
Expand Down

0 comments on commit c9edfc6

Please sign in to comment.