This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

About

git-search-replace is a small utility on top of plain \(git\) for performing project-wide search-and-replace only on git-controlled files. It applies its searches to filenames as well as their content. The underlying syntax for the search regex is Python’s.

It is designed to be a bit more instructive to the developer, compared to hackish \(bash\) scripts around \(sed\).

Key features are:

  • By default, only act as grep to show what is going to change.
  • Dry run mode ‘–diff’ shows a unidiff of the changes that the search-and-replace would do, so that the developer can review for correctness. No working directory files are modified.
  • Fix mode ‘–fix’ performs the actual changes and associated ‘git mv’.

Syntax

Usage: gsr [options] (FROM-SEPARATOR-TO…)

Options:
-h, --help show this help message and exit
-s STRING, --separator=STRING
 The separator string which separates FROM regex and TO expression
-f, --fix Perform changes in-place
-d, --diff Use ‘diff’ util to show differences

The expressions are tuples in the form of FROM-SEPARATOR-TO, with SEPARATOR defaults to ‘///’.

Examples

Shell escaping needs to be taken into consideration. The examples below should work with the major UNIX shells.

gsr old_name///new_name –diff

This shows a diff that represents the replacement of ‘old_name’ with ‘new_name’.

gsr \bold_name\b///new_name –fix

This uses Python regex expression b for matching at word boundaries for whole identifiers. This invocation will perform changes in-place because of ‘–fix’.

gsr ‘things with space///with other stuff’ –diff

Note that shells properly de-escape the commas from the expression above.

Release History

Release History

1.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
git-search-replace-1.0.2.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Mar 13, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting