Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jjdescription line ignore match is "JJ: " with a required space character #5004

Closed
nekopsykose opened this issue Nov 29, 2024 · 1 comment · Fixed by #5023
Closed

jjdescription line ignore match is "JJ: " with a required space character #5004

nekopsykose opened this issue Nov 29, 2024 · 1 comment · Fixed by #5023
Labels
🐛bug Something isn't working

Comments

@nekopsykose
Copy link

Description

(not really a bug, but more of a question)

as far as i can tell, this has been the behaviour all the way since it was introduced in f96130d

is there a reason why the space is required? i feel like just JJ: would make more sense as a match, and then a line with just JJ:(no space) on it would also get ignored, whereas currently the lack of space puts a literal JJ: into the description. it would also somewhat match git, where a mere # ignores the rest of the line (unless the core.commentChar/commentString is changed, of course)

as an aside, the comment prefix in https://github.com/kareigu/tree-sitter-jjdescription/blob/23dd3dd18ee29bdd761642511aa314215801afd8/grammar.js#L4 gets this wrong; but rather than just go fix it there straight away (by adding a space, i guess), i was wondering if there was a reason why the space is required at all, hence this question first :)

Steps to Reproduce the Problem

  1. put JJ: without a space into the editor in jj edit

Expected Behavior

it ignores the line

Actual Behavior

it expects a trailing space, so it doesn't, and a literal JJ: is left in the description

Specifications

  • Platform: linux
  • Version: 0.23.0
@PhilipMetzger PhilipMetzger added the 🐛bug Something isn't working label Nov 30, 2024
@martinvonz
Copy link
Owner

I don't think I had a good reason for it. I suspect I required the space because all lines we insert into the commit message start with the JJ: prefix (including the space). So I think it's that way on purpose, but I'm happy to change it.

