Skip to main content

Search files over multiple Git repos, and extract a certain version

Project description

Copyright © 2018 Thomas Johannesmeyer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Description: # Tagsnag

Update master, checkout a version and extract a file from this specific version over multiple Git repositories in one CLI call.

## Prerequisites

Tagsnag uses Python 3.7 and requires Gitpython to be installed. You can install it using the provided Makefile:

`bash $ make init `

Or manually using pip:

`bash $ pip install gitpython `

## Run

To run tagsnag over all repositories in a directory enter the directory via shell. The whole set of commands can be found by calling –help.

## Updating repositories

Run git checkout master && git pull origin master on all repositories:

`bash python <path/to/tagsnag/main.py> --update `

## File extraction

`bash python <path/to/tagsnag/main.py> --tag=<tag>\ --filename=<filename>\ --extension=<filetype>\ --destination=<destination_path> `

The following sample will fuzzy search for a tag containing 1.0, check it out and search for a file of type .md containing the string readme in its name. This file will then be copied into the destination folder and be renamed to <repository_name>.md:

`bash $ python <path>/tagsnag/main.py\ --tag=1.0\ --filename=readme\ --extension=md\ --destination=./ReadmeFiles `

## Directory extraction

Instead of a filename, you can provide a directory name to extract. Tagsnag will copy the first directory it finds matching the name starting from root.

`bash python <path/to/tagsnag/main.py> --tag=<tag>\ --directory=<directory_name>\ --destination=<destination_path> `

### Run with XML file

  • For more configurability you can put an xml file into the folder containing the repos and run it:

`bash $ python <path/to/tagsnag/main.py> --xml=<path/of/xml_file> `

## Authors

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Support

The framework and code is provided as-is, but if you need help or have suggestions, you can contact me anytime at [opensource@geeky.gent](mailto:opensource@geeky.gent?subject=Pinachtsbaum).

## I’d like to hear from you

If you have got any suggestions, please feel free to share them with me. :)

Platform: UNKNOWN Classifier: Programming Language :: Python :: 3 Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Description-Content-Type: text/markdown

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Tagsnag-0.8.0.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file Tagsnag-0.8.0.tar.gz.

File metadata

  • Download URL: Tagsnag-0.8.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for Tagsnag-0.8.0.tar.gz
Algorithm Hash digest
SHA256 8ab6b97ce200b34100c37c3f11a4c5230bf4ae20dacbdd334d6cddf4797db011
MD5 f20f3f22d8ec9277e2bfa963765b9583
BLAKE2b-256 1e3a51625f8892c83275ee59a43fbb41d409d989ea7333aa608baa3ed8250981

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page