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

Re: [PATCH/RFCv2 1/2] git-rebase -i: add command "drop" to remove a commit

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2015, 16:39 UTC
Message-ID
<xmqqvbf7757q.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1433152643-4292-2-git-send-email-remi.galan-alfonso@ensimag.grenoble-inp.fr>
Galan Rémi  <remi.galan-alfonso@ensimag.grenoble-inp.fr> writes:
Show 8 quoted lines
> Instead of removing a line to remove the commit, you can use the
> command "drop" (just like "pick" or "edit"). It has the same effect as
> deleting the line (removing the commit) except that you keep a visual
> trace of your actions, allowing a better control and reducing the
> possibility of removing a commit by mistake.
>
> Signed-off-by: Galan Rémi <remi.galan-alfonso@ensimag.grenoble-inp.fr>
> ---
Matthieu, is this part of your class project?

I vaguely recall that your school wants your sign-off to release patches to us or something like that, and that I saw some other patches came with your sign-off, so I am being curious.

Show 9 quoted lines
> @@ -505,7 +506,7 @@ do_next () {
>  	rm -f "$msg" "$author_script" "$amend" || exit
>  	read -r command sha1 rest < "$todo"
>  	case "$command" in
> -	"$comment_char"*|''|noop)
> +	"$comment_char"*|''|noop|drop|d)
>  		mark_action_done
>  		;;
>  	pick|p)
Is this sufficient?

If you are going to do something in 2/2 that relies on the format of this line being correct (as opposed to "noop" or "#" that can have any garbage on the remainder of the line), wouldn't you want to at least check $sha1 is sensible?

Previous: Galan RémiNext: Matthieu Moy
Message 3 of 12 in “rebase -i : drop command and removed commits”
  1. 0/2 rebase -i : drop command and removed commitsGalan Rémi, Jun 1, 2015
  2. 1/2 git-rebase -i: add command "drop" to remove a commitGalan Rémi, Jun 1, 2015
  3. Junio C HamanoJun 1, 2015
  4. Matthieu MoyJun 1, 2015
  5. Remi Galan AlfonsoJun 1, 2015
  6. Matthieu MoyJun 1, 2015
  7. Remi Galan AlfonsoJun 2, 2015
  8. Matthieu MoyJun 2, 2015
  9. Junio C HamanoJun 2, 2015
  10. Remi Galan AlfonsoJun 3, 2015
  11. Junio C HamanoJun 3, 2015
  12. 2/2 git rebase -i: warn about removed commitsGalan Rémi, Jun 1, 2015

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.