diff --git a/django/utils/version.py b/django/utils/version.py index 3d66b9ef52..2271d415db 100644 --- a/django/utils/version.py +++ b/django/utils/version.py @@ -40,10 +40,10 @@ def get_git_changeset(): so it's sufficient for generating the development version numbers. """ repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - git_show = subprocess.Popen('git show --pretty=format:%ct --quiet HEAD', + git_log = subprocess.Popen('git log --pretty=format:%ct --quiet -1 HEAD', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, cwd=repo_dir, universal_newlines=True) - timestamp = git_show.communicate()[0].partition('\n')[0] + timestamp = git_log.communicate()[0] try: timestamp = datetime.datetime.utcfromtimestamp(int(timestamp)) except ValueError: