<commit_before># Gerritfs

This gem allows to mount a gerrit as a filesystem. It aims to improve UX to operate reviews.

Usage
-----

```
mkdir /tmp/gerrit
bin/mount /tmp/gerrit gerrit.yml
```

where gerrit.yml contains:

```
base_url: http://gerrit.mydomain
username: a.username
password: <PASSWORD> # see your preference on gerrit web interface
```

Tree mapping (intent, most of it not implemented yet)
------------

- [x] **/my** contains a list of reviews grouped by projects and a file named **dashboard**
- [x] **/my/dashboard** contains a small recap of all reviews with their status (score, verified)
- [x] **/my/[group]\_[project]/** contains a folder per review
- [x] **/projects/[group]\_[project]/** contains a clone of the project allowing easy browsing.

A review directory contains:
- [ ] **_INFO**: all metadata linked to the review (author, reviewers, scores)
- [ ] all patched files (including the commit message, named commit). Content of those file is not clear yet.
- [x]  The diff can be seen by opening the hidden files with the basename prefixed by `.0_` and `.1_`. See alias section.
- [ ] **_DISCUSSION**: a summary of the discussion so far
- [ ] **_REVIEW.tmp**: a temporary file listing all comments not published so far

[ ] Moving \_REVIEW.tmp to REVIEW should publish the comments to gerrit.

Comments are display inline with a header line: "Comment by xxx yyyy".
Comments can be added by writing content on a new line after the line it refers to.

Of course this interface is going to change before being stabilized.

Status
------

- [x] list all repositories
- [x] list all reviews
- [x] basic "my" dashboard
- [x] can read reviews
- [x] can draft comments
- [ ] can submit reviews (with score)


Aliases
-------

To see the diff of a file in a review, you can use the following function:
```
review() {
  for f in $@; do
    dir=$(dirname $f)
    name=$(basename $f)
    echo Reviewing $name
    vimdiff $dir/.0_$name $dir/.$(cat $dir/CURRENT_REVISION)_$name
  done
}
```
<commit_msg>Update README.md again<commit_after># Gerritfs

This gem allows to mount a gerrit as a filesystem. It aims to improve UX to operate reviews.

The original reasons to build this filesystem are:
- efficiency. I am more efficient in my $EDITOR than in a web browser
- avoid annoyances. Gerrit web UI catches my keys and prevents me to use my regular shortcuts

Usage
-----

```
mkdir /tmp/gerrit
bin/mount /tmp/gerrit gerrit.yml
```

where gerrit.yml contains:

```
base_url: http://gerrit.mydomain
username: a.username
password: <PASSWORD> # see your preference on gerrit web interface
```

Tree mapping (ticked if implemented)
------------

- [x] **/my** contains a list of reviews grouped by projects and a file named **dashboard**
- [x] **/my/dashboard** contains a small recap of all reviews with their status (score, verified)
- [x] **/my/[group]\_[project]/** contains a folder per review
- [x] **/projects/[group]\_[project]/** contains a clone of the project allowing easy browsing.

A review directory contains:
- [ ] **_INFO**: all metadata linked to the review (author, reviewers, scores)
- [ ] all patched files (including the commit message, named commit). Content of those file is not clear yet.
- [x]  The diff can be seen by opening the hidden files with the basename prefixed by `.0_` and `.1_`. See alias section.
- [ ] **_DISCUSSION**: a summary of the discussion so far
- [ ] **_REVIEW.tmp**: a temporary file listing all comments not published so far
- [x] **CURRENT_REVISION**: file containing the legacy id of the current revision

[ ] Moving \_REVIEW.tmp to REVIEW should publish the comments to gerrit.

Comments are display inline with a header line: "Comment by xxx yyyy".
Comments can be added by writing content on a new line after the line it refers to.

Of course this interface is going to change before being stabilized.

Status
------

- [x] list all repositories
- [x] list all reviews
- [x] basic "my" dashboard
- [x] can read reviews
- [x] can draft comments
- [ ] can submit reviews (with score)


Aliases
-------

To see the diff of a file in a review, you can use the following function:
```
review() {
  for f in $@; do
    dir=$(dirname $f)
    # keep the same current through the review
    current=${current:-$(cat $dir/CURRENT_REVISION)}
    name=$(basename $f)
    echo Reviewing $name
    vimdiff $dir/.0_$name $dir/.${current}_$name
  done
}
```

{'fraction_non_alphanumeric': 0.11695376246600181, 'fraction_numerical': 0.0013599274705349048, 'mean_word_length': 3.563598759048604, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5336205', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1260, 'n_words': 614}