unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
@ 2021-11-19  6:59 Lars Ingebrigtsen
  2021-11-19  8:28 ` Juri Linkov
  2022-09-24 13:17 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-19  6:59 UTC (permalink / raw)
  To: 51964


`+' and `P' in vc-dir-mode are nice, but it means that I have to wait
until `+' is done first.  So what I want is a command that does the
pull, and if there's no conflicts, then do the push.

It seems like this shouldn't be too difficult -- vc-exec-after should be
able to do this somehow.

Or perhaps more generally -- vc-git-pull could have a callback function
that's called after it's done, and it could be called with the status
(success or not) as a parameter?  Then people could write their own
functions to react to the aftermath of a pull.


In GNU Emacs 29.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0)
 of 2021-11-18 built on xo
Repository revision: 7a1e5ac8b29b731e89cc9d5b498e31bd90840b9b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux bookworm/sid


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2021-11-19  6:59 bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir Lars Ingebrigtsen
@ 2021-11-19  8:28 ` Juri Linkov
  2021-11-19  8:42   ` Eli Zaretskii
                     ` (2 more replies)
  2022-09-24 13:17 ` Lars Ingebrigtsen
  1 sibling, 3 replies; 8+ messages in thread
From: Juri Linkov @ 2021-11-19  8:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51964

> `+' and `P' in vc-dir-mode are nice, but it means that I have to wait
> until `+' is done first.  So what I want is a command that does the
> pull, and if there's no conflicts, then do the push.
>
> It seems like this shouldn't be too difficult -- vc-exec-after should be
> able to do this somehow.
>
> Or perhaps more generally -- vc-git-pull could have a callback function
> that's called after it's done, and it could be called with the status
> (success or not) as a parameter?  Then people could write their own
> functions to react to the aftermath of a pull.

Shouldn't the pull+push command be customizable to allow "git pull --rebase",
especially useful in this workflow?





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2021-11-19  8:28 ` Juri Linkov
@ 2021-11-19  8:42   ` Eli Zaretskii
  2021-11-19 10:20   ` Andreas Schwab
  2021-11-20  8:30   ` Lars Ingebrigtsen
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2021-11-19  8:42 UTC (permalink / raw)
  To: Juri Linkov; +Cc: larsi, 51964

> From: Juri Linkov <juri@linkov.net>
> Date: Fri, 19 Nov 2021 10:28:41 +0200
> Cc: 51964@debbugs.gnu.org
> 
> > Or perhaps more generally -- vc-git-pull could have a callback function
> > that's called after it's done, and it could be called with the status
> > (success or not) as a parameter?  Then people could write their own
> > functions to react to the aftermath of a pull.
> 
> Shouldn't the pull+push command be customizable to allow "git pull --rebase",
> especially useful in this workflow?

I think we should have a user option saying whether merge-based or
rebase-based workflow is preferred, because this affects (or
could/should affect) quite a few defaults, at least with Git.





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2021-11-19  8:28 ` Juri Linkov
  2021-11-19  8:42   ` Eli Zaretskii
@ 2021-11-19 10:20   ` Andreas Schwab
  2021-11-20  8:30   ` Lars Ingebrigtsen
  2 siblings, 0 replies; 8+ messages in thread
From: Andreas Schwab @ 2021-11-19 10:20 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, 51964

On Nov 19 2021, Juri Linkov wrote:

> Shouldn't the pull+push command be customizable to allow "git pull --rebase",
> especially useful in this workflow?

You can also customize that per repository with git config.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2021-11-19  8:28 ` Juri Linkov
  2021-11-19  8:42   ` Eli Zaretskii
  2021-11-19 10:20   ` Andreas Schwab
@ 2021-11-20  8:30   ` Lars Ingebrigtsen
  2 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-20  8:30 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 51964

Juri Linkov <juri@linkov.net> writes:

> Shouldn't the pull+push command be customizable to allow "git pull --rebase",
> especially useful in this workflow?

This command is certainly even more useful if you're using rebasing, but
I think people customise that in their git setups, so I think it would
probably be superfluous. 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2021-11-19  6:59 bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir Lars Ingebrigtsen
  2021-11-19  8:28 ` Juri Linkov
@ 2022-09-24 13:17 ` Lars Ingebrigtsen
  2022-09-24 17:36   ` Juri Linkov
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-24 13:17 UTC (permalink / raw)
  To: 51964

Lars Ingebrigtsen <larsi@gnus.org> writes:

> `+' and `P' in vc-dir-mode are nice, but it means that I have to wait
> until `+' is done first.  So what I want is a command that does the
> pull, and if there's no conflicts, then do the push.
>
> It seems like this shouldn't be too difficult -- vc-exec-after should be
> able to do this somehow.

I've now done this in Emacs 29.





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2022-09-24 13:17 ` Lars Ingebrigtsen
@ 2022-09-24 17:36   ` Juri Linkov
  2022-09-24 18:30     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2022-09-24 17:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51964

>> `+' and `P' in vc-dir-mode are nice, but it means that I have to wait
>> until `+' is done first.  So what I want is a command that does the
>> pull, and if there's no conflicts, then do the push.
>>
>> It seems like this shouldn't be too difficult -- vc-exec-after should be
>> able to do this somehow.
>
> I've now done this in Emacs 29.

I wonder why this couldn't be implemented by using the existing backend
functions 'pull' and 'push'?  Then the only thing required for a backend
to support 'vc-pull-and-push' is just to return a process from the
backend function 'pull'.  IOW, I don't see a problem of moving
the logic of vc-git-pull-and-push to vc-pull-and-push.





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

* bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir
  2022-09-24 17:36   ` Juri Linkov
@ 2022-09-24 18:30     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-24 18:30 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 51964

Juri Linkov <juri@linkov.net> writes:

> I wonder why this couldn't be implemented by using the existing backend
> functions 'pull' and 'push'?  Then the only thing required for a backend
> to support 'vc-pull-and-push' is just to return a process from the
> backend function 'pull'.  IOW, I don't see a problem of moving
> the logic of vc-git-pull-and-push to vc-pull-and-push.

That may well be possible -- I just don't know whether all the backends
(that have -pull/-push) would be amenable to that.

But I see there's only two of them bzr and hg, and looking at those
briefly, it does indeed look like the implementation could be lifted up
to vc-pull-and-push.





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

end of thread, other threads:[~2022-09-24 18:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-19  6:59 bug#51964: 29.0.50; Wishlist: It'd be nice with a pull+push command in vc-dir Lars Ingebrigtsen
2021-11-19  8:28 ` Juri Linkov
2021-11-19  8:42   ` Eli Zaretskii
2021-11-19 10:20   ` Andreas Schwab
2021-11-20  8:30   ` Lars Ingebrigtsen
2022-09-24 13:17 ` Lars Ingebrigtsen
2022-09-24 17:36   ` Juri Linkov
2022-09-24 18:30     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).