Project import generated by Copybara.
GitOrigin-RevId: 975161aa2f1036264c56d7a81b79ac74ba68b276
diff --git a/.copybara/.gitignore b/.copybara/.gitignore
new file mode 100644
index 0000000..126a12c
--- /dev/null
+++ b/.copybara/.gitignore
@@ -0,0 +1 @@
+test_repos_config.bara.sky
diff --git a/.copybara/README.md b/.copybara/README.md
new file mode 100644
index 0000000..4c57d54
--- /dev/null
+++ b/.copybara/README.md
@@ -0,0 +1,14 @@
+[Copybara][copybara] configuration used to sync the private repo with the
+public one, excluding personal files I do not want to share with the world :)
+
+## How to test the Copybara script
+
+1. Clone the private and public repos in your computer.
+2. Create a `test_repos_config.sky` file with the following contents:
+ ```sky
+test_origin_url = "file:///path/to/private/dotfiles"
+test_destination_url = "file:///path/to/dotfiles-external"
+```
+3. Run `sh export-commits-test.sh`.
+
+[copybara]: https://github.com/google/copybara
diff --git a/.copybara/copy.bara.sky b/.copybara/copy.bara.sky
new file mode 100644
index 0000000..e6c9499
--- /dev/null
+++ b/.copybara/copy.bara.sky
@@ -0,0 +1,101 @@
+load("test_repos_config", "test_origin_url", "test_destination_url")
+
+def export_workflow(name, description, mode, authoring_value, is_test):
+ if not is_test:
+ origin_url = "https://gerrit.avm99963.com/a/private/dotfiles"
+ destination_url = "https://gerrit.avm99963.com/a/dotfiles-external"
+ else:
+ origin_url = test_origin_url
+ destination_url = test_destination_url
+
+ core.workflow(
+ name = name,
+ description = description,
+ origin = git.origin(
+ url = origin_url,
+ ref = "HEAD",
+ submodules = "NO",
+ ),
+ destination = git.destination(
+ url = destination_url,
+ push = "main",
+ ),
+ mode = mode,
+
+ origin_files = glob(
+ ["**"],
+ exclude = [
+ # Internal README
+ "README.md",
+
+ # Internal (dummy) license
+ "LICENSE",
+
+ # SSH configuration (it only includes the configuration for some
+ # hosts I connect to, which I don't want to be public).
+ "private_dot_ssh/**",
+
+ # .gitreview file only used for the private/dotfiles repo for the
+ # `git review` tool (https://docs.opendev.org/opendev/git-review/).
+ ".gitreview",
+ ],
+ ),
+
+ authoring = authoring_value,
+
+ transformations = [
+ core.rename('README.public.md', 'README.md'),
+ core.rename('LICENSE.public', 'LICENSE'),
+ core.replace(
+ before="private/dotfiles",
+ after="dotfiles-external",
+ paths = glob(
+ ["**"],
+ exclude = [".copybara/**"],
+ ),
+ ),
+ core.replace(
+ before = "${internalCode}",
+ after = "",
+ multiline = True,
+ regex_groups = {
+ },
+ ),
+ metadata.remove_label('Change-Id'),
+ ],
+ )
+
+export_workflow(
+ name = "firstExport",
+ description = "Moves code from the private repo (the SoT) to the public one. NOTE: This must only be used for the first migration.",
+ mode = "SQUASH",
+ authoring_value = authoring.overwrite("Copybara bot <copybara-bot@avm99963.com>"),
+ is_test = False,
+)
+
+export_workflow(
+ name = "exportCommits",
+ description = "Moves code from the private repo (the SoT) to the public one.",
+ mode = "ITERATIVE",
+ authoring_value = authoring.pass_thru("Copybara bot <copybara-bot@avm99963.com>"),
+ is_test = False,
+)
+
+# Local tests workflows
+export_workflow(
+ name = "firstExportTest",
+ description = "Test locally the first migration from the private repo to the public one. See README.md for more details.",
+ mode = "SQUASH",
+ authoring_value = authoring.overwrite("Copybara bot <copybara-bot@avm99963.com>"),
+ is_test = True,
+)
+
+export_workflow(
+ name = "exportCommitsTest",
+ description = "Test locally the migration from the private repo to the public one. See README.md for more details.",
+ mode = "ITERATIVE",
+ authoring_value = authoring.pass_thru("Copybara bot <copybara-bot@avm99963.com>"),
+ is_test = True,
+)
+
+# vim: set ft=bzl:
diff --git a/.copybara/export-commits-test.sh b/.copybara/export-commits-test.sh
new file mode 100755
index 0000000..57bba0a
--- /dev/null
+++ b/.copybara/export-commits-test.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+copybara copy.bara.sky exportCommitsTest --git-committer-email "copybara-bot@avm99963.com" --git-committer-name "Copybara bot"
diff --git a/.copybara/export-commits.sh b/.copybara/export-commits.sh
new file mode 100755
index 0000000..d710bf9
--- /dev/null
+++ b/.copybara/export-commits.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+copybara copy.bara.sky exportCommits --git-committer-email "copybara-bot@avm99963.com" --git-committer-name "Copybara bot"
diff --git a/.copybara/first-export-test.sh b/.copybara/first-export-test.sh
new file mode 100755
index 0000000..02a4807
--- /dev/null
+++ b/.copybara/first-export-test.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+copybara copy.bara.sky firstExportTest --force --git-committer-email "copybara-bot@avm99963.com" --git-committer-name "Copybara bot"
diff --git a/.copybara/first-export.sh b/.copybara/first-export.sh
new file mode 100755
index 0000000..9cbd6b5
--- /dev/null
+++ b/.copybara/first-export.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+copybara copy.bara.sky firstExport --force --git-committer-email "copybara-bot@avm99963.com" --git-committer-name "Copybara bot"