Comments (6)
I am not as familiar with the code base, but as far as i understand, changing in src/snapshots.rs for branch name to be something else should work, but how would you want the parent commit handled? it could be made into an Option<> or maybe error handled when it is needed some other way
from dura.
Ah! Git trivia time! The parent commit is a plain list of commit hashes.
- 0 commits = first commit
- 1 commit = the normal case
- 2 commits = merge commit
- 3+ commits = octopus merge
So yeah, it's as simple as giving it an empty slice.
from dura.
love your style haha
i will try this tomorrow(in about ~12 hours)
have really taken a liking to this project 😄
from dura.
If dura makes the first commit would that set the dura_unborn as the default branch?
also i am thinking something like this to error handle the head, but it doesn't seem elegant
let head = match repo.head() {
Ok(v) => peel_to_commit(v)?,
Err(e) => if e.code() == git2::UnbornBranch {
// handle unborn branch
} else {
return Err(e);
}
}
}
from dura.
I don't know. Write a test and find out!
from dura.
I went the way of making head: Option<git2::Commit>
which seemed logical as it can None when there is no head
but this has an adverse effect that all the statements in the capture function need to be if let Some(h) = head
and it then extends to parent_commit being an option because git2 doesn't support empty slice as a parent, and the if let Some hell extends to it too.
I am thinking that once we check if head exists or not, it can be divided into 2 capture functions. Once dura makes the commit in the unborn_capture function it will have a head to use and will no longer fall back on that function.
from dura.
Related Issues (20)
- Update: Upgrade clap to V3.1.6 & replace deprecated code in main.rs HOT 2
- Dura doesn't create any branches on github codespaces HOT 2
- brew install dura HOT 4
- Couldnt you just git commit more often? HOT 4
- Update clap
- Data Corruption: Don't allow dura to run as root
- Ubuntu install instructions HOT 2
- High CPU utilization while idle HOT 5
- Chronological git log HOT 2
- feature request: remove old dura branches periodically HOT 1
- support install linux and macOS with brew HOT 15
- `dura checkout` command HOT 6
- Tests broken HOT 3
- Binaries built by Github are not working HOT 6
- Prevent pushin dura branches to remote HOT 4
- stabilize config loading HOT 2
- Dura fails to capture anything if a worktree is present as a subdir of the working directory HOT 4
- Make dura branch names more informative HOT 3
- Feature Request: `dura status` command HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dura.