# Would using double slashes in the middle of a line have the effect of commenting?

**URL:** https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227
**Category:** Feature
**Created:** [November 2, 2022, 10:33am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227 "2022-11-02T10:33:25Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![ooker777](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ooker777/32/12251_2.png) [@ooker777](https://forum.syncthing.net/u/ooker777)
#### Post date: [November 2, 2022, 10:33am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/1 "2022-11-02T10:33:25Z")

</div>

From [Ignoring Files](https://docs.syncthing.net/v1.22.0/users/ignoring#patterns):

> A line beginning with `//` is a comment and has no effect.

Does that mean using `//` in the middle of a line will have no effect on commenting? That is, if your line is

```
file // comment

```

Then it will literally search for a file named `file // comment`, not `file`?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 2, 2022, 10:36am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/2 "2022-11-02T10:36:58Z")

</div>

I’m not sure what the effect of double slashes are inside a pattern (maybe they’re cleaned to the equivalent single slash?) but according the docs it should not be interpreted as a comment, no.

Edit: looks like double slash will match only a double slash, i.e, not match anything at all since there won’t be any double slashes in a normal path name.

---

<div class="post-metadata">

### Author: ![ooker777](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ooker777/32/12251_2.png) [@ooker777](https://forum.syncthing.net/u/ooker777)
#### Post date: [November 7, 2022, 9:37am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/3 "2022-11-07T09:37:07Z")

</div>

but why not allow the double slash in the middle of a line to have the effect of commenting as well?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 7, 2022, 1:23pm UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/4 "2022-11-07T13:23:02Z")

</div>

I don’t remember why, that decision was made many years ago.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [November 7, 2022, 7:37pm UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/5 "2022-11-07T19:37:23Z")

</div>

Linux paths can have spaces and // etc. So its not safe.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 7, 2022, 9:02pm UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/6 "2022-11-07T21:02:06Z")

</div>

Spaces yes but slashes no… That said, it seems like a possible typo so having `foo/bar//baz/quux` be a failure (no match) seems better to me than having it silently matching all of `foo/bar` because the rest suddenly became a comment.

In either case, it pretty much is what it is at this point, I see no pressing reason to change it.

---

<div class="post-metadata">

### Author: ![ooker777](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ooker777/32/12251_2.png) [@ooker777](https://forum.syncthing.net/u/ooker777)
#### Post date: [November 8, 2022, 2:45am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/7 "2022-11-08T02:45:34Z")

</div>

I see. Should I add this info to the doc for more clarity?

---

<div class="post-metadata">

### Author: ![acolomb](https://forum.syncthing.net/user_avatar/forum.syncthing.net/acolomb/32/11343_2.png) [@acolomb](https://forum.syncthing.net/u/acolomb)
#### Post date: [November 8, 2022, 5:07am UTC](https://forum.syncthing.net/t/would-using-double-slashes-in-the-middle-of-a-line-have-the-effect-of-commenting/19227/8 "2022-11-08T05:07:30Z")

</div>

Sure, go ahead, PR welcome. I think it’s a worthwhile clarification.
