git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add function to checkout a branch in git.el

From
SOSergei Organov <osv@javad.com>
Date
Feb 13, 2008, 18:29 UTC
Message-ID
<87y79ovhfi.fsf@osv.gnss.ru>
In-Reply-To
<87wsp8u9m7.dlv@maison.homelinux.org>
<vanicat@debian.org> writes:
> One can now:
> - checkout an existing branch with M-x git-change-branch
> - create and checkout a new branch with C-u M-x git-change-branch

s/git-change-branch/git-checkout/? I mean is there any reason it is called differently from GIT's "git checkout"?

Besides, I also think that prefix is not a good idea for this kind of stuff (see my other reply in this thread).

Show 6 quoted lines
> - do all this from the Git menu
> ---
> It could also be interesting to add some  key biding for those
>
> Also one might want to update the *git-status* buffer after checkout,
> but this is not done by this patch

Why? Isn't it as simple as calling (git-refresh-status) at the end of git-change-branch?

Show 13 quoted lines
>  contrib/emacs/git.el |   45 +++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 45 insertions(+), 0 deletions(-)
>
> diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
> index a8bf0ef..404c8e6 100644
> --- a/contrib/emacs/git.el
> +++ b/contrib/emacs/git.el
> @@ -1138,6 +1138,50 @@ Return the list of files that haven't been handled."
>    (when (eq (window-buffer) (current-buffer))
>      (shrink-window-if-larger-than-buffer)))
>  
> +(defun git-list-branch ()
> +  "Return a list of available branch"
s/branch/branches/
> +  ;; should I check if I'm in a git repository ?
> +  (let ((branchs ()))
s/branchs/branches/
-- Sergei.
Previous: Rémi Vanicat
Message 14 of 14 in “Add function to checkout a branch in git.el”
  1. Add function to checkout a branch in git.el=?utf-8?q?R=C3=A9mi=20Vanicat?=, Feb 13, 2008
  2. Karl HasselströmFeb 13, 2008
  3. Karl HasselströmFeb 13, 2008
  4. Remi VanicatFeb 13, 2008
  5. Sergei OrganovFeb 13, 2008
  6. Karl HasselströmFeb 13, 2008
  7. Sergei OrganovFeb 14, 2008
  8. switching and creating branch, merging and rebasing with Emacs=?utf-8?q?R=C3=A9mi=20Vanicat?=, Feb 16, 2008
  9. 01/03 Add helper function for branch tag and commitish to git.elRémi Vanicat, Feb 16, 2008
  10. Alexandre JulliardFeb 17, 2008
  11. 02/03 Adding checkout function for commitish in git.elRémi Vanicat, Feb 16, 2008
  12. Alexandre JulliardFeb 17, 2008
  13. 03/03 Adding command for merging in git.elRémi Vanicat, Feb 16, 2008
  14. Sergei OrganovFeb 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.