From: Ihor Radchenko <yantar92@posteo.net>
To: Suhail Singh <suhailsingh247@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [FR] Make notion of "modification time" configurable during publishing
Date: Sat, 23 Sep 2023 10:36:28 +0000 [thread overview]
Message-ID: <87il812n2r.fsf@localhost> (raw)
In-Reply-To: <874jjmm16y.fsf@gmail.com>
Suhail Singh <suhailsingh247@gmail.com> writes:
> Ihor Radchenko writes:
>
>> I am a bit confused. What do you mean by "git author date" and "git
>> commit date"?
>
> In the output of `git log --pretty=fuller`, there is AuthorDate which is
> distinct from CommitDate. In case unfamiliar, an elaboration on the
> distinction: <https://stackoverflow.com/a/11857467>.
I see now.
But do you actually use one but not other in practice?
>> I think that we should use an alternative approach. Both "git time" and
>> "fs time" are only an approximation. The true decision to re-publish an
>> article should be triggered by article text being modified. So, we may
>> better decide based on the file text hash, not the modification times.
>
> For it to work, the "file text hash" would have to also take into
> account the "file text hash" of included files, or the decision to
> re-publish would have to be predicated on the hash of included files as
> well. I.e., the equivalent of this logic in
> org-publish-cache-file-needs-publishing :
>
> (let ((mtime (org-publish-cache-mtime-of-src filename)))
> (or (time-less-p pstamp mtime)
> (cl-some (lambda (ct) (time-less-p mtime ct))
> included-files-mtime)))
And the code right above the quoted already looks into INCLUDEs. It
should not be too hard to add buffer hash calculation there.
> But assuming the existence of equivalent logic, yes something like a
> file hash would work. In fact, at least in the case of git, the VCS
> could even be queried for it (via git hash-object).
Probably an overkill. It will only work for files without includes and
force us to use exactly the same hash algorithm.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-09-23 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <x1-5i65OtI+6PjBbgoemiQBgzkPLPw@gwene.org>
2023-09-22 19:56 ` [FR] Make notion of "modification time" configurable during publishing Suhail Singh
2023-09-23 10:36 ` Ihor Radchenko [this message]
[not found] <x1-bakbPFr8WTAd8rrVoF4onXphuTM@gwene.org>
2023-09-23 15:45 ` Suhail Singh
2023-09-26 11:02 ` Ihor Radchenko
[not found] <x1-6cTTUwmKWZxHNPpNVJOTVkwgKgg@gwene.org>
2023-09-20 20:55 ` Suhail Singh
2023-09-22 9:41 ` 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=87il812n2r.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=suhailsingh247@gmail.com \
/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).