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

Re: [PATCH] Make 'cvs -n commit ...' not to commit

From
ECEric Chamberland <eric.chamberland@giref.ulaval.ca>
Date
Mar 23, 2012, 19:02 UTC
Message-ID
<4F6CC8AC.4050907@giref.ulaval.ca>
In-Reply-To
<7vhaxftb54.fsf@alter.siamese.dyndns.org>
On 03/23/2012 02:39 PM, Junio C Hamano wrote:
Show 8 quoted lines
> ericc<eric.chamberland@giref.ulaval.ca>  writes:
>
>> Actually, doing a 'cvs -n commit' will _do_ the commit...
>> With this patch, it now goes through the code, but don't do the commit.
>
> OK.
>
>> A further progress would be to do the pre-commit hook is possible...
Sorry, I wanted to write:
"A further progress would be to do the pre-commit hook *if* possible..."

here, we are used to do "cvs -n commit" just to check if the "hooks" on the cvs server will fail or not...

Show 31 quoted lines
>
> I understand that you tried to make the patch smaller by avoiding
> re-indenting, but this is *yucky*.
>
> It looks to me that the above part could be solved with:
>
> 	unless (...) {
> 		next;
> 	}
>
> I think the function being patched is too big.  Wouldn't it be better to
> have a refactoring patch to move the above per-path logic to a helper
> function that deals with a single path, and then insert the "omit call to
> that helper when run with -n" code in a separate patch?
>
> The same comment applies to the other hunk.
>
> Also I notice that the indentation used throughout the file is somewhat
> broken (e.g. "Emulate by running hooks/update" part is indented to 8
> columns, but earlier parts use 4 space indent).  The right structure for
> this change may be:
>
>   Patch 1: Fix indentation (and do nothing else) to uniformly indent with
>            HT;
>
>   Patch 2: Refactor this big funciton using a handful of helper functions
> 	  (and do nothing else);
>
>   Patch 3: Omit calls to these helper functions under -n option.
>
>

Ok you are right... These were my very first lines in Perl... I just wanted to catch the attention of someone who is able to do the changes correctly... and in a more clean way than I...

Eric
Previous: Junio C Hamano
Message 3 of 3 in “Make 'cvs -n commit ...' not to commit”
  1. Make 'cvs -n commit ...' not to commitericc, Mar 22, 2012
  2. Junio C HamanoMar 23, 2012
  3. Eric ChamberlandMar 23, 2012

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.