Skip to content

Install default ignores (fixes #837) - #2115

Closed
Zillode wants to merge 9 commits into
syncthing:masterfrom
Zillode:default-ignores
Closed

Zillode wants to merge 9 commits into
syncthing:masterfrom
Zillode:default-ignores

Conversation

@Zillode

@Zillode Zillode commented Aug 4, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@Zillode Zillode added the pr-WIP label Aug 4, 2015
@Zillode

Zillode commented Aug 4, 2015

Copy link
Copy Markdown
Contributor Author

@st-jenkins run integration tests please

Comment thread internal/config/config.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sharedignores maybe?

@Zillode
Zillode force-pushed the default-ignores branch 3 times, most recently from 287a771 to a577c16 Compare August 4, 2015 07:26
@calmh

calmh commented Aug 5, 2015

Copy link
Copy Markdown
Member

I think #1631 is a prerequisite for this one.

@AudriusButkevicius

Copy link
Copy Markdown
Member

Yes, another prefix flag?

@Zillode

Zillode commented Aug 5, 2015

Copy link
Copy Markdown
Contributor Author

Hmm, a prefix would break compatibility with default golang regexp.
I think it should be in another file, such as .stnukes

@AudriusButkevicius

Copy link
Copy Markdown
Member

Why?
A prefix we parse, strip, and then just mark the ignore in a special way.
Also, ignores.Match() should return nil for unmatch, ignores.Ignored for ingored, ignores.Nuke for nukables ;)

@Zillode
Zillode force-pushed the default-ignores branch 3 times, most recently from cf4c95b to 695a684 Compare August 5, 2015 21:44
@Zillode

Zillode commented Aug 5, 2015

Copy link
Copy Markdown
Contributor Author

TODO:

  • Add unit test that creates nuke-able files in a subdir
  • Test whether the defined patterns correspond to the intended files
  • Resolve question whether to delete directories
  • Document nukes
  • Explain difference between ignore strings and patterns (especially when using (?i))

Comment thread internal/config/config.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False assumption, as the file might be empty.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's similar to HasMarker, should I change it to HasIgnoreFile?

@dcarosone

dcarosone commented Aug 5, 2015 via email

Copy link
Copy Markdown

@Zillode

Zillode commented Aug 5, 2015

Copy link
Copy Markdown
Contributor Author

@dcarosone see #1056

@calmh

calmh commented Aug 17, 2015

Copy link
Copy Markdown
Member

Neat!

Comment thread lib/ignore/cache.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner as an "enum" I think:

type ignoreResult int

const (
  DontIgnore ignoreResult = iota
  Ignore
  Nuke
)

type cacheEntry struct {
  result ignoreResult
  access time.Time
}

@calmh

calmh commented Aug 17, 2015

Copy link
Copy Markdown
Member

Open question - should "nuke" in fact be the default behavior and something like (?preserve) be necessary to retain the current behavior?

@calmh calmh added the enhancement New features or improvements of some kind, as opposed to a problem (bug) label Aug 17, 2015
@calmh

calmh commented Aug 17, 2015

Copy link
Copy Markdown
Member

Also, a fixes #1631 on that nuke commit

@Zillode

Zillode commented Aug 17, 2015

Copy link
Copy Markdown
Contributor Author

+1 for (?preserve):

  • Ppl add ignored files because they don't care about them, therefore ignores should not block recursive deletes etc.
  • Ppl that want something specialised, such as retaining some files, should be able to understand (?preserve)

@Zillode
Zillode force-pushed the default-ignores branch 2 times, most recently from 615e1f4 to be6a8ff Compare August 17, 2015 20:12
@Zillode

Zillode commented Dec 11, 2015

Copy link
Copy Markdown
Contributor Author

Should we check for non-empty lines to be more accurate?

(reminder to self)

@calmh

calmh commented Dec 12, 2015

Copy link
Copy Markdown
Member

screen shot 2015-12-12 at 12 26 47

I think this has a larger chance of succeeding as three separate pull requests. In order, if necessary, if they depend on each other.

Comment thread lib/config/config.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0777 and let umask handle the rest I think

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly a nonexisting #include will break the parsing of the includes right now. Also, should probably use a name more like sharedignores.txt if we're going to default to something? (And are includes relative to the folder root or the .syncthing dir?)

@calmh

calmh commented Jan 4, 2016

Copy link
Copy Markdown
Member

Bonk?

@calmh calmh removed enhancement New features or improvements of some kind, as opposed to a problem (bug) pr-WIP labels Mar 5, 2016
@calmh

calmh commented Mar 5, 2016

Copy link
Copy Markdown
Member

Reopen if this comes back to life :)

@calmh calmh closed this Mar 5, 2016
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 16, 2017
@syncthing syncthing locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants