unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* git/mercurial checkin(commit) with every save
@ 2022-12-04 18:20 Uwe Brauer
  2022-12-04 18:27 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Uwe Brauer @ 2022-12-04 18:20 UTC (permalink / raw)
  To: help-gnu-emacs


Hi

According to 
https://www.emacswiki.org/emacs/RevisionControlSystem

It is possible for RCS to have a checkin with every save.

HG/Git are a bit different since they require a commit message for each
commit.

Does anybody know about a similar feature for these two VCs?

Regards

Uwe Brauer 

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:20 git/mercurial checkin(commit) with every save Uwe Brauer
@ 2022-12-04 18:27 ` Eli Zaretskii
  2022-12-04 19:38   ` Uwe Brauer
  2022-12-04 18:38 ` John W Higgins
  2022-12-04 18:46 ` Akib Azmain Turja
  2 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2022-12-04 18:27 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Uwe Brauer <oub@mat.ucm.es>
> Date: Sun, 04 Dec 2022 19:20:36 +0100
> 
> According to 
> https://www.emacswiki.org/emacs/RevisionControlSystem
> 
> It is possible for RCS to have a checkin with every save.
> 
> HG/Git are a bit different since they require a commit message for each
> commit.
> 
> Does anybody know about a similar feature for these two VCs?

RCS is not different from the other VCSes: it also requires a commit log
message for each commit.  What made you think otherwise?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:20 git/mercurial checkin(commit) with every save Uwe Brauer
  2022-12-04 18:27 ` Eli Zaretskii
@ 2022-12-04 18:38 ` John W Higgins
  2022-12-04 19:39   ` Uwe Brauer
  2022-12-04 21:52   ` Uwe Brauer
  2022-12-04 18:46 ` Akib Azmain Turja
  2 siblings, 2 replies; 10+ messages in thread
From: John W Higgins @ 2022-12-04 18:38 UTC (permalink / raw)
  To: help-gnu-emacs

Good Day,

On Sun, Dec 4, 2022 at 10:21 AM Uwe Brauer <oub@mat.ucm.es> wrote:

>
> It is possible for RCS to have a checkin with every save.
>
> HG/Git are a bit different since they require a commit message for each
> commit.
>
> Does anybody know about a similar feature for these two VCs?
>
>
Git - https://github.com/ryuslash/git-auto-commit-mode

Used it for years - works like a charm

John


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:20 git/mercurial checkin(commit) with every save Uwe Brauer
  2022-12-04 18:27 ` Eli Zaretskii
  2022-12-04 18:38 ` John W Higgins
@ 2022-12-04 18:46 ` Akib Azmain Turja
  2022-12-04 19:40   ` Uwe Brauer
  2 siblings, 1 reply; 10+ messages in thread
From: Akib Azmain Turja @ 2022-12-04 18:46 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 676 bytes --]

Uwe Brauer <oub@mat.ucm.es> writes:

> Hi
>
> According to 
> https://www.emacswiki.org/emacs/RevisionControlSystem
>
> It is possible for RCS to have a checkin with every save.
>
> HG/Git are a bit different since they require a commit message for each
> commit.
>
> Does anybody know about a similar feature for these two VCs?
>
> Regards
>
> Uwe Brauer

You can write a script or Emacs command to automatically generate a
commit message and commit changes.

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib@hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:27 ` Eli Zaretskii
@ 2022-12-04 19:38   ` Uwe Brauer
  2022-12-04 19:57     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2022-12-04 19:38 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

>>> "EZ" == Eli Zaretskii <eliz@gnu.org> writes:

>> From: Uwe Brauer <oub@mat.ucm.es>
>> Date: Sun, 04 Dec 2022 19:20:36 +0100
>> 
>> According to 
>> https://www.emacswiki.org/emacs/RevisionControlSystem
>> 
>> It is possible for RCS to have a checkin with every save.
>> 
>> HG/Git are a bit different since they require a commit message for each
>> commit.
>> 
>> Does anybody know about a similar feature for these two VCs?

> RCS is not different from the other VCSes: it also requires a commit log
> message for each commit.  What made you think otherwise?

I stopped using RCS some 5 years ago and converted almost all these
files to HG. Most of the converted commits have no (or empty) log
messages.

If memory serves me right I used rcs-checkin that does not require log
messages.


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:38 ` John W Higgins
@ 2022-12-04 19:39   ` Uwe Brauer
  2022-12-04 21:52   ` Uwe Brauer
  1 sibling, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2022-12-04 19:39 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

>>> "JWH" == John W Higgins <wishdev@gmail.com> writes:

