# File lib/git-version-bump.rb, line 193
        def self.commit_date_version(use_local_git = false)
                if use_local_git
                        unless git_available?
                                raise RuntimeError,
                                      "GVB.commit_date_version(use_local_git=true) called, but git isn't installed"
                        end

                        sq_git_dir = shell_quoted_string(Dir.pwd)
                else
                        sq_git_dir = shell_quoted_string((File.dirname(caller_file) rescue nil || Dir.pwd))
                end

                commit_dates = `git -C #{sq_git_dir} log --format=%at`.
                               split("\n").
                               map { |l| Time.at(Integer(l)).strftime("%Y%m%d") }

                if $? == 0
                        # We got a log; calculate our version number and we're done.
                        version_date = commit_dates.first
                        commit_count = commit_dates.select { |d| d == version_date }.length - 1
                        dirty_suffix = if dirty_tree?
                                ".dirty.#{Time.now.strftime("%Y%m%d.%H%M%S")}"
                        else
                                ""
                        end

                        return "0.#{version_date}.#{commit_count}#{dirty_suffix}"
                end

                # git failed us; either we're not in a git repo or else it's a git
                # repo that's not got any commits.

                # Are we in a git repo with no tags?  If so, dump out our
                # super-special version and be done with it.
                system("git -C #{sq_git_dir} status > #{DEVNULL} 2>&1")
                $? == 0 ? "0.0.0.1.ENOCOMMITS" : gem_version(use_local_git)
        end