Commit graph

68 commits

Author SHA1 Message Date
Kevin Ballard 6b2fbaaffc format-patch: Produce better output with --inline or --attach
This patch makes two small changes to improve the output of --inline
and --attach.

The first is to write a newline preceding the boundary. This is needed because
MIME defines the encapsulation boundary as including the preceding CRLF (or in
this case, just LF), so we should be writing one. Without this, the last
newline in the pre-diff content is consumed instead.

The second change is to always write the line termination character
(default: newline) even when using --inline or --attach. This is simply to
improve the aesthetics of the resulting message. When using --inline an email
client should render the resulting message identically to the non-inline
version. And when using --attach this adds a blank line preceding the
attachment in the email, which is visually attractive.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-29 23:18:15 -07:00
Adam Simpkins 7528f27dd6 log --graph --left-right: show left/right information in place of '*'
With the --graph option, the graph already outputs 'o' instead of '*'
for boundary commits.  Make it emit '<' or '>' when --left-right is
specified.

(This change also disables the '^' prefix for UNINTERESTING commits.
The graph code currently doesn't print anything special for these
commits, since it assumes no UNINTERESTING, non-BOUNDARY commits are
displayed.  This is potentially a bug if UNINTERESTING non-BOUNDARY
commits can actually be displayed via some code path.)

[jc: squashed the left-right change from Dscho and Adam's fixup into one]

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 12:06:52 -07:00
Adam Simpkins 7fefda5cc7 log and rev-list: add --graph option
This new option causes a text-based representation of the history to be
printed to the left of the normal output.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 18:46:35 -07:00
Adam Simpkins 885cf80899 revision API: split parent rewriting and parent printing options
This change allows parent rewriting to be performed without causing
the log and rev-list commands to print the parents.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-05 17:38:22 -07:00
Adam Simpkins 9b58bfe8f4 log: print log entry terminator even if the message is empty
This eliminates a special case in the show_log() function, to help
simplify the terminator semantics.  Now show_log() always prints a
newline after the log entry when use_terminator is set, even if the log
message is empty.

This change should only affect the --pretty=tformat output, since that
was the only way to trigger this special case.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 11:50:41 -07:00
Adam Simpkins 028656552b Remove dead code: show_log() sep argument and diff_options.msg_sep
These variables were made unnecessary by commit
3969cf7db1.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 11:48:03 -07:00
Junio C Hamano 4da45bef56 log: teach "terminator" vs "separator" mode to "--pretty=format"
This attached patch introduces a single bit "use_terminator" in "struct
rev_info", which is normally false (i.e. most formats use separator
semantics) but by flipping it to true, you can ask for terminator
semantics just like oneline format does.

The function get_commit_format(), which is what parses "--pretty=" option,
now takes a pointer to "struct rev_info" and updates its commit_format and
use_terminator fields.  It used to return the value of type "enum
cmit_fmt", but all the callers assigned it to rev->commit_format.

There are only two cases the code turns use_terminator on.  Obviously, the
traditional oneline format (--pretty=oneline) is one of them, and the new
case is --pretty=tformat:... that acts like --pretty=format:... but flips
the bit on.

With this, "--pretty=tformat:%H %s" acts like --pretty=oneline.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-10 03:25:03 -07:00
Govind Salinas 42c8c74c14 pretty.c: add %x00 format specifier.
This adds a %xXX format which inserts two hexdigits after %x as a byte
value in the resulting string.  This can be used to add a NUL byte or any
other byte that can make machine parsing easier.  It is also necessary to
use fwrite to print out the data since printf will terminate if you feed
it a NUL.

Signed-off-by: Govind Salinas <blix@sophiasuchtig.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23 00:41:54 -07:00
Junio C Hamano 267123b429 Merge branch 'maint'
* maint:
  format-patch: generate MIME header as needed even when there is format.header
2008-03-15 00:09:33 -07:00
Junio C Hamano 6bf4f1b4c9 format-patch: generate MIME header as needed even when there is format.header
Earlier, the callchain from pretty_print_commit() down to pp_title_line()
had an unwarranted assumption that the presense of "after_subject"
parameter, means the caller has already output MIME headers for
attachments.  The parameter's primary purpose is to give extra header
lines the caller wants to place after pp_title_line() generates the
"Subject: " line.

This assumption does not hold when the user used the format.header
configuration variable to pass extra headers, and caused a message with
non-ASCII character to lack proper MIME headers (e.g.  8-bit CTE header).
The earlier logic also failed to suppress duplicated MIME headers when
"format-patch -s --attach" is asked for and the signer's name demanded
8-bit clean transport.

