3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-17 08:30:35 +02:00

Update README file with more detailed instructions

This commit is contained in:
Nils Wentzell 2019-08-27 15:35:04 -04:00
parent 180d062846
commit 3c94a87ca6

View File

@ -5,35 +5,68 @@
A skeleton for a TRIQS application A skeleton for a TRIQS application
---------------------------------- ----------------------------------
To adapt this skeleton for a new triqs application, the following steps are necessary: **Caution**: The following instructions require the `util-linux` rename command.
Please confirm that you have the right version by running `rename --version`.
For the Perl rename command see instructions in the following section.
To adapt this skeleton for a new TRIQS application, the following steps are necessary:
* Create a repository, e.g. https://github.com/myuser/mynewapp * Create a repository, e.g. https://github.com/myuser/mynewapp
* Run the following commands (replacing myuser and mynewapp accordingly) * Run the following commands in order after replacing myuser, mynewapp and MYNEWAPP accordingly
```bash ```bash
git clone https://github.com/triqs/app4triqs --branch unstable mynewapp github_username=myuser
cd mynewapp app_name=mynewapp
git remote set-url origin https://github.com/myuser/mynewapp capital_name=MYNEWAPP
find . -type f | grep -v .git | xargs sed -i 's/app4triqs/mynewapp/g; s/APP4TRIQS/MYNEWAPP/g'
find . -type d | grep -v .git | xargs rename app4triqs mynewapp git clone https://github.com/triqs/app4triqs --branch unstable ${app_name}
find . -type f | grep -v .git | xargs rename app4triqs mynewapp cd ${app_name}
git add -A git reset $(git commit-tree HEAD\^{tree} -m "Create ${app_name} from github.com/triqs/app4triqs skeleton")
git commit -m "Create mynewapp from github.com/triqs/app4triqs skeleton" git merge --allow-unrelated-histories -s ours HEAD@{1} -m "Track app4triqs skeleton"
git push find . -type f | grep -v .git | xargs sed -i 's/app4triqs/${app_name}/g; s/APP4TRIQS/${capital_name}/g'
find . -type d | grep -v .git | xargs rename app4triqs ${app_name}
find . -type f | grep -v .git | xargs rename app4triqs ${app_name}
git add -A && git commit -m "Adjust app4triqs skeleton for ${app_name}"
git remote set-url origin https://github.com/${github_username}/${app_name}
git remote add app4triqs_remote https://github.com/triqs/app4triqs
git remote update && git remote prune origin
``` ```
Depending on which version of the rename command you are using you may You can now push to your github repository
need to replace the aforementioned rename commands as follows
```bash ```bash
find . -type d | grep -v .git | xargs rename 's/app4triqs/mynewapp/' git push origin unstable
find . -type f | grep -v .git | xargs rename 's/app4triqs/mynewapp/'
``` ```
Perl rename command
-------------------
If you are using the Perl-based rename command you will need to
```bash
find . -type d | grep -v .git | xargs rename 's/app4triqs/${app_name}/'
find . -type f | grep -v .git | xargs rename 's/app4triqs/${app_name}/'
```
Github SSH interface
--------------------
If you prefer to use the SSH interface to the remote repository, If you prefer to use the SSH interface to the remote repository,
replace the http link accordingly replace the http link accordingly
``` ```
https://github.com/myuser/mynewapp --> git@github.com:myuser/mynewapp https://github.com/myuser/mynewapp --> git@github.com:myuser/mynewapp
``` ```
Merging app4triqs skeleton updates
----------------------------------
You can merge future changes to app4triqs into your project with the following commands
```bash
git remote update
git merge app4triqs_remote -m "Merge latest app4triqs skeleton changes"
```
If you should encounter any conflicts resolve them and `git commit`.