emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suhail Singh <suhailsingh247@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [FR] Make notion of "modification time" configurable during publishing
Date: Wed, 20 Sep 2023 16:55:11 -0400	[thread overview]
Message-ID: <87led01s5s.fsf@gmail.com> (raw)
In-Reply-To: <x1-6cTTUwmKWZxHNPpNVJOTVkwgKgg@gwene.org> (Ihor Radchenko's message of "Fri, 15 Sep 2023 10:34:37 +0200")

Ihor Radchenko <post@gwene.org> writes:

> - weary-traveler asked to add a new feature to Org publishing system.
>
>   The use case is publishing using CI tasks, where a new, fresh image
>   is created every time a website is re-published. Such image does
>   not preserve the original modification times of the source Org
>   files, making Org publish re-generate everything every single time.
>
>   The new suggested feature is (optionally) using last git commit time
>   instead of file modification time.

>   - Conclusion: the feature request is to be submitted to mailing list
>     for more detailed discussion.

The requested feature is for the notion of "modification time" to be
configurable by the user. Even in the specific situation quoted above,
different users may desire different alternative notions of
"modification time". For instance,

- the value of the DATE keyword
- if using git as vc, the "git author date"
- if using git as vc, the "git commit date"

It would help for the notion of "modification time" (currently
hard-coded as file-attribute-modification-time ) to be configurable in
the following functions:

- org-publish-cache-mtime-of-src: this is used to decide whether or not
  a particular file needs to be republished. I.e., the function at the
  heart of the motivating situation discussed during the meetup.
  
- org-publish-find-date: this is used during the publishing of sitemaps
  where the modification time is used as the default value (for
  directories the filesystem modification time is the only value ever
  used).

The user-supplied "modification time" function would take the FILE as an
input and its output would be in the style of `current-time'.  A default
value could be provided for above cases which preserves current
semantics.  Additional inputs to such a "modification time" function
that may be helpful (though may not be necessary) are the PROJECT-PLIST
and the PUB-DIR.

>   - Org already has somewhat similar functionality in a form of
>     ={{{modification-time ...}}}= macro. See
>     [[info:org#Macro Replacement][org#Macro Replacement]] section
>     of Org manual.

I believe the modification-time macro for git uses the "author date".
This may not always be the desirable "vc-modification-time" notion.
However, when it's not, the user has the freedom to create (and use)
their own macro.

>   - Also, several other places in Org are relying on file modification
>     time and might need to be considered.

org-html-format-spec is one such place that may additionally benefit.
However, in that case it may be sufficient to simply mirror what's done
for the modification-time macro. I.e., consider only one notion of
"vc-modification-time" and have it be the "author date" semantics.

-- 
Suhail


       reply	other threads:[~2023-09-20 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <x1-6cTTUwmKWZxHNPpNVJOTVkwgKgg@gwene.org>
2023-09-20 20:55 ` Suhail Singh [this message]
2023-09-22  9:41   ` [FR] Make notion of "modification time" configurable during publishing Ihor Radchenko
     [not found] <x1-5i65OtI+6PjBbgoemiQBgzkPLPw@gwene.org>
2023-09-22 19:56 ` Suhail Singh
2023-09-23 10:36   ` Ihor Radchenko
     [not found] <x1-bakbPFr8WTAd8rrVoF4onXphuTM@gwene.org>
2023-09-23 15:45 ` Suhail Singh
2023-09-26 11:02   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87led01s5s.fsf@gmail.com \
    --to=suhailsingh247@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).