INNER CODE UNIT · Go

c

jesseduffield/lazygit · cmd/author_colors_repo/main.go:91

		c := commits[len(commits)-1-i]
		date := fmt.Sprintf("%d +0000", startTime.Add(time.Duration(i)*time.Hour).Unix())
		env := []string{
			"GIT_AUTHOR_NAME=" + c.author,
			"GIT_AUTHOR_EMAIL=author@example.com",
			"GIT_AUTHOR_DATE=" + date,
			"GIT_COMMITTER_NAME=" + c.author,
			"GIT_COMMITTER_EMAIL=author@example.com",
			"GIT_COMMITTER_DATE=" + date,
		}
		if err := runGit(path, env, "commit", "-q", "--allow-empty", "-m", c.subject); err != nil {
			log.Fatal(err)
		}
	}

	fmt.Printf("Created %s with %d commits\n", path, len(commits))
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…