This patch fixes the logic by introducing a separate need_8bit_cte
parameter passed down the callchain.  This can have one of these values:

 -1 : we've already done MIME crap and we do not want to add extra header
      to say this is 8bit in pp_title_line();

  0 : we haven't done MIME and we have not seen anything that is 8bit yet;

  1 : we haven't done MIME and we have seen something that is 8bit;
      pp_title_line() must add MIME header.

It adds two tests by Jeff King who independently diagnosed this issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-15 00:06:06 -07:00
Junio C Hamano 992221d05e Merge branch 'db/cover-letter'
* db/cover-letter:
  Improve collection of information for format-patch --cover-letter
  Add API access to shortlog
  t4014: Replace sed's non-standard 'Q' by standard 'q'
  Support a --cc=<email> option in format-patch
  Combine To: and Cc: headers
  Fix format.headers not ending with a newline
  Add tests for extra headers in format-patch
  Add a --cover-letter option to format-patch
  Export some email and pretty-printing functions
  Improve message-id generation flow control for format-patch
  Add more tests for format-patch

Conflicts:

	builtin-log.c
	builtin-shortlog.c
	pretty.c
2008-02-27 12:06:41 -08:00
Daniel Barkalow b02bd65f67 Export some email and pretty-printing functions
These will be used for generating the cover letter in addition to the
patch emails.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 00:56:46 -08:00
Linus Torvalds 3131b71301 Add "--show-all" revision walker flag for debugging
It's really not very easy to visualize the commit walker, because - on
purpose - it obvously doesn't show the uninteresting commits!

