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

[RFC PATCH v3 0/4] give more useful error messages while renaming branch

From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Date
Nov 2, 2017, 06:52 UTC
Message-ID
<20171102065242.25299-1-kaartic.sivaraam@gmail.com>

In builtin/branch, the error messages weren't handled directly by the branch renaming function and was left to the other function. Though this avoids redundancy this gave unclear error messages in some cases. So, make builtin/branch give more useful error messages.

Changes in v3:
	Incorporated suggestions from v2 to improve code and commit message. To
	be more precise about the code part,
	In 2/4 slightly re-ordered the parameters to move the flag parameters to
	the end.
	In 3/4, changed the return type of the branchname validation functions to
	be the enum (whose values they return) as suggested by Stefan.
	Dropped the PATCH 3/5 of v2 as there was another series[1] that did the
	refactor and got merged to 'next'. I have now re-rolled the series over
	'next' [pointing at 273055501 (Sync with master, 2017-10-24)].
 
	This has made the code in 3/4 a little clumsy (at least to me) as I
	tried to achieve to achieve what the previous patches did with the new
	validate*_branchname functionS. Let me know, if it looks too bad.

So this could go on top of 'next' without any conflicts but in case I missed something, let me know. The series could be found in my fork[2].

Any feedback welcome.

Thanks, Kaartic

[1] : https://public-inbox.org/git/20171013051132.3973-1-gitster@pobox.com
[2] : https://github.com/sivaraam/git/tree/work/branch-revamp
Kaartic Sivaraam (4):
  branch: improve documentation and naming of 'create_branch()'
  branch: re-order function arguments to group related arguments
  branch: introduce dont_fail parameter for branchname validation
  builtin/branch: give more useful error messages when renaming
 branch.c           | 63 ++++++++++++++++++++++++++++++------------------------
 branch.h           | 57 ++++++++++++++++++++++++++++++++++++++----------
 builtin/branch.c   | 49 ++++++++++++++++++++++++++++++++++--------
 builtin/checkout.c | 11 +++++-----
 4 files changed, 127 insertions(+), 53 deletions(-)
-- 
2.15.0.rc2.401.g3db9995f9
Next: Kaartic Sivaraam
Message 1 of 6 in “give more useful error messages while renaming branch”
  1. 0/4 give more useful error messages while renaming branchKaartic Sivaraam, Nov 2, 2017
  2. 1/4 branch: improve documentation and naming of 'create_branch()'Kaartic Sivaraam, Nov 2, 2017
  3. 2/4 branch: re-order function arguments to group related argumentsKaartic Sivaraam, Nov 2, 2017
  4. 3/4 branch: introduce dont_fail parameter for branchname validationKaartic Sivaraam, Nov 2, 2017
  5. 4/4 builtin/branch: give more useful error messages when renamingKaartic Sivaraam, Nov 2, 2017
  6. Kaartic SivaraamNov 2, 2017

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.