JUST-IMPORT-GIT(1)

πŸ’… JUST-IMPORT-GIT(1) β€” the girlies' guide to importing a Git repo

okay so bestie, this is just-import-git, living in the General Commands Manual (section 1, obviously, she's a command πŸ’…). She takes one (1) Git repository and yeets it into a multi-repository configuration. That's the whole gig. Let's get into it 🫢


✨ SYNOPSIS ✨

just-import-git [OPTION]...  URL [foreign repository name]

🌸 DESCRIPTION 🌸

So here's the situation. You've got an existing just-mr-repository-config(5) and you want to extend it by adding one Git repository to it. That's literally her whole job. πŸ’–

But wait β€” it's giving thorough. Because when she adds that repository, the dependencies declared in the imported repository come along for the ride too. And the "file" repositories? They get transformed into "subdir" parts of the imported repository. Which slays, because it solves a real problem: a repository can only refer to itself as "." in a portable way (iconic of her, honestly). But the importing party β€” that's you β€” always knows the URL you're importing from. iykyk.

Now, the ✨drama✨ of naming. All the imported repositories get renamed so that no conflicts pop off with repositories that are already present. And the ones that got pulled in as dependencies? They get named in a way that reminds you which repository they came in as a dependency for. Obsessed with the thoughtfulness honestly. πŸŽ€

And this renaming is taken into account at all the places where repositories are referred to, bestie. Every single one. That means the "bindings" field, and also roots that are defined by reference to other repositories. No stragglers, no cap.

Heads up though: only the main parts of repositories are imported β€” "repository", "bindings", names, and roots. The "pragma" part? Dropped. Unknown fields? Also dropped. Gone. Not invited to the function. πŸ’€

You specify the repository you want to import by its URL.

Oh and the resulting configuration? Printed on standard output. That's your output, bestie, right there. πŸ“€


✨ OPTIONS ✨

  • --as NAME β€” Pick the name you want the imported repository to have in the final configuration. If you don't specify it, it defaults to the name the repository has in the configuration file of the repository being imported. And either way? The name gets amended if it conflicts with a name that's already there β€” no name collisions allowed at this sleepover. πŸ›‘
  • -b BRANCH β€” The branch in the imported repository to use. And yes, this same branch is also recorded as the branch to follow. Defaults to master. πŸ‘‘
  • -C CONFIGFILE β€” Use this specific file as the configuration to import into. Cute lil detail: the string - is treated as "please take the config from stdin" β€” so if you actually want a file literally called -, you have to write it as ./-, or something similar. If you don't specify this option at all, a config file is searched for in the exact same way just-mr does when it's invoked with --norc. 🧚
  • -h, --help β€” Outputs a usage message and dips. Exit stage left. 🌈
  • --map THEIRS OURS β€” Maps repositories from the imported configuration onto ones that already exist. Those repositories are not imported (and tbh the search for their transitive dependency is omitted too πŸ’€) β€” instead, the already-existing repository you specified gets used. This is the move when a sufficiently compatible repository already exists in your configuration. Reuse queen. ♻️
  • -R RELPATH β€” Use the file specified by this path, relative to the repository root, as the multi-repository specification in the imported repository. If you don't give it, a config file is searched for in the same way just-mr does when invoked with --no-rc β€” except it leaves out the searches relative to the global roots (home and system). So like, in other words: repos.json and etc/repos.json are tried if this option isn't given. πŸ“
  • --plain β€” Pretends the foreign multi-repository specification is the canonical one for a single repository. Useful when the repository you want to import doesn't have a repository configuration at all, or when you want it imported without dependencies. Solo era. πŸ™ˆ
  • --absent β€” Adds the pragma {"absent": true} to all imported repositories. Every last one. πŸ«₯
  • --mirror URL β€” Provides an alternative fetch location for the imported repository. Specify this option multiple times and the URLs accumulate β€” in the order they appear on the command line, bestie, so order matters. And here's the thing: these URLs are not used during the import. They just get recorded as the value of the "mirrors" key in the resulting configuration of the imported repository. See just-mr-repository-config(5). πŸͺž
  • --inherit-env VAR β€” For the imported repository, specifies environment variables to be inherited when fetching the repository by calling git. These variables are not taken into account during the import (where the whole environment is inherited, no filter 😭) β€” instead they get recorded as the value for the "inherit env" key in the resulting configuration of the imported repository. See just-mr-repository-config(5). 🌿

πŸ‘€ See also πŸ‘€


aaaand that's the whole page, bestie πŸ’œ that was JUST-IMPORT-GIT(1) from the General Commands Manual, so you know exactly where to find her again. go forth and import responsibly, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from