Skip to content

Commit 9940321

Browse files
committed
ReadMe, help msgs, changed config folder on Linux #30
1 parent 49df4fc commit 9940321

File tree

8 files changed

+104
-95
lines changed

8 files changed

+104
-95
lines changed

README.md

Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ The code analysis is non-judgemental. It simply collects the facts such as what
1313
- [Making your profile public](#making-your-profile-public)
1414
- [Using StackMuncher app on multiple machines](#using-stackmuncher-app-on-multiple-machines)
1515
- [Detailed usage instructions](#detailed-usage-instructions)
16-
- [Additional options](#additional-options)
1716
- [Processing settings](#processing-settings)
1817
- [Profile settings](#profile-settings)
1918
- [Debug settings](#debug-settings)
2019
- [Additional info](#additional-info)
2120
- [Limitations](#limitations)
2221
- [Troubleshooting](#troubleshooting)
22+
- [Building from source](#building-from-source)
2323
- [Bug reports and contributions](#bug-reports-and-contributions)
2424

2525
## Privacy
@@ -40,26 +40,23 @@ The app creates a sample stack report on the first run over a project without su
4040

4141
_This is an alpha release and the only way to run this app is to compile it from the source in Rust._
4242

43-
Assuming that you have Git and a [Rust toolchain](https://www.rust-lang.org/tools/install) installed, just clone and run the app:
43+
1. Download the latest binary from GitHub
44+
* Linux (GNU): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-unknown-linux-gnu && sudo chmod 755 /usr/bin/stackmuncher`
45+
* Linux (MUSL): `sudo curl -o /usr/bin/stackmuncher -L https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-unknown-linux-musl && sudo chmod 755 /usr/bin/stackmuncher`
46+
* Windows: `invoke-webrequest -uri https://github.com/stackmuncher/stm_app/releases/download/v0.1.3/stackmuncher-x86_64-pc-windows-msvc.exe -outfile $env:windir\stackmuncher.exe`
47+
2. Change the current directory to one of your projects with a Git repository (has _.git_ subfolder) and run:
48+
* Linux: `stackmuncher`
49+
* Windows PowerShell: `.\stackmuncher.exe`
4450

45-
```bash
46-
git clone https://github.com/stackmuncher/stm_app.git
47-
cd stm_app
48-
cargo run -- --project "path_to_any_of_your_local_projects"
49-
```
50-
51-
The app will access `.git` folder inside `path_to_any_of_your_local_projects` directory and create an anonymous profile with your first report on _stackmuncher.com_. Add `--dryrun` flag to generate a report without creating a profile or submitting any data to the Directory. Look at the log printed by the app for details if you want to examine the prepared report.
52-
53-
The **default config** of the app assumes that it is run on a development machine from the root folder of a repository you made commits to.
51+
The app will access the local Git repository for the current directory and create a stack report, but will NOT submit any data to the Directory to let you review the stack report first. It will start updating your profile on subsequent runs unless `--dryrun` flag is used.
5452

5553
**Example**
5654

57-
I made commits to `~/rust/quickxml_to_serde` project recently and want to test StackMuncher app on it:
55+
I made commits to `~/rust/xml_to_serde` project recently and now want to test StackMuncher app on it:
5856
```shell
59-
~/rust/stm_app$ cargo run -- --project "~/rust/quickxml_to_serde" --log error
60-
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
61-
Running `target/debug/stackmuncher --project '~/rust/quickxml_to_serde' --log error`
62-
Stack report: /home/ubuntu/rust/stm_app/reports/home_ubuntu_rust_quickxml_to_serde_git_9a32520d
57+
~$ cd rust/xml_to_serde
58+
~/rust/xml_to_serde$ stackmuncher
59+
Stack report: /var/tmp/stackmuncher/reports/home_ubuntu_rust_xml_to_serde_git_9a32520d
6360
Directory profile: https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK
6461

6562
```
@@ -84,7 +81,7 @@ Find out what email addresses were used in commits to `xml_to_serde` repo:
8481
_mx_ and _rimutaka_ are the same person. Let's add both emails to StackMuncher config using `--email` parameter:
8582

8683
```shell
87-
~/rust/stm_app$ cargo run -- config --emails "max@onebro.me, rimutaka@onebro.me"
84+
~/$ stackmuncher config --emails "max@onebro.me, rimutaka@onebro.me"
8885

8986
Primary email: max@onebro.me
9087
Commit emails: max@onebro.me, rimutaka@onebro.me
@@ -93,18 +90,17 @@ _mx_ and _rimutaka_ are the same person. Let's add both emails to StackMuncher c
9390
Public profile: not set
9491
GitHub validation: not set
9592

96-
Local stack reports: /home/ubuntu/rust/stm_app/reports/home_ubuntu_rust_stm_app_6213a4b2
97-
Config file: /home/ubuntu/rust/stm_app/.stm_config/config.json
93+
Local stack reports: /var/tmp/stackmuncher/reports/home_ubuntu_rust_stm_app_6213a4b2
94+
Config file: /home/ubuntu/.stm_config/config.json
9895
```
9996
The app stored two emails from `--emails` param in its config file and printed its full config info (`config` command). From now on it will look for commits from _max@onebro.me_ and _rimutaka@onebro.me_.
10097

10198
## Adding more projects to your profile
10299

103100
Adding more of your projects to your Directory Profile builds a more complete picture of your skills. StackMuncher can be configured to keep your profile current as you write and commit more code:
104101

105-
1. Build the app with `cargo build --release` from `stm_app` folder.
106-
2. Add the full absolute path of `stm_app/target/release` folder to `PATH` environment variable. E.g. `echo 'export PATH="$HOME/rust/stm_app/target/release:$PATH"' >> ~/.profile` + log off/on or restart.
107-
3. Check if you have Git hooks already configured: `git config --get-all init.templatedir`
102+
1. Make sure `stackmuncher` executable is placed in a folder included in `PATH` environment variable or add its folder to `PATH`.
103+
2. Check if you have Git hooks already configured: `git config --get-all init.templatedir`
108104
* _the query returned a value_ - edit your post-commit templates manually
109105
* _the query returned nothing_ - add a [post-commit Git hook](https://git-scm.com/docs/githooks#_post_commit):
110106
```bash
@@ -113,7 +109,7 @@ Adding more of your projects to your Directory Profile builds a more complete pi
113109
echo 'stackmuncher --log info 2>&1 >> ~/.stm.log' >> ~/.git-templates/hooks/post-commit
114110
chmod a+x ~/.git-templates/hooks/post-commit
115111
```
116-
4. Run `git init` on your existing repos to add the hook from the template.
112+
3. Run `git init` on your existing repos to add the hook from the template.
117113
* Any new repos or clones will get the hook added by default.
118114
* Repos with an existing `hooks/post-commit` file can have the hook added with `echo 'stackmuncher --log info 2>&1 >> ~/.stm.log' >> .git/hooks/post-commit`. Run it from the root of the project folder.
119115

@@ -123,7 +119,10 @@ You can skip adding the Git hook and run `stackmuncher` from the root of any of
123119

124120
## Making your profile public
125121

126-
Public profiles are searchable by employers looking for software developers. Your public profile will be created with the same login and personal details as your GitHub profile.
122+
**Anonymous profiles** are identified by a public key from the key-pair generated by the app on the first run. E.g. https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK
123+
The profile can be viewed by anyone with the link, but it cannot be discovered otherwise.
124+
125+
**Public profiles** are searchable by employers looking for software developers. Your public profile will be created with the same login and personal details as your GitHub profile.
127126

128127
E.g. https://stackmuncher.com/rimutaka has _contact details_ and _public projects_ from https://github.com/rimutaka as well as _private projects_ from https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK.
129128

@@ -133,40 +132,35 @@ E.g. https://stackmuncher.com/rimutaka has _contact details_ and _public project
133132

134133
## Using StackMuncher app on multiple machines
135134

136-
1. Clone this repo onto a 2nd machine
137-
2. Run `cargo run -- config` to bootstrap the app
135+
1. Download `stackmuncher` executable to a 2nd machine
136+
2. Run `stackmuncher config` on both machines to see the location of config folders
138137
3. Copy-paste the contents of `.stm_config/config.json` and `.stm_config/key.txt` from the 1st to the 2nd machine
139138

140-
The 2nd machine will be connected to the same Developer Profile as the first one for as long as they share the same _key.txt_ file. If you loose the key file the app will generate a new one and create a new Developer Profile. Contact us on info@stackmuncher.com to merge the old profile into the new one.
139+
The 2nd machine will be connected to the same Developer Profile as the first one for as long as they share the same _key.txt_ and _config.json_ files. If you loose the key file the app will generate a new one and create a new Developer Profile. Contact us on info@stackmuncher.com to merge the old profile into the new one.
141140

142141
## Detailed usage instructions
143142

144-
Running `stackmuncher` without any additional params generates a report for the project in the current working directory and updates your developer profile.
145-
146-
Anonymous profiles are identified by a public key from the key-pair generated by the app on the first run. E.g. https://stackmuncher.com/?dev=9PdHabyyhf4KhHAE1SqdpnbAZEXTHhpkermwfPQcLeFK
147-
The key is located in the app's config folder and can be copied to another machine to connect to the same developer profile. Run `stackmuncher config` command to see the exact location of the config folder.
143+
Running `stackmuncher` without any additional params generates a report for the project in the current working directory and updates your Developer Profile.
148144

149-
### Additional options
150-
151-
Some of the app's settings are cached in a local config file and only need to be set once. You can set, change or unset them via CLI params or by editing the config file directly.
145+
Some of the app's settings are cached in a local config file and only need to be set once. You can set, change or unset them via CLI params or by editing _.stm_config/config.json_ file directly.
152146
153147
#### Processing settings
154148
155-
* `--emails "me@example.com,me@google.com"` : a list of your email addresses using in commits to include the report. Defaults to `git config user.email`. Run `git shortlog -s -e --all` to check if you made commits under other email addresses. Set once.
156-
* `--project "path_to_project_to_be_analyzed"`: an optional relative or absolute path to the project/repo to generate a report for, defaults to the current working directory.
149+
* `--emails "me@example.com,me@google.com"` : a list of your email addresses used in commits to to be analyzed. Defaults to `git config user.email`. Run `git shortlog -s -e --all` to check if you made commits under other email addresses. _Set once._
150+
* `--project "path_to_project_to_be_analyzed"`: an optional relative or absolute path to the project/repo to analyze, defaults to the current working directory.
157151
* `--dryrun`: tells the app to generate a report, save it locally, but not upload anything to the Directory.
158152
159153
Example:
160154
```shell
161155
~$ stackmuncher --project "~/rust/stm_server" --emails "max@onebro.me, rimutaka@onebro.me" --dryrun
162156
163-
Stack report: /home/ubuntu/rust/stm_app/reports/home_ubuntu_rust_stm_server_a8ff58d9
157+
Stack report: /var/tmp/stackmuncher/reports/home_ubuntu_rust_stm_server_a8ff58d9
164158
Directory Profile update skipped: `--dryrun` flag.
165159
```
166160
167161
#### Profile settings
168162
169-
* `--primary_email "me@example.com"`: an optional email address for Directory notifications only. Defaults to `git config user.email`. Set once.
163+
* `--primary_email "me@example.com"`: an optional email address for Directory notifications only. Defaults to `git config user.email`. _Set once._
170164
171165
Example:
172166
```shell
@@ -179,27 +173,27 @@ Example:
179173
Public profile: https://stackmuncher.com/rimutaka
180174
GitHub validation: https://gist.github.com/rimutaka/fb8fc0f87ee78231f064131022c8154a
181175
182-
Local stack reports: /home/ubuntu/rust/stm_app/reports
183-
Config file: /home/ubuntu/rust/stm_app/.stm_config/config.json
176+
Local stack reports: /var/tmp/stackmuncher/reports
177+
Config file: /home/ubuntu/.stm_config/config.json
184178
```
185179
186180
#### Debug settings
187181
188182
* `--log error|warn|info|debug|trace`: the log is written to _stdout_. Defaults to `error` for least verbose output. Redirect the output to a file or _null device_ to completely silence it. E.g. `stackmuncher --log debug >> ~/stm_trace.log`
189-
* `--reports "path to reports folder"`: a path to an alternative location for saving stack reports. The path can be relative or absolute. Defaults to the application folder.
190-
* `--config "path to config folder"`: a path to an alternative location of the config folder. The path can be relative or absolute. Defaults to the application folder.
183+
* `--reports "path to reports folder"`: a path to an alternative location for saving stack reports. The path can be relative or absolute. Defaults to a platform-specific user-data location.
184+
* `--config "path to config folder"`: a path to an alternative location of the config folder. The path can be relative or absolute. Defaults to a platform-specific user-data location.
191185
192186
#### Additional info
193187
194-
* `stackmuncher help`: displays usage info
188+
* `stackmuncher help`: displays usage info.
195189
* `stackmuncher config`: display the contents of the config file and its location. The config file can be edited manually.
196190
197191
## Limitations
198192
199193
_The current version of the app is at alpha-stage and should be used for testing purposes only._
200194
201195
1. Only a small number of computer languages are recognized.
202-
2. The app may include private library names in the report - do not use it on commercially-sensitive projects.
196+
2. The app may unintentionally include private library names in the report - do not use it on commercially-sensitive projects.
203197
3. The only way to delete a profile is to email info@stackmuncher.com.
204198
4. It may take up to 2 minutes for a profile to be created/updated after a report submission.
205199
5. Very large reports (over 50MB) are likely to be rejected.
@@ -219,10 +213,20 @@ We want to hear about as many issues users run into as possible. Copy-paste the
219213
* look through the log it printed for clues
220214
* run `stackmuncher config` and check the output in `reports` folder - there should be at least 4 files:
221215
* _project_report.json_: includes all contributors
222-
* _combined_report.json_: a combined report for authors/committers from Git's `user.email` setting and from `--emails` param
216+
* _combined_report.json_: a combined report for authors/committers from Git's `user.email` setting or from `--emails` param
223217
* _submission.json_: a sanitized version of the combined report exactly as it is submitted to the Directory
224218
* _contributor_xxxxxxxx.json_: cached reports for individual contributors
225219

220+
## Building from source
221+
222+
Assuming that you have Git and a [Rust toolchain](https://www.rust-lang.org/tools/install) installed, just clone the repo and run the app:
223+
224+
```bash
225+
git clone https://github.com/stackmuncher/stm_app.git
226+
cd stm_app
227+
cargo run -- --project "path_to_any_of_your_local_projects"
228+
```
229+
226230
## Bug reports and contributions
227231

228232
File an issue via https://github.com/stackmuncher/stm_app/issues or email the maintainer on info@stackmuncher.com.

distro/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ deb builds rely on [cargo-deb](https://crates.io/crates/cargo-deb) crate. See co
3131

3232
## Windows
3333

34-
The current MSIX config produces a *full trust* Windows App, which should be *partial trust* with only local folder access. See https://github.com/stackmuncher/stm/issues/11
34+
The current MSIX config produces a *full trust* Windows App, which should be *partial trust* with only local folder access. See https://github.com/stackmuncher/stm_app/issues/11
3535

3636
Windows building and packaging steps:
3737

stackmuncher/Cargo.toml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.3"
44
authors = ["rimutaka <max@onebro.me>"]
55
edition = "2018"
66
homepage = "https://stackmuncher.com"
7-
repository = "https://github.com/stackmuncher/stm"
7+
repository = "https://github.com/stackmuncher/stm_app"
88
license = "GPL-3.0-or-later"
99
description = "A static code analysis app for reporting on amount and type of code produced by looking at git commits."
1010

@@ -41,15 +41,5 @@ assets = [
4141
"../target/release/stackmuncher",
4242
"usr/bin/",
4343
"755",
44-
],
45-
[
46-
"../stm_rules/file_types/*",
47-
"usr/share/stackmuncher/stm_rules/file_types/",
48-
"644",
49-
],
50-
[
51-
"../stm_rules/munchers/*",
52-
"usr/share/stackmuncher/stm_rules/munchers/",
53-
"644",
54-
],
44+
]
5545
]

0 commit comments

Comments
 (0)