cweiske / phorkie

Self-hosted pastebin software written in PHP. Pastes are editable, forkable, may have multiple files and are stored in git repositories.
https://cweiske.de/phorkie.htm
GNU Affero General Public License v3.0
216 stars 23 forks source link

Add recently updated to list sidebar #13

Closed jnovack closed 12 years ago

jnovack commented 12 years ago

Two notes:

In use here: http://phorkie.ozmonet.com/list

cweiske commented 12 years ago

I'd rather see the the values of both fields fixed to keep their meaning (tstamp = last update, crdate = creation date) instead of seeing the broken behavior being built upon.

jnovack commented 12 years ago

I'm going to counter.

You have tstamp being updated in Database/Adapter/ElasticSearch/Indexer.php as time(). I'd like to keep that. This way you can see when something was last indexed, regardless of it was updated or not. tstamp being the timestamp of the elasticsearch RECORD, not the timestamp of the repo.

cweiske commented 12 years ago

Hello Justin,

I'm going to counter.

  • tstamp should be the last time the indexing was modified. I'm coming with a mind shaped by TYPO3; it has crdate (creation date of record) and tstamp (last modification date of record) in every database table:)
  • crdate should be the creation date of the repo
  • modate should be the last modified date (last commit)

You have tstamp being updated in Database/Adapter/ElasticSearch/Indexer.php as time(). I'd like to keep that. This way you can see when something was last indexed, regardless of it was updated or not.

I fail to see the usefulness of the tstamp (last index time) field. Where would one need it?

Regards/Mit freundlichen Grüßen Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-

jnovack commented 12 years ago

Ah, ok. I'm coming from SQL where we add timestamp fields to the db just to see when the record was last updated, regardless of what was done to it or the other date files in the row. It's not a row that's usually requested by the client.

If you want to stick with tstamp and crdate, are they timestamps of the RECORD or the REPO? I'm suggesting tstamp be the last timestamp of the RECORD, whereas crdate and modate be the timestamps of the REPO.

You are already using tstamp as a last index time, I was just keeping it. It helps with debugging the database ensuring the records are being updated appropriately.

What do you want me to correct?

cweiske commented 12 years ago

Hello Justin,

If you want to stick with tstamp and crdate, are they timestamps of the RECORD or the REPO? I'm suggesting tstamp be the last timestamp of the RECORD, whereas crdate and modate be the timestamps of the REPO. Ok.

You are already using tstamp as a last index time, I was just keeping it. It helps with debugging the database ensuring the records are being updated appropriately.

I'd like to see that crdate is logging the repo's real creation date, not first index date, and modate the repo's latest commit date.

Regards/Mit freundlichen Grüßen Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-

jnovack commented 12 years ago

That's going to be tough. Linux does not keep creation dates of files. filectime() is useless, however, filemtime() is still useful for the last commit.

My best idea thus far is to update Repository.php with getFirstCommit(), and getDateOfCommit() functions. I'll start on that.

jnovack commented 12 years ago

I'd like to delete repo-sidebar-updated.htm and change repo-sidebar-list.htm to show last updated repos (not created repos).

After that, I'll smash them all together as 1 commit.

cweiske commented 12 years ago

ok.

jnovack commented 12 years ago

Final Answer.