emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Chunyang Xu <mail@xuchunyang.me>
Cc: emacs-orgmode@gnu.org, Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: Re: Asks user what to do with each tangle-file before overriding?
Date: Sun, 18 Jun 2017 10:12:33 -0700	[thread overview]
Message-ID: <alpine.OSX.2.20.1706180916320.763@charles-berrys-macbook.local> (raw)
In-Reply-To: <m2r2yhlex8.fsf@xuchunyang.me>

On Sun, 18 Jun 2017, Chunyang Xu wrote:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>
> [...]
>
>> I don't think it is a good idea to have file that can be both edited
>> manually, and auto-generated (i.e., tangled). Or, to put it differently,
>> the idea behind tangling is that you only handle the code block, not the
>> file itself.
>
> I still think overriding exist files is dangerous, user can lost data
> because of it, so it should be safer if org-babel-tangle can let user
> decide how to deal with it.
>
> Besides, if a code block is not changed and I have already tangled it
> before, I don't want org-babel-tangle to update the last modified
> timestamp of the tangle-file every time I tangle, as along as there is
> no actual changes. It is simply unnecessary to me and makes the last
> modified timestamp more or less useless. So I would like
> org-babel-tangle let me choose what I want.
>
> [...]

It sounds like you are re-inventing version control and wanting it to be 
implemented in org-babel-tangle.

`org-babel-tangle' can do a lot of work to assemble the files that result 
from tangling.  Modifying `org-babel-tangle' to do what you ask would be 
far from trivial and make a complicated function even more tortuous.

IMHO, it is better to solve your problem as follows: Set up a separate 
directory into which files are tangled.  Use version control on that 
directory.  Inspect changes after each tangle using the version control 
system's diff tools, commit good changes, and revert unwanted ones.  Then 
run a script that uses the VC's data to identify changed files and copy 
those files to the location on your system where they will be used.

HTH,

Chuck

  reply	other threads:[~2017-06-18 17:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-16  5:09 Asks user what to do with each tangle-file before overriding? Chunyang Xu
2017-06-18  7:23 ` Nicolas Goaziou
2017-06-18 11:21   ` Chunyang Xu
2017-06-18 17:12     ` Charles C. Berry [this message]
2017-06-19  4:57       ` Chunyang Xu
2017-06-19  5:06 ` numbchild

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=alpine.OSX.2.20.1706180916320.763@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=mail@xuchunyang.me \
    /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).