This adds a "--show-all" flag to the revision walker, which will make
it show uninteresting commits too, and they'll have a '^' in front of
them (it also fixes a logic error for !verbose_header for boundary
commits - we should show the '-' even if left_right isn't shown).

A separate patch to gitk to teach it the new '^' was sent
to paulus.  With the change in place, it actually is interesting
even for the cases that git doesn't have any problems with, ie
for the kernel you can do:

	gitk -d --show-all v2.6.24..

and you see just how far down it has to parse things to see it all. The
use of "-d" is a good idea, since the date-ordered toposort is much better
at showing why it goes deep down (ie the date of some of those commits
after 2.6.24 is much older, because they were merged from trees that
weren't rebased).

So I think this is a useful feature even for non-debugging - just to
visualize what git does internally more.

When it actually breaks out due to the "everybody_uninteresting()"
case, it adds the uninteresting commits (both the one it's looking at
now, and the list of pending ones) to the list

This way, we really list *all* the commits we've looked at.

Because we now end up listing commits we may not even have been parsed
at all "show_log" and "show_commit" need to protect against commits
that don't have a commit buffer entry.

That second part is debatable just how it should work. Maybe we shouldn't
show such entries at all (with this patch those entries do get shown, they
just don't get any message shown with them). But I think this is a useful
case.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13 15:59:26 -08:00
Pierre Habouzit 8f67f8aefb Make the diff_options bitfields be an unsigned with explicit masks.
reverse_diff was a bit-value in disguise, it's merged in the flags now.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-11 16:54:15 -08:00
Junio C Hamano 4593fb8405 format-patch -s: add MIME encoding header if signer's name requires so
When the body of the commit log message contains a non-ASCII character,
format-patch correctly emitted the encoding header to mark the resulting
message as such.  However, if the original message was fully ASCII, the
command line switch "-s" was given to add a new sign-off, and
the signer's name was not ASCII only, the resulting message would have
contained non-ASCII character but was not marked as such.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-01 17:18:39 -07:00
Christian Couder 50e62a8e70 rev-list: implement --bisect-all
This is Junio's patch with some stuff to make --bisect-all
compatible with --bisect-vars.

This option makes it possible to see all the potential
bisection points. The best ones are displayed first.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-26 23:27:23 -07:00
Shawn O. Pearce d55e7c3acf Merge branch 'maint'
* maint:
  Whip post 1.5.3.4 maintenance series into shape.
  rebase -i: use diff plumbing instead of porcelain
  Do not remove distributed configure script
  git-archive: document --exec
  git-reflog: document --verbose
  git-config: handle --file option with relative pathname properly
  clear_commit_marks(): avoid deep recursion
  git add -i: Remove unused variables
  git add -i: Fix parsing of abbreviated hunk headers
  git-config: don't silently ignore options after --list
  Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
  Fix embarrassing "git log --follow" bug

Conflicts:

	RelNotes
	git-rebase--interactive.sh
2007-10-15 22:31:47 -04:00
Linus Torvalds 304b5af64f Clean up "git log" format with DIFF_FORMAT_NO_OUTPUT
This fixes an unnecessary empty line that we add to the log message when
we generate diffs, but don't actually end up printing any due to having
DIFF_FORMAT_NO_OUTPUT set.

This can happen with pickaxe or with rename following. The reason is that
we normally add an empty line between the commit and the diff, but we do
that even for the case where we've then suppressed the actual printing of
the diff.

This also updates a couple of tests that assumed the extraneous empty
line would exist at the end of output.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-15 20:24:27 -04:00
Junio C Hamano cc61ae82ec Merge branch 'mv/unknown'
* mv/unknown:
  Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
2007-10-03 04:28:24 -07:00
Michal Vitecek 55246aac67 Don't use "<unknown>" for placeholders and suppress printing of empty user formats.
This changes the interporate() to replace entries with NULL values
by the empty string, and uses it to interpolate missing fields in
custom format output used in git-log and friends.  It is most useful
to avoid <unknown> output from %b format for a commit log message
that lack any body text.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-26 00:40:47 -07:00
Pierre Habouzit 674d172730 Rework pretty_print_commit to use strbufs instead of custom buffers.
Also remove the "len" parameter, as:
  (1) it was used as a max boundary, and every caller used ~0u
  (2) we check for final NUL no matter what, so it doesn't help for speed.

  As a result most of the pp_* function takes 3 arguments less, and we need
a lot less local variables, this makes the code way more readable, and
easier to extend if needed.

  This patch also fixes some spacing and cosmetic issues.

  This patch also fixes (as a side effect) a memory leak intoruced in
builtin-archive.c at commit df4a394f (fmt was xmalloc'ed and not free'd)

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-10 12:49:50 -07:00
Marco Costalba 9fa3465d6b Add --log-size to git log to print message size
With this option git-log prints log message size
just before the corresponding message.

Porcelain tools could use this to speedup parsing
of git-log output.

Note that size refers to log message only. If also
patch content is shown its size is not included.

In case it is not possible to know the size upfront
size value is set to zero.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-14 01:59:33 -07:00
Alex Riesen 88c447e8f4 Handle missing prefix for "Subject:" as if no prefix given
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-04 12:39:43 -07:00
Theodore Ts'o 06f59e9f5d Don't fflush(stdout) when it's not helpful
This patch arose from a discussion started by Jim Meyering's patch
whose intention was to provide better diagnostics for failed writes.
Linus proposed a better way to do things, which also had the added
benefit that adding a fflush() to git-log-* operations and incremental
git-blame operations could improve interactive respose time feel, at
the cost of making things a bit slower when we aren't piping the
output to a downstream program.

This patch skips the fflush() calls when stdout is a regular file, or
if the environment variable GIT_FLUSH is set to "0".  This latter can
speed up a command such as:

GIT_FLUSH=0 strace -c -f -e write time git-rev-list HEAD | wc -l

a tiny amount.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-30 20:16:12 -07:00
Junio C Hamano 80583c0ef6 Lift 16kB limit of log message output
Traditionally we had 16kB limit when formatting log messages for
output, because it was easier to arrange for the caller to have
a reasonably big buffer and pass it down without ever worrying
about reallocating.

This changes the calling convention of pretty_print_commit() to
lift this limit.  Instead of the buffer and remaining length, it
now takes a pointer to the pointer that points at the allocated
buffer, and another pointer to the location that stores the
allocated length, and reallocates the buffer as necessary.

To support the user format, the error return of interpolate()
needed to be changed.  It used to return a bool telling "Ok the
result fits", or "Sorry, I had to truncate it".  Now it returns
0 on success, and returns the size of the buffer it wants in
order to fit the whole result.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 00:41:21 -07:00
Junio C Hamano 125a5f1c2a Merge branch 'maint'
* maint:
  Small correction in reading of commit headers
  Documentation: fix typo in git-remote.txt
  Add test for blame corner cases.
  blame: -C -C -C
  blame: Notice a wholesale incorporation of an existing file.
  Fix --boundary output
  diff format documentation: describe raw combined diff format
  Mention version 1.5.1 in tutorial and user-manual
  Add --no-rebase option to git-svn dcommit
  Fix markup in git-svn man page
2007-05-06 00:21:03 -07:00
Linus Torvalds e330a406cd Fix --boundary output
"git log --boundary" incorrectly honoured the option only when
"left-right" was enabled.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-05 21:09:34 -07:00
Junio C Hamano a7b02ccf9a Add --date={local,relative,default}
This adds --date={local,relative,default} option to log family of commands,
to allow displaying timestamps in user's local timezone, relative time, or
the default format.

Existing --relative-date option is a synonym of --date=relative; we could
probably deprecate it in the long run.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-25 21:39:43 -07:00
Linus Torvalds ca135e7acc Add support for "commit name decorations" to log family of commands
This adds "--decorate" as a log option, which prints out the ref names
of any commits that are shown.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-16 16:51:11 -07:00
Robin H. Johnson 2d9e4a47d1 Add custom subject prefix support to format-patch (take 3)
Add a new option to git-format-patch, entitled --subject-prefix that allows
control of the subject prefix '[PATCH]'. Using this option, the text 'PATCH' is
replaced with whatever input is provided to the option. This allows easily
generating patches like '[PATCH 2.6.21-rc3]' or properly numbered series like
'[-mm3 PATCH N/M]'. This patch provides the implementation and documentation.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-11 18:48:30 -07:00
Junio C Hamano 33ee4cfb69 format-patch --attach: not folding some long headers.
Panagiotis Issaris reports that some MUAs seem not to like
folded "content-type" and "content-disposition" headers, so this
makes format-patch --attach output to avoid them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-04 17:31:29 -08:00
Johannes Schindelin c112f689c2 format-patch: add --inline option and make --attach a true attachment
The existing --attach option did not create a true "attachment"
but multipart/mixed with Content-Disposition: inline.  It should
have been with Content-Disposition: attachment.

Introduce --inline to add multipart/mixed that is inlined, and
make --attach to create an attachement.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-04 17:31:29 -08:00
Johannes Schindelin e52a5de45a pretty-formats: add 'format:<string>'
With this patch,

$ git show -s \
	--pretty=format:'  Ze komit %h woss%n  dunn buy ze great %an'

shows something like

  Ze komit 04c5c88 woss
  dunn buy ze great Junio C Hamano

The supported placeholders are:

	'%H': commit hash
	'%h': abbreviated commit hash
	'%T': tree hash
	'%t': abbreviated tree hash
	'%P': parent hashes
	'%p': abbreviated parent hashes
	'%an': author name
	'%ae': author email
	'%ad': author date
	'%aD': author date, RFC2822 style
	'%ar': author date, relative
	'%at': author date, UNIX timestamp
	'%cn': committer name
	'%ce': committer email
	'%cd': committer date
	'%cD': committer date, RFC2822 style
	'%cr': committer date, relative
	'%ct': committer date, UNIX timestamp
	'%e': encoding
	'%s': subject
	'%b': body
	'%Cred': switch color to red
	'%Cgreen': switch color to green
	'%Cblue': switch color to blue
	'%Creset': reset color
	'%n': newline

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-22 21:03:41 -08:00
Johannes Schindelin e00de24b10 format-patch -n: make sorting easier by padding number
Now, when format-patch outputs more than 9 patches, the numbers
are padded accordingly. Example:

	[PATCH 009/167] The 9th patch of a series of 167

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-08 17:47:38 -08:00
Johannes Schindelin 4e244cbc5c log --reflog: honour --relative-date
If you say "git log -g --relative-date", it is very likely that
you want to see the reflog names in terms of a relative date.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-08 16:20:52 -08:00
Linus Torvalds abd4e22269 Fix "git log -z" behaviour
For commit messages, we should really put the "line_termination" when we
output the character in between different commits, *not* between the
commit and the diff. The diff goes hand-in-hand with the commit, it
shouldn't be separated from it with the termination character.

So this:
 - uses the termination character for true inter-commit spacing
 - uses a regular newline between the commit log and the diff

We had it the other way around.

For the normal case where the termination character is '\n', this
obviously doesn't change anything at all, since we just switched two
identical characters around. So it's very safe - it doesn't change any
normal usage, but it definitely fixes "git log -z".

By fixing "git log -z", you can now also do insane things like

	git log -p -z |
		grep -z "some patch expression" |
		tr '\0' '\n' |
		less -S

and you will see only those commits that have the "some patch expression"
in their commit message _or_ their patches.

(This is slightly different from 'git log -S"some patch expression"',
since the latter requires the expression to literally *change* in the
patch, while the "git log -p -z | grep .." approach will see it if it's
just an unchanged _part_ of the patch context)

Of course, if you actually do something like the above, you're probably
insane, but hey, it works!

Try the above command line for a demonstration (of course, you need to
change the "some patch expression" to be something relevant). The old
behaviour of "git log -p -z" was useless (and got things completely wrong
for log entries without patches).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-07 11:58:07 -08:00
Nicolas Pitre 903b45fe18 git-log -g --pretty=oneline should display the reflog message
In the context of reflog output the reflog message is more useful than
the commit message's first line.  When relevant the reflog message
will contain that line anyway.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-28 01:54:42 -08:00
Junio C Hamano 4d12a47123 Fix --walk-reflog with --pretty=oneline
Now, "git log --abbrev-commit --pretty=o --walk-reflogs HEAD" is
reasonably pleasant to use.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-20 21:32:31 -08:00
Johannes Schindelin 8860fd42fc Teach the revision walker to walk by reflogs with --walk-reflogs
When called with "--walk-reflogs", as long as there are reflogs
available, the walker will take this information into account, rather
than the parent information in the commit object.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-20 21:32:31 -08:00
Junio C Hamano 74bd902973 Teach all of log family --left-right output.
This makes reviewing

     git log --left-right --merge --no-merges -p

a lot more pleasant.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-17 10:35:28 -08:00
Rene Scharfe 2b60356da5 Make git-cherry handle root trees
This patch on top of 'next' makes built-in git-cherry handle root
commits.

It moves the static function log-tree.c::diff_root_tree() to
tree-diff.c and makes it more similar to diff_tree_sha1() by
shuffling around arguments and factoring out the call to
log_tree_diff_flush().  Consequently the name is changed to
diff_root_tree_sha1().  It is a version of diff_tree_sha1() that
compares the empty tree (= root tree) against a single 'real' tree.

This function is then used in get_patch_id() to compute patch IDs
for initial commits instead of SEGFAULTing, as the current code
does if confronted with parentless commits.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:31:17 -07:00
Franck Bui-Huu fc1c75ec74 log-tree.c: cleanup a bit append_signoff()
This patch clean up append_signoff() by moving specific code that
looks up for "^[-A-Za-z]+: [^@]+@" pattern into a function.

It also stops the primary search when the cursor oversteps
'buf + at' limit.

This patch changes slightly append_signoff() behaviour too. If we
detect any Signed-off-by pattern during the primary search, we
needn't to do a pattern research after.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-30 00:19:42 -07:00
Jonas Fonseca 3dfb9278df Add --relative-date option to the revision interface
Exposes the infrastructure from 9a8e35e987.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-28 16:20:33 -07:00
Franck Bui-Huu c35f4c371a Add a newline before appending "Signed-off-by: " line
Whef the last line of the commit log message does not end with
"^[-A-Za-z]+: [^@]+@", append a newline after it to separate
the body of the commit log message from the run of sign-off and
ack lines. e.g. "Signed-off-by: A U Thor <au.thor@example.com>" or
"Acked-by: Me <myself@example.org>".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13 23:00:01 -07:00
Ryan Anderson 1dcb69224c log-tree: show_log() should respect the setting of diffopt->line_termination
Signed-off-by: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-07 11:38:53 -07:00
Junio C Hamano e79992abdb Merge branch 'jt/format-patch'
* jt/format-patch:
  builtin-log: typefix for recent format-patch changes.
  Add option to set initial In-Reply-To/References
  Add option to enable threading headers
  git-format-patch: Make the second and subsequent mails replies to the first
2006-07-25 12:54:57 -07:00
Johannes Schindelin e557667e2d Always reset the color _before_ printing out the newline
This patch brings the benefits of part of v1.4.1-rc2~37
to the "commit" colorizing patch.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24 10:49:11 -07:00
Jeff King ce43697379 Colorize 'commit' lines in log ui
When paging through the output of git-whatchanged, the color cues help to
visually navigate within a diff. However, it is difficult to notice when a
new commit starts, because the commit and log are shown in the "normal"
color. This patch colorizes the 'commit' line, customizable through
diff.colors.commit and defaulting to yellow.

As a side effect, some of the diff color engine (slot enum, get_color) has
become accessible outside of diff.c.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-24 00:04:41 -07:00
Josh Triplett d1566f7883 git-format-patch: Make the second and subsequent mails replies to the first
Add message_id and ref_message_id fields to struct rev_info, used in show_log
with CMIT_FMT_EMAIL to set Message-Id and In-Reply-To/References respectively.
Use these in git-format-patch to make the second and subsequent patch mails
replies to the first patch mail.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14 20:41:36 -07:00
Junio C Hamano 3969cf7db1 Fix some more diff options changes.
This fixes various problems in the new diff options code.

 - Fix --cc/-c --patch; it showed two-tree diff used internally.

 - Use "---\n" only where it matters -- that is, use it
   immediately after the commit log text when we show a
   commit log and something else before the patch text.

 - Do not output spurious extra "\n"; have an extra newline
   after the commit log text always when we have diff output and
   we are not doing oneline.

 - When running a pickaxe you need to go recursive.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27 15:33:40 -07:00