> Good Day,
> On Sun, Dec 4, 2022 at 10:21 AM Uwe Brauer <oub@mat.ucm.es> wrote:

>> 
>> It is possible for RCS to have a checkin with every save.
>> 
>> HG/Git are a bit different since they require a commit message for each
>> commit.
>> 
>> Does anybody know about a similar feature for these two VCs?
>> 
>> 
> Git - https://github.com/ryuslash/git-auto-commit-mode

Very cool, thanks I will see whether I can modify it to work also with HG.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:46 ` Akib Azmain Turja
@ 2022-12-04 19:40   ` Uwe Brauer
  0 siblings, 0 replies; 10+ messages in thread
From: Uwe Brauer @ 2022-12-04 19:40 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

>>> "AAT" == Akib Azmain Turja <akib@disroot.org> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>> Hi
>> 
>> According to 
>> https://www.emacswiki.org/emacs/RevisionControlSystem
>> 
>> It is possible for RCS to have a checkin with every save.
>> 
>> HG/Git are a bit different since they require a commit message for each
>> commit.
>> 
>> Does anybody know about a similar feature for these two VCs?
>> 
>> Regards
>> 
>> Uwe Brauer

> You can write a script or Emacs command to automatically generate a
> commit message and commit changes.

Or I could use the amend command for this purpose it seems. (Whether
that is a good idea is another question).


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 19:38   ` Uwe Brauer
@ 2022-12-04 19:57     ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2022-12-04 19:57 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Uwe Brauer <oub@mat.ucm.es>
> Date: Sun, 04 Dec 2022 20:38:42 +0100
> 
> > RCS is not different from the other VCSes: it also requires a commit log
> > message for each commit.  What made you think otherwise?
> 
> I stopped using RCS some 5 years ago and converted almost all these
> files to HG. Most of the converted commits have no (or empty) log
> messages.

Every VCS allows empty log messages.  Not just RCS.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 18:38 ` John W Higgins
  2022-12-04 19:39   ` Uwe Brauer
@ 2022-12-04 21:52   ` Uwe Brauer
  2022-12-05 23:33     ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 10+ messages in thread
From: Uwe Brauer @ 2022-12-04 21:52 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

>>> "JWH" == John W Higgins <wishdev@gmail.com> writes:

> Good Day,
> On Sun, Dec 4, 2022 at 10:21 AM Uwe Brauer <oub@mat.ucm.es> wrote:

>> 
>> It is possible for RCS to have a checkin with every save.
>> 
>> HG/Git are a bit different since they require a commit message for each
>> commit.
>> 
>> Does anybody know about a similar feature for these two VCs?
>> 
>> 
> Git - https://github.com/ryuslash/git-auto-commit-mode

> Used it for years - works like a charm


This primitive solution is for the moment enough for me

(defun my-hg-checkin-on-save ()
  "This is a trivial command for commiting on every save!"
  (interactive)
  (shell-command "hg ci -m \"Automatic commit on file save \" "))   

(define-minor-mode hg-auto-commit-mode
  "Automatically commit any changes made when saving with this mode turned on."
  :lighter " AHG"
  (if hg-auto-commit-mode
      (add-hook 'after-save-hook 'my-hg-checkin-on-save t t)
    (remove-hook 'after-save-hook 'my-hg-checkin-on-save t)))

And then at the end of the day I rebase all this commits to a single one.

Of course, if I added files etc, I need a more sophisticated solution.




-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: git/mercurial checkin(commit) with every save
  2022-12-04 21:52   ` Uwe Brauer
@ 2022-12-05 23:33     ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-12-05 23:33 UTC (permalink / raw)
  To: help-gnu-emacs

>   (shell-command "hg ci -m \"Automatic commit on file save \" "))   

This launches a /bin/sh process which then in turn parses the command to
figure out what you asked it to do and then runs `hg` with the
specified arguments.
You can cut the middle man with:

    (call-process "hg" nil nil nil "ci" "-m" "Automatic commit on file save")


-- Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-05 23:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-04 18:20 git/mercurial checkin(commit) with every save Uwe Brauer
2022-12-04 18:27 ` Eli Zaretskii
2022-12-04 19:38   ` Uwe Brauer
2022-12-04 19:57     ` Eli Zaretskii
2022-12-04 18:38 ` John W Higgins
2022-12-04 19:39   ` Uwe Brauer
2022-12-04 21:52   ` Uwe Brauer
2022-12-05 23:33     ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-04 18:46 ` Akib Azmain Turja
2022-12-04 19:40   ` Uwe Brauer

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).