Hi Marcin,

On May 17, 6:46 pm, Marcin Bachry <[email protected]> wrote:
> > On a fresh repo, make a few commits and try to rewrite from the first
> > commit (`r s').
>
> > It generates the following backtrace for me on Emacs 23.0.93.
>
> > Backtrace:
>
> > Debugger entered--Lisp error: (error "Invalid use of `\\' in
> > replacement text")
> >   replace-match("'\\''" nil nil "'" nil)
> >   replace-regexp-in-string("'" "'\\''" "fatal: ambiguous argument
> > 'master~1^': unknown revision or path not in the working tree.\nUse
> > '--' to separate paths from revisions\nmaster~1^")
> >   magit-escape-for-shell("fatal: ambiguous argument 'master~1^':
> > unknown revision or path not in the working tree.\nUse '--' to
> > separate paths from revisions\nmaster~1^")
> >   mapcar(magit-escape-for-shell ("fatal: ambiguous argument
> > 'master~1^': unknown revision or path not in the working tree.\nUse
> > '--' to separate paths from revisions\nmaster~1^"))
> >   magit-format-shell-command("rev-list %s.." ("fatal: ambiguous
> > argument 'master~1^': unknown revision or path not in the working tree.
> > \nUse '--' to separate paths from revisions\nmaster~1^"))
> >   magit-format-git-command("rev-list %s.." ("fatal: ambiguous argument
> > 'master~1^': unknown revision or path not in the working tree.\nUse
> > '--' to separate paths from revisions\nmaster~1^"))
> >   magit-git-lines("rev-list %s.." "fatal: ambiguous argument
> > 'master~1^': unknown revision or path not in the working tree.\nUse
> > '--' to separate paths from revisions\nmaster~1^")
> >   magit-rewrite-start("master~1")
> >   call-interactively(magit-rewrite-start nil nil)
>
> The attached patch should fix replace-regexp-in-string bug, but I still
> have a backtrace when rewriting from the very first commit.  The second
> patch tries to address this problem, but I'm not sure it's the correct
> way: maybe it's more suitable to just throw an error when someone wants
> to rewrite the initial commit?

is there any reason that the first commit should be a special case?
Thanks.

> m.
>
>  0001-Fix-shell-escaping.patch
> < 1KViewDownload
>
>  0002-Allow-rewriting-history-from-the-first-commit.patch
> < 1KViewDownload

Reply via email to