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

Re: [PATCH 2/2] rebase -i: Preserve whitespace at beginning of commit header in $GIT_EDITOR

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 12, 2010, 06:05 UTC
Message-ID
<7vbpadfd4r.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1278764821-32647-2-git-send-email-ayiehere@gmail.com>
Nazri Ramliy <ayiehere@gmail.com> writes:
Show 6 quoted lines
> During "git rebase -i", when the commit headers are shown in the editor
> for action (pick/squash/etc), the whitespace (if any) at the beginning
> of commit headers are stripped out due to the use of "read shortsha1 rest"
> for reading the output of "git rev-list".
>
> The missing beginning whitespace do not pose any harm but this could be

If the current code removes whitespaces at the beginning, I would actually say that it is cleaning up the mess while preparing the instruction sheet for you to edit, i.e. it is a good thing, and the patch might be making things worse.

I find it difficult to come up with good reasons to convince myself that I should be interested in what this patch tries to do. Here are some of the things that came to my mind while doing so.

What happens if you have trailing whitespaces, excess whitespaces in the middle, etc. with or without this patch? What _should_ happen in an ideal world?

What happens if you have a malformed commit object whose first line is blank (i.e. no "Subject" line), or there is _no_ commit log message whatsoever with or without this patch? What _should_ happen in an ideal world?

Previous: Nazri RamliyNext: Nazri Ramliy
Message 4 of 12 in “lib-rebase.sh: fake-editor.sh: Allow checking of commit header(s) in $GIT_EDITOR”
  1. 1/2 lib-rebase.sh: fake-editor.sh: Allow checking of commit header(s) in $GIT_EDITORNazri Ramliy, Jul 10, 2010
  2. 2/2 rebase -i: Preserve whitespace at beginning of commit header in $GIT_EDITORNazri Ramliy, Jul 10, 2010
  3. Nazri RamliyJul 10, 2010
  4. Junio C HamanoJul 12, 2010
  5. Nazri RamliyJul 13, 2010
  6. Junio C HamanoJul 13, 2010
  7. Nazri RamliyJul 13, 2010
  8. Junio C HamanoJul 12, 2010
  9. Nazri RamliyJul 13, 2010
  10. Jay SoffianJul 13, 2010
  11. Nazri RamliyJul 13, 2010
  12. Junio C HamanoJul 13, 2010

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.