diff --git a/crates/assets/assets/icons/init.svg b/crates/assets/assets/icons/init.svg
new file mode 100644
index 0000000..060c043
--- /dev/null
+++ b/crates/assets/assets/icons/init.svg
@@ -0,0 +1,3 @@
+
diff --git a/crates/assets/assets/icons/refresh.svg b/crates/assets/assets/icons/refresh.svg
new file mode 100644
index 0000000..b7ec11e
--- /dev/null
+++ b/crates/assets/assets/icons/refresh.svg
@@ -0,0 +1,3 @@
+
diff --git a/crates/assets/src/lib.rs b/crates/assets/src/lib.rs
index 7e6fc8a..d6d44b4 100644
--- a/crates/assets/src/lib.rs
+++ b/crates/assets/src/lib.rs
@@ -74,7 +74,9 @@ pub enum CustomIconName {
Share,
Trending,
Recent,
+ Refresh,
Grid,
+ Init,
}
impl IconNamed for CustomIconName {
@@ -101,8 +103,10 @@ impl IconNamed for CustomIconName {
CustomIconName::Markdown => "icons/markdown.svg",
CustomIconName::Share => "icons/share.svg",
CustomIconName::Trending => "icons/trending.svg",
+ CustomIconName::Refresh => "icons/refresh.svg",
CustomIconName::Recent => "icons/recent.svg",
CustomIconName::Grid => "icons/grid.svg",
+ CustomIconName::Init => "icons/init.svg",
}
.into()
}
diff --git a/crates/signed_git/src/lib.rs b/crates/signed_git/src/lib.rs
index c7951fa..6d73636 100644
--- a/crates/signed_git/src/lib.rs
+++ b/crates/signed_git/src/lib.rs
@@ -289,6 +289,57 @@ pub fn push_main(repo_path: &Path, base_url: &str, owner: &str, repo_id: &str) -
Ok(())
}
+/// Push every local branch and tag of the repository at `repo_path` to a
+/// grasp server (like `git push --all --tags`), so an initialized
+/// repository's whole history is mirrored, not just `main`.
+pub fn push_all(repo_path: &Path, base_url: &str, owner: &str, repo_id: &str) -> Result<()> {
+ let url = format!("{base_url}/{owner}/{repo_id}.git");
+
+ let output = Command::new("git")
+ .arg("-C")
+ .arg(repo_path)
+ .args(["push", "--all", "--tags"])
+ .arg(&url)
+ .env("GIT_TERMINAL_PROMPT", "0")
+ .stderr(Stdio::piped())
+ .output()
+ .context("failed to spawn `git push`")?;
+
+ if !output.status.success() {
+ bail!(
+ "git push to {base_url} failed: {}",
+ String::from_utf8_lossy(&output.stderr).trim()
+ );
+ }
+ Ok(())
+}
+
+/// The earliest unique commit of the repository at `repo_path` (a root
+/// commit, like `git rev-list --max-parents=0 HEAD`), used as the NIP-34
+/// announcement's `euc` marker. `None` for a repository without commits.
+pub fn root_commit(repo_path: &Path) -> Result