Re: [PATCH] git-p4: Handle p4 submit failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

>         Note: this time, you do not need to resend the patch; just
>         please let me know if you want me to do the equivalent of
>         the above while applying to make your murex address and name
>         appear as the author in "git log" and "git shortlog" output.

I'd like my murex address to appear on the log please, if it is not
too much trouble. Thank you for all these tips on the submitting
process.

>> The p4 submit command may fail, for example if the changelist contains
>> a job that does not exist in the Jobs section. If this is the case,
>> p4_write_pipe will exit the script. This change makes it so that the
>> workspace is reverted before letting the script die.
>
> Some of the information contained in this paragraph deserves to be
> in the log message proper.  How about
>
>         From: GIRARD Etienne <egirard@xxxxxxxxx>
>         Subject: git-p4: clean up after p4 submit failure
>
>         When "p4 submit" command fails in P4Submit.applyCommit, the
>         workspace is left with the changes.  We already have a code
>         to revert the changes to the workspace when the user decides
>         to cancel submission by aborting the editor that edits the
>         change description, and we should treat the "p4 submit"
>         failure the same way.
>
>         Clean the workspace if p4_write_pipe raised SystemExit,
>         so that the user don't have to do it themselves.
>
>         Signed-off-by: GIRARD Etienne <egirard@xxxxxxxxx>
>
> or something like that?

It seems like a good description. Please let me know if I should
submit another patch with the proper log message

>
> While trying to come up with the above description, I started
> wondering if the error message wants to differentiate the two cases.
>
> When self.edit_template() returns false, we know that the user
> actively said "no I do not want to submit", and "Submission
> cancelled" is perfectly fine, but when "p4 submit" fails because it
> did not like the change description or if it found some other
> issues, it is not necessarily that the user said "I want to cancel";
> it is more like "Submission failed".

Yes, however if `p4 submit` fails the corresponding "Command failed"
error message is displayed, and the p4 error message itself is
displayed if any.
Tthe script will also terminate successfully if self.edit_template
returns false but it will exit with error code 1 if p4 submit fails.

So the user will get "Command failed: [...]" followed by "Submission
cancelled, undoing p4 changes", to let him know that the script failed
because of p4 and that nothing was submitted.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]