martinvonz added a commit that referenced this issue Dec 4, 2024
We currently ignore lines prefixed with "JJ: " (including the space)
in commit messages and in the list of sparse paths from `jj sparse
edit`. I think I included the trailing space in the prefix simply
because that's how we render comments line we insert before we ask the
user to edit the file. However, as #5004 says, Git doesn't require a
space after their "#" prefix. Neither does Mercurial after their "HG:"
prefix. So let's follow their lead and not require the trailing
space. Seems useful especially for people who have their editor
configured to strip trailing spaces.
martinvonz added a commit that referenced this issue Dec 4, 2024
We currently ignore lines prefixed with "JJ: " (including the space)
in commit messages and in the list of sparse paths from `jj sparse
edit`. I think I included the trailing space in the prefix simply
because that's how we render comments line we insert before we ask the
user to edit the file. However, as #5004 says, Git doesn't require a
space after their "#" prefix. Neither does Mercurial after their "HG:"
prefix. So let's follow their lead and not require the trailing
space. Seems useful especially for people who have their editor
configured to strip trailing spaces.
martinvonz added a commit that referenced this issue Dec 4, 2024
We currently ignore lines prefixed with "JJ: " (including the space)
in commit messages and in the list of sparse paths from `jj sparse
edit`. I think I included the trailing space in the prefix simply
because that's how we render comments line we insert before we ask the
user to edit the file. However, as #5004 says, Git doesn't require a
space after their "#" prefix. Neither does Mercurial after their "HG:"
prefix. So let's follow their lead and not require the trailing
space. Seems useful especially for people who have their editor
configured to strip trailing spaces.
tmeijn pushed a commit to tmeijn/dotfiles that referenced this issue Dec 5, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [martinvonz/jj](https://github.com/martinvonz/jj) | minor | `v0.23.0` -> `v0.24.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>martinvonz/jj (martinvonz/jj)</summary>

### [`v0.24.0`](https://github.com/martinvonz/jj/releases/tag/v0.24.0)

[Compare Source](martinvonz/jj@v0.23.0...v0.24.0)

##### Breaking changes

-   `jj move` has been removed. It was deprecated in 0.16.0.

-   `jj checkout` and the built-in alias `jj co` have been removed.
    It was deprecated in 0.14.0.

-   `jj merge` has been removed. It was deprecated in 0.14.0.

-   `jj git push` no longer pushes new bookmarks by default. Use `--allow-new` to
    bypass this restriction.

-   Lines prefixed with "JJ:" in commit descriptions and in sparse patterns (from
    `jj sparse edit`) are now stripped even if they are not immediately followed
    by a space. [#&#8203;5004](martinvonz/jj#5004)

##### Deprecations

##### New features

-   Templates now support the `==` and `!=` logical operators for `Boolean`,
    `Integer`, and `String` types.

-   New command `jj absorb` that moves changes to stack of mutable revisions.

-   New command `jj util exec` that can be used for arbitrary aliases.

-   `jj rebase -b` can now be used with the `--insert-after` and `--insert-before`
    options, like `jj rebase -r` and `jj rebase -s`.

-   A preview of improved shell completions was added. Please refer to the
    [documentation](https://martinvonz.github.io/jj/latest/install-and-setup/#command-line-completion)
    to activate them. They additionally complete context-dependent, dynamic values
    like bookmarks, aliases, revisions, operations and files.

-   Added the config setting `snapshot.auto-update-stale` for automatically
    running `jj workspace update-stale` when applicable.

-   `jj duplicate` now accepts `--destination`, `--insert-after` and
    `--insert-before` options to customize the location of the duplicated
    revisions.

-   `jj log` now displays the working-copy branch first.

-   New `fork_point()` revset function can be used to obtain the fork point
    of multiple commits.

-   The `tags()` revset function now takes an optional `pattern` argument,
    mirroring that of `bookmarks()`.

-   Several commands now support `-f/-t` shorthands for `--from/--to`:
    -   `diff`
    -   `diffedit`
    -   `interdiff`
    -   `op diff`
    -   `restore`

-   New `ui.conflict-marker-style` config option to change how conflicts are
    materialized in the working copy. The default option ("diff") renders
    conflicts as a snapshot with a list of diffs to apply to the snapshot.
    The new "snapshot" option renders conflicts as a series of snapshots, showing
    each side and base of the conflict. The new "git" option replicates Git's
    "diff3" conflict style, meaning it is more likely to work with external tools,
    but it doesn't support conflicts with more than 2 sides.

-   New `merge-tools.<TOOL>.conflict-marker-style` config option to override the
    conflict marker style used for a specific merge tool.

-   New `merge-tools.<TOOL>.merge-conflict-exit-codes` config option to allow a
    merge tool to exit with a non-zero code to indicate that not all conflicts
    were resolved.

-   `jj simplify-parents` now supports configuring the default revset when no
    `--source` or `--revisions` arguments are provided with the
    `revsets.simplify-parents` config.

##### Fixed bugs

-   `jj config unset <TABLE-NAME>` no longer removes a table (such as `[ui]`.)

##### Contributors

Thanks to the people who made this release happen!

-   Austin Seipp ([@&#8203;thoughtpolice](https://github.com/thoughtpolice))
-   Benjamin Tan ([@&#8203;bnjmnt4n](https://github.com/bnjmnt4n))
-   Daniel Ploch ([@&#8203;torquestomp](https://github.com/torquestomp))
-   Emily ([@&#8203;neongreen](https://github.com/neongreen))
-   Essien Ita Essien ([@&#8203;essiene](https://github.com/essiene))
-   Herman J. Radtke III ([@&#8203;hjr3](https://github.com/hjr3))
-   Ilya Grigoriev ([@&#8203;ilyagr](https://github.com/ilyagr))
-   Joaquín Triñanes ([@&#8203;JoaquinTrinanes](https://github.com/JoaquinTrinanes))
-   Lars Francke ([@&#8203;lfrancke](https://github.com/lfrancke))
-   Luke Randall ([@&#8203;lukerandall](https://github.com/lukerandall))
-   Martin von Zweigbergk ([@&#8203;martinvonz](https://github.com/martinvonz))
-   Nathanael Huffman ([@&#8203;nathanaelhuffman](https://github.com/nathanaelhuffman))
-   Philip Metzger ([@&#8203;PhilipMetzger](https://github.com/PhilipMetzger))
-   Remo Senekowitsch ([@&#8203;senekor](https://github.com/senekor))
-   Robin Stocker ([@&#8203;robinst](https://github.com/robinst))
-   Scott Taylor ([@&#8203;scott2000](https://github.com/scott2000))
-   Shane Sveller ([@&#8203;shanesveller](https://github.com/shanesveller))
-   Tim Janik ([@&#8203;tim-janik](https://github.com/tim-janik))
-   Yuya Nishihara ([@&#8203;yuja](https://github.com/yuja))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 11, 2024
## [0.24.0] - 2024-12-04

### Breaking changes

* `jj move` has been removed. It was deprecated in 0.16.0.

* `jj checkout` and the built-in alias `jj co` have been removed.
  It was deprecated in 0.14.0.

* `jj merge` has been removed. It was deprecated in 0.14.0.

* `jj git push` no longer pushes new bookmarks by default. Use `--allow-new` to
  bypass this restriction.

* Lines prefixed with "JJ:" in commit descriptions and in sparse patterns (from
  `jj sparse edit`) are now stripped even if they are not immediately followed
  by a space. [#5004](martinvonz/jj#5004)

### Deprecations

### New features

* Templates now support the `==` and `!=` logical operators for `Boolean`,
  `Integer`, and `String` types.

* New command `jj absorb` that moves changes to stack of mutable revisions.

* New command `jj util exec` that can be used for arbitrary aliases.

* `jj rebase -b` can now be used with the `--insert-after` and `--insert-before`
  options, like `jj rebase -r` and `jj rebase -s`.

* A preview of improved shell completions was added. Please refer to the
  [documentation](https://martinvonz.github.io/jj/latest/install-and-setup/#command-line-completion)
  to activate them. They additionally complete context-dependent, dynamic values
  like bookmarks, aliases, revisions, operations and files.

* Added the config setting `snapshot.auto-update-stale` for automatically
  running `jj workspace update-stale` when applicable.

* `jj duplicate` now accepts `--destination`, `--insert-after` and
  `--insert-before` options to customize the location of the duplicated
  revisions.

* `jj log` now displays the working-copy branch first.

* New `fork_point()` revset function can be used to obtain the fork point
  of multiple commits.

* The `tags()` revset function now takes an optional `pattern` argument,
  mirroring that of `bookmarks()`.

* Several commands now support `-f/-t` shorthands for `--from/--to`:
  - `diff`
  - `diffedit`
  - `interdiff`
  - `op diff`
  - `restore`

* New `ui.conflict-marker-style` config option to change how conflicts are
  materialized in the working copy. The default option ("diff") renders
  conflicts as a snapshot with a list of diffs to apply to the snapshot.
  The new "snapshot" option renders conflicts as a series of snapshots, showing
  each side and base of the conflict. The new "git" option replicates Git's
  "diff3" conflict style, meaning it is more likely to work with external tools,
  but it doesn't support conflicts with more than 2 sides.

* New `merge-tools.<TOOL>.conflict-marker-style` config option to override the
  conflict marker style used for a specific merge tool.

* New `merge-tools.<TOOL>.merge-conflict-exit-codes` config option to allow a
  merge tool to exit with a non-zero code to indicate that not all conflicts
  were resolved.

* `jj simplify-parents` now supports configuring the default revset when no
   `--source` or `--revisions` arguments are provided with the
   `revsets.simplify-parents` config.

### Fixed bugs

* `jj config unset <TABLE-NAME>` no longer removes a table (such as `[ui]`.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants