Re: entry terminator/separator behavior in show_log()

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

 



On Mon, Apr 28, 2008 at 09:10:59AM -0700, Junio C Hamano wrote:
> Adam Simpkins <adam@xxxxxxxxxxxxxxxx> writes:
> 
> > - I don't really like the behavior for any of the cases under 2.2.2.
> >
> >   I especially don't like the fact that the output does not end in a
> >   terminating newline for case 2.2.2.1.
> 
> This is exactly why I did tformat so that we do not have to have a complex
> special case (Jeff and I exchanged a few weatherbaloon patches on the list
> trying out heuristics) to avoid breaking existing scripts that use format.

Hmm.  Here's another possible option to kick around:

Modify the argument parsing code to set use_terminator for
--pretty=format when -z is not supplied.  In other words:

  - If the -z argument is used (diffopt->line_termination is '\0'),
    the code has separator semantics, just like it always has.
    '\0' appears between the entries, and not at the end of the last
    one.

  - If the -z argument is not used (diffopt->line_termination is '\n'),
    the code has terminator semantics.  '\n' appears at the end of each
    entry.

The only change to the current behavior is that if the -z option is
not used, an extra newline will appear at the end of the output.  This
might confuse some scripts that don't use -z.

The nice thing about this change is that now all of the cases under
2.2.2 from my initial email behave identically.  These cases are the
most annoying to distinguish and handle correctly for the new --graph
code, so it would make the graph logic simpler.

Do you think this change would be acceptable, or would it still break
too many scripts?

-- 
Adam Simpkins
adam@xxxxxxxxxxxxxxxx
--
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]

  Powered by Linux