Repository navigation
Closed
Labels
enhancementNew feature or request
Description
I'm sure you are already aware of this, but thought I'd mention it just to check:
Lines 239 to 251 in 779bd6e
| let mut cmd = Command::new("git") | |
| .arg("log") | |
| // exclude stashes and other refs | |
| .arg("--branches") | |
| .arg("--remotes") | |
| .arg("--tags") | |
| .arg(format!("--pretty={}", load_commits_format())) | |
| .arg("--date=iso-strict") | |
| .arg("-z") // use NUL as a delimiter | |
| .current_dir(path) | |
| .stdout(Stdio::piped()) | |
| .spawn() | |
| .unwrap(); |
You can use --date-order or --topo-order here directly, e.g.:
let mut cmd = Command::new("git")
.arg("log")
// exclude stashes and other refs
.arg("--branches")
.arg("--remotes")
.arg("--tags")
.arg(format!("--pretty={}", load_commits_format()))
.arg(match order {
CommitOrderType::Chrono => "--date-order",
CommitOrderType::Topo => "--topo-order",
})
.arg("--date=iso-strict")
.arg("-z") // use NUL as a delimiter
.current_dir(path)
.stdout(Stdio::piped())
.spawn()
.unwrap();That way you can skip a bunch of calculation you do internally and rely on the order in git. If you do that, your graph will match closely with the output from git log --oneline --graph
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
lusingander commentedon Jul 28, 2024
I hadn't thought about this because it was based on code I had implemented as a trial in the past 😀
That may be enough.
We may need to think about how to handle stashes, but that doesn't seem like a big problem.
kdheepak commentedon Jul 29, 2024
I used
--allin the PR #5 and it seems to work fine for me:Is there a reason you opted to not do that?
lusingander commentedon Jul 29, 2024
git log) combine them as one commit.kdheepak commentedon Jul 29, 2024
Great points!
I don't view the graph with stashes all that much, but it does seem to match what git does at the moment. I made a stash to test:
lusingander commentedon Jul 29, 2024
Yes,
git log,tig, etc. will show it that way.For me, these client-like graphs are easier to use:
kdheepak commentedon Jul 29, 2024
What graphs are those btw? Those look quite nice.
lusingander commentedon Jul 29, 2024
https://git-fork.com
https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph