git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's cooking in git.git (Oct 2009, #02; Sun, 11)
@ 2009-10-12  3:18 Junio C Hamano
  2009-10-12  5:14 ` Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Junio C Hamano @ 2009-10-12  3:18 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'.  The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.

In 1.7.0, we plan to correct handful of warts in the interfaces everybody
agrees that they were mistakes.  The resulting system may not be strictly
backward compatible.  Currently planeed changes are:

 * refuse push to update the checked out branch in a non-bare repo by
   default

   Make "git push" into a repository to update the branch that is checked
   out fail by default.  You can countermand this default by setting a
   configuration variable in the receiving repository.

   http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007

 * refuse push to delete the current branch by default

   Make "git push $there :$killed" to delete the branch that is pointed at
   by its HEAD fail by default.  You can countermand this default by
   setting a configuration variable in the receiving repository.

   http://thread.gmane.org/gmane.comp.version-control.git/108862/focus=108936

 * git-send-email won't make deep threads by default

   Many people said that by default when sending more than 2 patches the
   threading git-send-email makes by default is hard to read, and they
   prefer the default be one cover letter and each patch as a direct
   follow-up to the cover letter.  You can countermand this by setting a
   configuration variable.

   http://article.gmane.org/gmane.comp.version-control.git/109790

 * git-status won't be "git-commit --dry-run" anymore

   http://thread.gmane.org/gmane.comp.version-control.git/125989/focus=125993

 * "git-diff -w --exit-code" will exit success if only differences it
   found are whitespace changes that are stripped away from the output.

   http://thread.gmane.org/gmane.comp.version-control.git/119731/focus=119751

As a post-release ritual, I've rebuilt 'next' on top of 'master'.

--------------------------------------------------
[Graduated to "master"]

* ch/am-header (2009-09-25) 2 commits
  (merged to 'next' on 2009-09-25 at f86e197)
 + git-am: force egrep to use correct characters set
 + git-am: fixed patch_format detection according to RFC2822

* ef/msvc-noreturn (2009-09-30) 2 commits
  (merged to 'next' on 2009-10-07 at 66137a0)
 + add NORETURN_PTR for function pointers
 + increase portability of NORETURN declarations

jk: This is the latest round and I think should be ready for at least
'next' (maybe even 'master' as it is really about the build and not about
functionality).

* fc/mutt-alias (2009-09-30) 1 commit
  (merged to 'next' on 2009-10-07 at df7ac20)
 + send-email: fix mutt regex for grouped aliases

jk: Latest round that addressed comments. Ready for 'next' if not
'master'.

* jk/reflog-date (2009-09-24) 1 commit
  (merged to 'next' on 2009-09-29 at 43d444a)
 + improve reflog date/number heuristic

--------------------------------------------------
[New Topics]

* jp/maint-send-email-fold (2009-10-08) 1 commit.
 - git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"s

* ks/precompute-completion (2009-10-05) 1 commit.
 - Speedup bash completion loading

* pv/maint-add-p-no-exclude (2009-10-10) 1 commit.
  (merged to 'next' on 2009-10-11 at 0ff2e96)
 + git-add--interactive: never skip files included in index

* sp/smart-http (2009-10-08) 4 commits.
 - Smart fetch and push over HTTP: server side
 - Add smart-http options to upload-pack, receive-pack
 - Git-aware CGI to provide dumb HTTP transport
 - Document the HTTP transport protocol

--------------------------------------------------
[Stalled]

* sr/gfi-options (2009-09-06) 6 commits.
 - fast-import: test the new option command
 - fast-import: add option command
 - fast-import: test the new feature command
 - fast-import: add feature command
 - fast-import: put marks reading in it's own function
 - fast-import: put option parsing code in separate functions

Ejected from 'next' as fast-import folks still seem to be discussing with
how to proceed.

* je/send-email-no-subject (2009-08-05) 1 commit.
  (merged to 'next' on 2009-10-11 at 1b99c56)
 + send-email: confirm on empty mail subjects

The existing tests cover the positive case (i.e. as long as the user says
"yes" to the "do you really want to send this message that lacks subject",
the message is sent) of this feature, but the feature itself needs its own
test to verify the negative case (i.e. does it correctly stop if the user
says "no"?)

* jh/cvs-helper (2009-08-18) 8 commits.
 - More fixes to the git-remote-cvs installation procedure
 - Fix the Makefile-generated path to the git_remote_cvs package in git-remote-cvs
 - Add simple selftests of git-remote-cvs functionality
 - git-remote-cvs: Remote helper program for CVS repositories
 - 2/2: Add Python support library for CVS remote helper
 - 1/2: Add Python support library for CVS remote helper
 - Basic build infrastructure for Python scripts
 - Allow helpers to request marks for fast-import
 (this branch uses db/vcs-helper-rest.)

Builds on db/vcs-helper.  There is a re-roll planned.

* ne/rev-cache (2009-09-07) 7 commits.
 . support for commit grafts, slight change to general mechanism
 . support for path name caching in rev-cache
 . full integration of rev-cache into git, completed test suite
 . administrative functions for rev-cache, start of integration into git
 . support for non-commit object caching in rev-cache
 . basic revision cache system, no integration or features
 . man page and technical discussion for rev-cache

This seems to break at least t6001 when merged to 'pu'.

--------------------------------------------------
[Cooking]

* dk/blame-el (2009-09-29) 1 commit.
 - git-blame.el: Change how blame information is shown.

Soon in 'next'.

* ef/msys-imap (2009-10-09) 8 commits.
 - MSVC: Enable OpenSSL, and translate -lcrypto
 - mingw: enable OpenSSL
 - mingw: wrap SSL_set_(w|r)fd to call _get_osfhandle
 - imap-send: build imap-send on Windows
 - imap-send: fix compilation-error on Windows
 - imap-send: use run-command API for tunneling
 - imap-send: use separate read and write fds
 - imap-send: remove useless uid code

* jn/gitweb-patch (2009-10-09) 1 commit.
 - gitweb: Do not show 'patch' link for merge commits

Soon in 'next'

* mr/gitweb-snapshot (2009-09-26) 2 commits.
 - gitweb: append short hash ids to snapshot files
  (merged to 'next' on 2009-10-11 at 22ba047)
 + gitweb: check given hash before trying to create snapshot

* mr/instaweb-cgid (2009-09-26) 1 commit.
  (merged to 'next' on 2009-10-11 at 99bcfaf)
 + instaweb: support mod_cgid for apache2

* tf/doc-pt-br (2009-09-23) 1 commit.
 - Documentation: update pt-BR

The current AsciiDoc may barf on NOME and SINOPSE, as pt_BR language
definition is not widely distributed yet (it just hit the development
tree).  Need to revert these headings (or change the length of the section
underlines to match the length of translated names).

* jc/pretty-lf (2009-10-04) 1 commit.
 - Pretty-format: %[+-]x to tweak inter-item newlines

I am not happy with this one yet.  I am contemplating to introduce a new
syntax "%[magic(param)<anything>%]" to generalize expressions of this and
line wrapping features in an extensible way.

* js/log-rewrap (2008-11-10) 3 commits.
 . Add "%w" to pretty formats, which rewraps the commit message
 - Add strbuf_add_wrapped_text() to utf8.[ch]
 - print_wrapped_text(): allow hard newlines
... and the first two from this series will be useful to implement an
example magic "wrap", e.g. "%[wrap(i,j,w)%s%+b%]".

* jg/log-format-body-indent (2009-09-19) 1 commit.
 - git-log --format: Add %B tag with %B(x) option

I think we should redo this on top of the first two patches from
js/log-rewrap series; %B(x) is just a special case %B(x,x,0), no?  If a
magic value 0 (or negative) given to wrap-width does not disable wrapping,
we probably should make it so.

* bg/rebase-reword (2009-10-07) 1 commit.
 - Teach 'rebase -i' the command "reword"

Soon in 'next'

* js/diff-verbose-submodule (2009-10-04) 1 commit.
 - Add the --submodule-summary option to the diff option family

Dscho sounded like he has some corrections after list comments, but I did
not pick up his interdiff in the middle.

* jl/submodule-add-noname (2009-09-22) 1 commit.
 - git submodule add: make the <path> parameter optional

Dscho started an interesting discussion regarding the larger workflow in
which the "submodule add" is used.  I think the patch itself makes sense
but at the same time it probably makes sense to also take the <path> and
infer the <repository> as Dscho suggested, probably in "git submodule
add", not in "git add" proper, at least initially.

* jc/fix-tree-walk (2009-09-14) 10 commits.
 - read-tree --debug-unpack
 - unpack-trees.c: look ahead in the index
 - unpack-trees.c: prepare for looking ahead in the index
 - Aggressive three-way merge: fix D/F case
 - traverse_trees(): handle D/F conflict case sanely
 - more D/F conflict tests
 - tests: move convenience regexp to match object names to test-lib.sh
 - unpack_callback(): use unpack_failed() consistently
 - unpack-trees: typofix
 - diff-lib.c: fix misleading comments on oneway_diff()

This is my replacement for Linus's lt/maint-traverse-trees-fix patch.  It
is not so much as a counter-proposal; I originally thought it might make
sense to walk the index and drive the walker to return the entries from
trees to match entries from the index, but I ended up doing pretty much
what Linus outlined --- walk the trees, and have the index walker follow
it.  It turned out that the index side also needed some hairy look-ahead,

This includes the fix to aggressive mode of three-way merge used by the
resolve strategy.  I think the series is Ok for 'next'.

* jp/fetch-tag-match (2009-09-17) 1 commit.
 - fetch: Speed up fetch by rewriting find_non_local_tags

I just queued this without reading nor thinking about it very much.  I
personally liked my version that had far smaller number of lines changed
(which means I can be fairly certain that it did not introduce any
regression), but perhaps the majorly rewritten logic this patch gives us
may be easier to follow and maintain.

* jc/maint-blank-at-eof (2009-09-15) 0 commits.
 (this branch uses jc/maint-1.6.0-blank-at-eof.)

The series does not have a commit of its own but is a preparation for
merging the original jc/1.6.0-maint-blank-at-eof topic to 'maint' and then
'master'

Soon in 'next'

* db/vcs-helper-rest (2009-09-03) 6 commits.
 - Allow helpers to report in "list" command that the ref is unchanged
 - Add support for "import" helper command
 - Add a config option for remotes to specify a foreign vcs
 - Allow programs to not depend on remotes having urls
 - Allow fetch to modify refs
 - Use a function to determine whether a remote is valid
 (this branch is used by jh/cvs-helper.)

This holds the remainder of the db/vcs-helper topic that has already
merged in 1.6.5.

* jh/notes (2009-10-09) 22 commits.
 - fast-import: Proper notes tree manipulation using the notes API
 - Refactor notes concatenation into a flexible interface for combining notes
 - Notes API: Allow multiple concurrent notes trees with new struct notes_tree
 - Notes API: for_each_note(): Traverse the entire notes tree with a callback
 - Notes API: get_note(): Return the note annotating the given object
 - Notes API: add_note(): Add note objects to the internal notes tree structure
 - Notes API: init_notes(): Initialize the notes tree from the given notes ref
 - Notes API: get_commit_notes() -> format_note() + remove the commit restriction
 - Add selftests verifying concatenation of multiple notes for the same commit
 - Refactor notes code to concatenate multiple notes annotating the same object
 - Add selftests verifying that we can parse notes trees with various fanouts
 - Teach the notes lookup code to parse notes trees with various fanout schemes
 - Teach notes code to free its internal data structures on request
 - Add '%N'-format for pretty-printing commit notes
 - Add flags to get_commit_notes() to control the format of the note string
 - t3302-notes-index-expensive: Speed up create_repo()
 - fast-import: Add support for importing commit notes
 - Teach "-m <msg>" and "-F <file>" to "git notes edit"
 - Add an expensive test for git-notes
 - Speed up git notes lookup
 - Add a script to edit/inspect notes
 - Introduce commit notes

Rerolled and queued.

* jn/gitweb-show-size (2009-09-07) 1 commit.
 - gitweb: Add 'show-sizes' feature to show blob sizes in tree view

Soon in 'next'

* jc/maint-1.6.0-blank-at-eof (2009-09-14) 15 commits.
  (merged to 'next' on 2009-10-11 at 7f34fb3)
 + diff -B: colour whitespace errors
 + diff.c: emit_add_line() takes only the rest of the line
 + diff.c: split emit_line() from the first char and the rest of the line
 + diff.c: shuffling code around
 + diff --whitespace: fix blank lines at end
 + core.whitespace: split trailing-space into blank-at-{eol,eof}
 + diff --color: color blank-at-eof
 + diff --whitespace=warn/error: fix blank-at-eof check
 + diff --whitespace=warn/error: obey blank-at-eof
 + diff.c: the builtin_diff() deals with only two-file comparison
 + apply --whitespace: warn blank but not necessarily empty lines at EOF
 + apply --whitespace=warn/error: diagnose blank at EOF
 + apply.c: split check_whitespace() into two
 + apply --whitespace=fix: detect new blank lines at eof correctly
 + apply --whitespace=fix: fix handling of blank lines at the eof
 (this branch is used by jc/maint-blank-at-eof.)

This is a fix for an ancient bug (or inconsistent set of features); the
topic is based on an ancient codebase and is designed to be merged
upwards.  jc/maint-blank-at-eof serves that purpose.

* jn/gitweb-blame (2009-09-01) 5 commits.
 - gitweb: Minify gitweb.js if JSMIN is defined
 - gitweb: Create links leading to 'blame_incremental' using JavaScript
  (merged to 'next' on 2009-10-11 at 73c4a83)
 + gitweb: Colorize 'blame_incremental' view during processing
 + gitweb: Incremental blame (using JavaScript)
 + gitweb: Add optional "time to generate page" info in footer

Ajax-y blame.

* nd/sparse (2009-08-20) 19 commits.
 - sparse checkout: inhibit empty worktree
 - Add tests for sparse checkout
 - read-tree: add --no-sparse-checkout to disable sparse checkout support
 - unpack-trees(): ignore worktree check outside checkout area
 - unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
 - unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
 - unpack-trees.c: generalize verify_* functions
 - unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
 - Introduce "sparse checkout"
 - dir.c: export excluded_1() and add_excludes_from_file_1()
 - excluded_1(): support exclude files in index
 - unpack-trees(): carry skip-worktree bit over in merged_entry()
 - Read .gitignore from index if it is skip-worktree
 - Avoid writing to buffer in add_excludes_from_file_1()
 - Teach Git to respect skip-worktree bit (writing part)
 - Teach Git to respect skip-worktree bit (reading part)
 - Introduce "skip-worktree" bit in index, teach Git to get/set this bit
 - Add test-index-version
 - update-index: refactor mark_valid() in preparation for new options

--------------------------------------------------
[For 1.7.0]

* jk/1.7.0-status (2009-09-05) 5 commits.
 - docs: note that status configuration affects only long format
  (merged to 'next' on 2009-10-11 at 65c8513)
 + commit: support alternate status formats
 + status: add --porcelain output format
 + status: refactor format option parsing
 + status: refactor short-mode printing to its own function
 (this branch uses jc/1.7.0-status.)

Gives the --short output format to post 1.7.0 "git commit --dry-run" that
is similar to that of post 1.7.0 "git status".

* jc/1.7.0-status (2009-09-05) 4 commits.
  (merged to 'next' on 2009-10-11 at 9558627)
 + status: typo fix in usage
 + git status: not "commit --dry-run" anymore
 + git stat -s: short status output
 + git stat: the beginning of "status that is not a dry-run of commit"
 (this branch is used by jk/1.7.0-status.)

With this, "git status" is no longer "git commit --dry-run".

* jc/1.7.0-send-email-no-thread-default (2009-08-22) 1 commit.
  (merged to 'next' on 2009-10-11 at 043acdf)
 + send-email: make --no-chain-reply-to the default

* jc/1.7.0-diff-whitespace-only-status (2009-08-30) 4 commits.
  (merged to 'next' on 2009-10-11 at 546c74d)
 + diff.c: fix typoes in comments
 + Make test case number unique
 + diff: Rename QUIET internal option to QUICK
 + diff: change semantics of "ignore whitespace" options

This changes exit code from "git diff --ignore-whitespace" and friends
when there is no actual output.  It is a backward incompatible change, but
we could argue that it is a bugfix.

* jc/1.7.0-push-safety (2009-02-09) 2 commits.
  (merged to 'next' on 2009-10-11 at 81b8128)
 + Refuse deleting the current branch via push
 + Refuse updating the current branch in a non-bare repository via push

--------------------------------------------------
[I have been too busy to purge these]

* jc/log-tz (2009-03-03) 1 commit.
 - Allow --date=local --date=other-format to work as expected

Maybe some people care about this.  I dunno.

* jc/mailinfo-remove-brackets (2009-07-15) 1 commit.
 - mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker

Maybe some people care about this.  I dunno.

* lt/read-directory (2009-05-15) 3 commits.
 . Add initial support for pathname conversion to UTF-8
 . read_directory(): infrastructure for pathname character set conversion
 . Add 'fill_directory()' helper function for directory traversal

* cc/reset-merge (2009-09-16) 4 commits.
 . reset: add test cases for "--merge-safe" option
 . reset: add option "--merge-safe" to "git reset"
 . reset: use "unpack_trees()" directly instead of "git read-tree"
 . reset: add a few tests for "git reset --merge"

* cc/sequencer-rebase-i (2009-08-28) 15 commits.
 . rebase -i: use "git sequencer--helper --cherry-pick"
 . sequencer: add "--cherry-pick" option to "git sequencer--helper"
 . sequencer: add "do_commit()" and related functions working on "next_commit"
 . pick: libify "pick_help_msg()"
 . revert: libify cherry-pick and revert functionnality
 . rebase -i: use "git sequencer--helper --fast-forward"
 . sequencer: let "git sequencer--helper" callers set "allow_dirty"
 . sequencer: add "--fast-forward" option to "git sequencer--helper"
 . sequencer: add "do_fast_forward()" to perform a fast forward
 . rebase -i: use "git sequencer--helper --reset-hard"
 . sequencer: add "--reset-hard" option to "git sequencer--helper"
 . sequencer: add "reset_almost_hard()" and related functions
 . rebase -i: use "git sequencer--helper --make-patch"
 . sequencer: add "make_patch" function to save a patch
 . sequencer: add "builtin-sequencer--helper.c"

* lt/maint-traverse-trees-fix (2009-09-06) 1 commit.
 . Prepare 'traverse_trees()' for D/F conflict lookahead

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: What's cooking in git.git (Oct 2009, #02; Sun, 11)
  2009-10-12  3:18 What's cooking in git.git (Oct 2009, #02; Sun, 11) Junio C Hamano
@ 2009-10-12  5:14 ` Jeff King
  2009-10-12 22:52   ` Junio C Hamano
  2009-10-12  6:23 ` Sverre Rabbelier
  2009-10-14 18:29 ` Jens Lehmann
  2 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2009-10-12  5:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sun, Oct 11, 2009 at 08:18:17PM -0700, Junio C Hamano wrote:

> * jk/1.7.0-status (2009-09-05) 5 commits.
>  - docs: note that status configuration affects only long format
>   (merged to 'next' on 2009-10-11 at 65c8513)
>  + commit: support alternate status formats
>  + status: add --porcelain output format
>  + status: refactor format option parsing
>  + status: refactor short-mode printing to its own function
>  (this branch uses jc/1.7.0-status.)
> 
> Gives the --short output format to post 1.7.0 "git commit --dry-run" that
> is similar to that of post 1.7.0 "git status".
> 
> * jc/1.7.0-status (2009-09-05) 4 commits.
>   (merged to 'next' on 2009-10-11 at 9558627)
>  + status: typo fix in usage
>  + git status: not "commit --dry-run" anymore
>  + git stat -s: short status output
>  + git stat: the beginning of "status that is not a dry-run of commit"
>  (this branch is used by jk/1.7.0-status.)
> 
> With this, "git status" is no longer "git commit --dry-run".

Hmm. I thought you wanted to re-order some of these for to put the
porcelain and short formats into v1.6.6, but leave the status switchover
for v1.7.0.

We can always revert selectively, but I though the post-v1.6.5 rewind
would be a good time to re-order.

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: What's cooking in git.git (Oct 2009, #02; Sun, 11)
  2009-10-12  3:18 What's cooking in git.git (Oct 2009, #02; Sun, 11) Junio C Hamano
  2009-10-12  5:14 ` Jeff King
@ 2009-10-12  6:23 ` Sverre Rabbelier
  2009-10-14 18:29 ` Jens Lehmann
  2 siblings, 0 replies; 14+ messages in thread
From: Sverre Rabbelier @ 2009-10-12  6:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Heya,

On Mon, Oct 12, 2009 at 05:18, Junio C Hamano <gitster@pobox.com> wrote:
> [Stalled]
>
> * sr/gfi-options (2009-09-06) 6 commits.
>  - fast-import: test the new option command
>  - fast-import: add option command
>  - fast-import: test the new feature command
>  - fast-import: add feature command
>  - fast-import: put marks reading in it's own function
>  - fast-import: put option parsing code in separate functions
>
> Ejected from 'next' as fast-import folks still seem to be discussing with
> how to proceed.

Thanks, I hope to have this re-rolled before 1.6.6 goes into RC.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: What's cooking in git.git (Oct 2009, #02; Sun, 11)
  2009-10-12  5:14 ` Jeff King
@ 2009-10-12 22:52   ` Junio C Hamano
  2009-10-14  4:24     ` Jeff King
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-10-12 22:52 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> On Sun, Oct 11, 2009 at 08:18:17PM -0700, Junio C Hamano wrote:
>
>> * jk/1.7.0-status (2009-09-05) 5 commits.
>>  - docs: note that status configuration affects only long format
>>   (merged to 'next' on 2009-10-11 at 65c8513)
>>  + commit: support alternate status formats
>>  + status: add --porcelain output format
>>  + status: refactor format option parsing
>>  + status: refactor short-mode printing to its own function
>>  (this branch uses jc/1.7.0-status.)
>> 
>> Gives the --short output format to post 1.7.0 "git commit --dry-run" that
>> is similar to that of post 1.7.0 "git status".
>> 
>> * jc/1.7.0-status (2009-09-05) 4 commits.
>>   (merged to 'next' on 2009-10-11 at 9558627)
>>  + status: typo fix in usage
>>  + git status: not "commit --dry-run" anymore
>>  + git stat -s: short status output
>>  + git stat: the beginning of "status that is not a dry-run of commit"
>>  (this branch is used by jk/1.7.0-status.)
>> 
>> With this, "git status" is no longer "git commit --dry-run".
>
> Hmm. I thought you wanted to re-order some of these for to put the
> porcelain and short formats into v1.6.6, but leave the status switchover
> for v1.7.0.

We could build an alternate history between 3fa509d..46b77a6, revert the
merges 9558627 and 65c8513, and merge the alternate history.  But is the
short format support so solid that it deserves to be in 1.6.6 in the
current shape?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: What's cooking in git.git (Oct 2009, #02; Sun, 11)
  2009-10-12 22:52   ` Junio C Hamano
@ 2009-10-14  4:24     ` Jeff King
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff King @ 2009-10-14  4:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Mon, Oct 12, 2009 at 03:52:46PM -0700, Junio C Hamano wrote:

> > Hmm. I thought you wanted to re-order some of these for to put the
> > porcelain and short formats into v1.6.6, but leave the status switchover
> > for v1.7.0.
> 
> We could build an alternate history between 3fa509d..46b77a6, revert the
> merges 9558627 and 65c8513, and merge the alternate history.  But is the
> short format support so solid that it deserves to be in 1.6.6 in the
> current shape?

Somewhere I seem to recall you saying that it would be nice to give the
--short format some wider exposure as "git status --short" before making
the "status is no longer commit --dry-run" switch-over. But now I can't
find that message anywhere.

Let's not worry about it.

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: What's cooking in git.git (Oct 2009, #02; Sun, 11)
  2009-10-12  3:18 What's cooking in git.git (Oct 2009, #02; Sun, 11) Junio C Hamano
  2009-10-12  5:14 ` Jeff King
  2009-10-12  6:23 ` Sverre Rabbelier
@ 2009-10-14 18:29 ` Jens Lehmann
  2009-10-14 18:30   ` [PATCH 1/4] Add the --submodule-summary option to the diff option family Jens Lehmann
                     ` (4 more replies)
  2 siblings, 5 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 18:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Junio C Hamano schrieb:
> * js/diff-verbose-submodule (2009-10-04) 1 commit.
>  - Add the --submodule-summary option to the diff option family
> 
> Dscho sounded like he has some corrections after list comments, but I did
> not pick up his interdiff in the middle.

Dscho condensed his initial patch with the interdiff you mentioned,
additionally silenced a compiler warning and activated --first-parent.
This follows as patch 1/4. Patches 2/4 to 4/4 contain my two bugfixes
and the testcase i copied from submodule summary while adapting it to
the changes of the output format.

The remaining differences from the output shown by submodule summary are:

1) git diff shows only two dots for a fast forward (submodule summary
   always shows three)
2) git diff shows "Submodule" instead of a single '*' in the first line
3) git diff doesn't add a newline after each shortlog
4) submodule summary prints out the number of shortlog entries, this
   version does not
5) submodule summary can limit the number of shortlog lines, git diff
   can't do that right now
6) When files are replaced by a submodules or vice versa, git diff
   generates an extra hunk for the deleted/added file and one saying
   "(new submodule)"/"(submodule deleted)"


> The output format needs to be described better here and also in
> Documentation/diff-format.txt.

Will do when it is clear which of the 6 differences should be fixed and
which can stay.


Jens Lehmann (3):
  fix indentation depth for git diff --submodule-summary
  fix output for deleted submodules in git diff --submodule-summary
  add tests for git diff --submodule-summary

Johannes Schindelin (1):
  Add the --submodule-summary option to the diff option family

 Documentation/diff-options.txt    |    4 +
 Makefile                          |    2 +
 diff.c                            |   14 +++
 diff.h                            |    3 +
 submodule.c                       |  113 ++++++++++++++++++++
 submodule.h                       |    8 ++
 t/t4041-diff-submodule-summary.sh |  206 +++++++++++++++++++++++++++++++++++++
 7 files changed, 350 insertions(+), 0 deletions(-)
 create mode 100644 submodule.c
 create mode 100644 submodule.h
 create mode 100755 t/t4041-diff-submodule-summary.sh

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/4] Add the --submodule-summary option to the diff option family
  2009-10-14 18:29 ` Jens Lehmann
@ 2009-10-14 18:30   ` Jens Lehmann
  2009-10-14 18:31   ` [PATCH 2/4] fix indentation depth for git diff --submodule-summary Jens Lehmann
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 18:30 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Junio C Hamano, Git Mailing List

Now you can see the submodule summaries inlined in the diff, instead of
not-quite-helpful SHA-1 pairs.

The format imitates what "git submodule summary" shows.

To do that, <path>/.git/objects/ is added to the alternate object
databases (if that directory exists).

This option was requested by Jens Lehmann at the GitTogether in Berlin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/diff-options.txt |    4 ++
 Makefile                       |    2 +
 diff.c                         |   14 +++++
 diff.h                         |    3 +
 submodule.c                    |  113 ++++++++++++++++++++++++++++++++++++++++
 submodule.h                    |    8 +++
 6 files changed, 144 insertions(+), 0 deletions(-)
 create mode 100644 submodule.c
 create mode 100644 submodule.h

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 9276fae..5fcc5a8 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -87,6 +87,10 @@ endif::git-format-patch[]
 	Show only names and status of changed files. See the description
 	of the `--diff-filter` option on what the status letters mean.

+--submodule-summary::
+	Instead of showing pairs of commit names, list the commits in that
+	commit range in the same style as linkgit:git-submodule[1].
+
 --color::
 	Show colored diff.

diff --git a/Makefile b/Makefile
index fea237b..2356de4 100644
--- a/Makefile
+++ b/Makefile
@@ -452,6 +452,7 @@ LIB_H += sideband.h
 LIB_H += sigchain.h
 LIB_H += strbuf.h
 LIB_H += string-list.h
+LIB_H += submodule.h
 LIB_H += tag.h
 LIB_H += transport.h
 LIB_H += tree.h
@@ -550,6 +551,7 @@ LIB_OBJS += sideband.o
 LIB_OBJS += sigchain.o
 LIB_OBJS += strbuf.o
 LIB_OBJS += string-list.o
+LIB_OBJS += submodule.o
 LIB_OBJS += symlinks.o
 LIB_OBJS += tag.o
 LIB_OBJS += trace.o
diff --git a/diff.c b/diff.c
index e1be189..bcf2f77 100644
--- a/diff.c
+++ b/diff.c
@@ -13,6 +13,7 @@
 #include "utf8.h"
 #include "userdiff.h"
 #include "sigchain.h"
+#include "submodule.h"

 #ifdef NO_FAST_WORKING_DIRECTORY
 #define FAST_WORKING_DIRECTORY 0
@@ -1453,6 +1454,17 @@ static void builtin_diff(const char *name_a,
 	const char *a_prefix, *b_prefix;
 	const char *textconv_one = NULL, *textconv_two = NULL;

+	if (DIFF_OPT_TST(o, SUMMARIZE_SUBMODULES) &&
+			(!one->mode || S_ISGITLINK(one->mode)) &&
+			(!two->mode || S_ISGITLINK(two->mode))) {
+		const char *del = diff_get_color_opt(o, DIFF_FILE_OLD);
+		const char *add = diff_get_color_opt(o, DIFF_FILE_NEW);
+		show_submodule_summary(o->file, one ? one->path : two->path,
+				one->sha1, two->sha1,
+				del, add, reset);
+		return;
+	}
+
 	if (DIFF_OPT_TST(o, ALLOW_TEXTCONV)) {
 		textconv_one = get_textconv(one);
 		textconv_two = get_textconv(two);
@@ -2640,6 +2652,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		DIFF_OPT_CLR(options, ALLOW_TEXTCONV);
 	else if (!strcmp(arg, "--ignore-submodules"))
 		DIFF_OPT_SET(options, IGNORE_SUBMODULES);
+	else if (!strcmp(arg, "--submodule-summary"))
+		DIFF_OPT_SET(options, SUMMARIZE_SUBMODULES);

 	/* misc options */
 	else if (!strcmp(arg, "-z"))
diff --git a/diff.h b/diff.h
index 6616877..9019f6f 100644
--- a/diff.h
+++ b/diff.h
@@ -66,6 +66,9 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
 #define DIFF_OPT_DIRSTAT_CUMULATIVE  (1 << 19)
 #define DIFF_OPT_DIRSTAT_BY_FILE     (1 << 20)
 #define DIFF_OPT_ALLOW_TEXTCONV      (1 << 21)
+
+#define DIFF_OPT_SUMMARIZE_SUBMODULES (1 << 23)
+
 #define DIFF_OPT_TST(opts, flag)    ((opts)->flags & DIFF_OPT_##flag)
 #define DIFF_OPT_SET(opts, flag)    ((opts)->flags |= DIFF_OPT_##flag)
 #define DIFF_OPT_CLR(opts, flag)    ((opts)->flags &= ~DIFF_OPT_##flag)
diff --git a/submodule.c b/submodule.c
new file mode 100644
index 0000000..129583b
--- /dev/null
+++ b/submodule.c
@@ -0,0 +1,113 @@
+#include "cache.h"
+#include "submodule.h"
+#include "dir.h"
+#include "diff.h"
+#include "commit.h"
+#include "revision.h"
+
+int add_submodule_odb(const char *path)
+{
+	struct strbuf objects_directory = STRBUF_INIT;
+	struct alternate_object_database *alt_odb;
+
+	strbuf_addf(&objects_directory, "%s/.git/objects/", path);
+	if (!is_directory(objects_directory.buf))
+		return -1;
+
+	/* avoid adding it twice */
+	for (alt_odb = alt_odb_list; alt_odb; alt_odb = alt_odb->next)
+		if (alt_odb->name - alt_odb->base == objects_directory.len &&
+				!strncmp(alt_odb->base, objects_directory.buf,
+					objects_directory.len))
+			return 0;
+
+	alt_odb = xmalloc(objects_directory.len + 42 + sizeof(*alt_odb));
+	alt_odb->next = alt_odb_list;
+	strcpy(alt_odb->base, objects_directory.buf);
+	alt_odb->name = alt_odb->base + objects_directory.len;
+	alt_odb->name[2] = '/';
+	alt_odb->name[40] = '\0';
+	alt_odb->name[41] = '\0';
+	alt_odb_list = alt_odb;
+	prepare_alt_odb();
+	return 0;
+}
+
+void show_submodule_summary(FILE *f, const char *path,
+		unsigned char one[20], unsigned char two[20],
+		const char *del, const char *add, const char *reset)
+{
+	struct rev_info rev;
+	struct commit *commit, *left = left, *right;
+	struct commit_list *merge_bases, *list;
+	const char *message = NULL;
+	struct strbuf sb = STRBUF_INIT;
+	static const char *format = "    %m %s";
+	int fast_forward = 0, fast_backward = 0;
+
+	if (add_submodule_odb(path))
+		message = "(not checked out)";
+	else if (is_null_sha1(one))
+		message = "(new submodule)";
+	else if (is_null_sha1(two))
+		message = "(submodule deleted)";
+	else if (!(left = lookup_commit_reference(one)) ||
+		 !(right = lookup_commit_reference(two)))
+		message = "(commits not present)";
+
+	if (!message) {
+		init_revisions(&rev, NULL);
+		setup_revisions(0, NULL, &rev, NULL);
+		rev.left_right = 1;
+		rev.first_parent_only = 1;
+		left->object.flags |= SYMMETRIC_LEFT;
+		add_pending_object(&rev, &left->object, path);
+		add_pending_object(&rev, &right->object, path);
+		merge_bases = get_merge_bases(left, right, 1);
+		if (merge_bases) {
+			if (merge_bases->item == left)
+				fast_forward = 1;
+			else if (merge_bases->item == right)
+				fast_backward = 1;
+		}
+		for (list = merge_bases; list; list = list->next) {
+			list->item->object.flags |= UNINTERESTING;
+			add_pending_object(&rev, &list->item->object,
+				sha1_to_hex(list->item->object.sha1));
+		}
+		if (prepare_revision_walk(&rev))
+			message = "(revision walker failed)";
+	}
+
+	strbuf_addf(&sb, "Submodule %s %s..", path,
+			find_unique_abbrev(one, DEFAULT_ABBREV));
+	if (!fast_backward && !fast_forward)
+		strbuf_addch(&sb, '.');
+	strbuf_addf(&sb, "%s", find_unique_abbrev(two, DEFAULT_ABBREV));
+	if (message)
+		strbuf_addf(&sb, " %s\n", message);
+	else
+		strbuf_addf(&sb, "%s:\n", fast_backward ? " (rewind)" : "");
+	fwrite(sb.buf, sb.len, 1, f);
+
+	if (!message) {
+		while ((commit = get_revision(&rev))) {
+			strbuf_setlen(&sb, 0);
+			if (commit->object.flags & SYMMETRIC_LEFT) {
+				if (del)
+					strbuf_addstr(&sb, del);
+			}
+			else if (add)
+				strbuf_addstr(&sb, add);
+			format_commit_message(commit, format, &sb,
+					rev.date_mode);
+			if (reset)
+				strbuf_addstr(&sb, reset);
+			strbuf_addch(&sb, '\n');
+			fprintf(f, "%s", sb.buf);
+		}
+		clear_commit_marks(left, ~0);
+		clear_commit_marks(right, ~0);
+	}
+	strbuf_release(&sb);
+}
diff --git a/submodule.h b/submodule.h
new file mode 100644
index 0000000..4c0269d
--- /dev/null
+++ b/submodule.h
@@ -0,0 +1,8 @@
+#ifndef SUBMODULE_H
+#define SUBMODULE_H
+
+void show_submodule_summary(FILE *f, const char *path,
+		unsigned char one[20], unsigned char two[20],
+		const char *del, const char *add, const char *reset);
+
+#endif
-- 
1.6.5.4.g707c

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/4] fix indentation depth for git diff --submodule-summary
  2009-10-14 18:29 ` Jens Lehmann
  2009-10-14 18:30   ` [PATCH 1/4] Add the --submodule-summary option to the diff option family Jens Lehmann
@ 2009-10-14 18:31   ` Jens Lehmann
  2009-10-14 18:31   ` [PATCH 3/4] fix output for deleted submodules in " Jens Lehmann
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 18:31 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Junio C Hamano, Git Mailing List

Indentation depth was 4, but submodule summary uses 2 as other shortlogs
do too.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 submodule.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/submodule.c b/submodule.c
index 129583b..5076113 100644
--- a/submodule.c
+++ b/submodule.c
@@ -42,7 +42,7 @@ void show_submodule_summary(FILE *f, const char *path,
 	struct commit_list *merge_bases, *list;
 	const char *message = NULL;
 	struct strbuf sb = STRBUF_INIT;
-	static const char *format = "    %m %s";
+	static const char *format = "  %m %s";
 	int fast_forward = 0, fast_backward = 0;

 	if (add_submodule_odb(path))
-- 
1.6.5.4.g707c

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/4] fix output for deleted submodules in git diff --submodule-summary
  2009-10-14 18:29 ` Jens Lehmann
  2009-10-14 18:30   ` [PATCH 1/4] Add the --submodule-summary option to the diff option family Jens Lehmann
  2009-10-14 18:31   ` [PATCH 2/4] fix indentation depth for git diff --submodule-summary Jens Lehmann
@ 2009-10-14 18:31   ` Jens Lehmann
  2009-10-14 18:32   ` [PATCH 4/4] add tests for " Jens Lehmann
  2009-10-14 20:34   ` submodule-summary Junio C Hamano
  4 siblings, 0 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 18:31 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Junio C Hamano, Git Mailing List

When a submodule has been deleted, add_submodule_odb() returns false
because the directory of the submodule is gone. So we have to test the
second sha for null before we call add_submodule_odb() to get the correct
output.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 submodule.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/submodule.c b/submodule.c
index 5076113..d5fce7a 100644
--- a/submodule.c
+++ b/submodule.c
@@ -45,12 +45,12 @@ void show_submodule_summary(FILE *f, const char *path,
 	static const char *format = "  %m %s";
 	int fast_forward = 0, fast_backward = 0;

-	if (add_submodule_odb(path))
+	if (is_null_sha1(two))
+		message = "(submodule deleted)";
+	else if (add_submodule_odb(path))
 		message = "(not checked out)";
 	else if (is_null_sha1(one))
 		message = "(new submodule)";
-	else if (is_null_sha1(two))
-		message = "(submodule deleted)";
 	else if (!(left = lookup_commit_reference(one)) ||
 		 !(right = lookup_commit_reference(two)))
 		message = "(commits not present)";
-- 
1.6.5.4.g707c

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/4] add tests for git diff --submodule-summary
  2009-10-14 18:29 ` Jens Lehmann
                     ` (2 preceding siblings ...)
  2009-10-14 18:31   ` [PATCH 3/4] fix output for deleted submodules in " Jens Lehmann
@ 2009-10-14 18:32   ` Jens Lehmann
  2009-10-14 20:34   ` submodule-summary Junio C Hamano
  4 siblings, 0 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 18:32 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Junio C Hamano, Git Mailing List

Copied from the submodule summary test and changed to reflect the
differences in the output of git diff --submodule-summary.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 t/t4041-diff-submodule-summary.sh |  206 +++++++++++++++++++++++++++++++++++++
 1 files changed, 206 insertions(+), 0 deletions(-)
 create mode 100755 t/t4041-diff-submodule-summary.sh

diff --git a/t/t4041-diff-submodule-summary.sh b/t/t4041-diff-submodule-summary.sh
new file mode 100755
index 0000000..dbb19eb
--- /dev/null
+++ b/t/t4041-diff-submodule-summary.sh
@@ -0,0 +1,206 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Jens Lehmann, based on t7401 by Ping Yin
+#
+
+test_description='Summary support for submodules implemented in git diff
+
+This test tries to verify the sanity of --submodule-summary option of git diff.
+'
+
+. ./test-lib.sh
+
+add_file () {
+	sm=$1
+	shift
+	owd=$(pwd)
+	cd "$sm"
+	for name; do
+		echo "$name" > "$name" &&
+		git add "$name" &&
+		test_tick &&
+		git commit -m "Add $name"
+	done >/dev/null
+	git rev-parse --verify HEAD | cut -c1-7
+	cd "$owd"
+}
+commit_file () {
+	test_tick &&
+	git commit "$@" -m "Commit $*" >/dev/null
+}
+
+test_create_repo sm1 &&
+add_file . foo >/dev/null
+
+head1=$(add_file sm1 foo1 foo2)
+
+test_expect_success 'added submodule' "
+	git add sm1 &&
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 0000000...$head1 (new submodule)
+EOF
+"
+
+commit_file sm1 &&
+head2=$(add_file sm1 foo3)
+
+test_expect_success 'modified submodule(forward)' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head1..$head2:
+  > Add foo3
+EOF
+"
+
+test_expect_success 'modified submodule(forward)' "
+	git diff --submodule-summary >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head1..$head2:
+  > Add foo3
+EOF
+"
+
+commit_file sm1 &&
+cd sm1 &&
+git reset --hard HEAD~2 >/dev/null &&
+head3=$(git rev-parse --verify HEAD | cut -c1-7) &&
+cd ..
+
+test_expect_success 'modified submodule(backward)' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head2..$head3 (rewind):
+  < Add foo3
+  < Add foo2
+EOF
+"
+
+head4=$(add_file sm1 foo4 foo5) &&
+head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)
+test_expect_success 'modified submodule(backward and forward)' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head2...$head4:
+  > Add foo5
+  > Add foo4
+  < Add foo3
+  < Add foo2
+EOF
+"
+
+commit_file sm1 &&
+mv sm1 sm1-bak &&
+echo sm1 >sm1 &&
+head5=$(git hash-object sm1 | cut -c1-7) &&
+git add sm1 &&
+rm -f sm1 &&
+mv sm1-bak sm1
+
+test_expect_success 'typechanged submodule(submodule->blob), --cached' "
+	git diff --submodule-summary --cached >actual &&
+	diff actual - <<-EOF
+Submodule sm1 41fbea9...0000000 (submodule deleted)
+diff --git a/sm1 b/sm1
+new file mode 100644
+index 0000000..9da5fb8
+--- /dev/null
++++ b/sm1
+@@ -0,0 +1 @@
++sm1
+EOF
+"
+
+test_expect_success 'typechanged submodule(submodule->blob)' "
+	git diff --submodule-summary >actual &&
+	diff actual - <<-EOF
+diff --git a/sm1 b/sm1
+deleted file mode 100644
+index 9da5fb8..0000000
+--- a/sm1
++++ /dev/null
+@@ -1 +0,0 @@
+-sm1
+Submodule sm1 0000000...$head4 (new submodule)
+EOF
+"
+
+rm -rf sm1 &&
+git checkout-index sm1
+test_expect_success 'typechanged submodule(submodule->blob)' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head4...0000000 (submodule deleted)
+diff --git a/sm1 b/sm1
+new file mode 100644
+index 0000000..$head5
+--- /dev/null
++++ b/sm1
+@@ -0,0 +1 @@
++sm1
+EOF
+"
+
+rm -f sm1 &&
+test_create_repo sm1 &&
+head6=$(add_file sm1 foo6 foo7)
+test_expect_success 'nonexistent commit' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head4...$head6 (commits not present)
+EOF
+"
+
+commit_file
+test_expect_success 'typechanged submodule(blob->submodule)' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+diff --git a/sm1 b/sm1
+deleted file mode 100644
+index $head5..0000000
+--- a/sm1
++++ /dev/null
+@@ -1 +0,0 @@
+-sm1
+Submodule sm1 0000000...$head6 (new submodule)
+EOF
+"
+
+commit_file sm1 &&
+rm -rf sm1
+test_expect_success 'deleted submodule' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head6...0000000 (submodule deleted)
+EOF
+"
+
+test_create_repo sm2 &&
+head7=$(add_file sm2 foo8 foo9) &&
+git add sm2
+
+test_expect_success 'multiple submodules' "
+	git diff-index -p --submodule-summary HEAD >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head6...0000000 (submodule deleted)
+Submodule sm2 0000000...$head7 (new submodule)
+EOF
+"
+
+test_expect_success 'path filter' "
+	git diff-index -p --submodule-summary HEAD sm2 >actual &&
+	diff actual - <<-EOF
+Submodule sm2 0000000...$head7 (new submodule)
+EOF
+"
+
+commit_file sm2
+test_expect_success 'given commit' "
+	git diff-index -p --submodule-summary HEAD^ >actual &&
+	diff actual - <<-EOF
+Submodule sm1 $head6...0000000 (submodule deleted)
+Submodule sm2 0000000...$head7 (new submodule)
+EOF
+"
+
+test_done
-- 
1.6.5.4.g707c

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* submodule-summary
  2009-10-14 18:29 ` Jens Lehmann
                     ` (3 preceding siblings ...)
  2009-10-14 18:32   ` [PATCH 4/4] add tests for " Jens Lehmann
@ 2009-10-14 20:34   ` Junio C Hamano
  2009-10-14 21:27     ` submodule-summary Jens Lehmann
  4 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-10-14 20:34 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Git Mailing List

Jens Lehmann <Jens.Lehmann@web.de> writes:

> Dscho condensed his initial patch with the interdiff you mentioned,
> additionally silenced a compiler warning and activated --first-parent.
> This follows as patch 1/4. Patches 2/4 to 4/4 contain my two bugfixes
> and the testcase i copied from submodule summary while adapting it to
> the changes of the output format.

I think 2 and 3 should be squashed into the first one.  I do not see any
good reason for keeping initial "oops that was wrong" etched in stone,
once the review process has revealed obvious bugs and reasonable fixes
have been given to them.  If the original author re-spun a v2 patch, that
is the normal thing that happens.

I am not happy with the option name --submodule-summary, by the way.
Naming this option --submodule-summary shows the confusion between this
series being the _latest_ great invention and this series being the _last_
great invention.  I'd freely grant the former but would like to avoid the
latter.

I have this nagging suspicion that we should leave the door open for later
addition of --submodule=full that actually gives the patch text for the
entire aggregated tree, perhaps recursively.  People may want to add even
more other useful modes that we do not think of right now. It would be
better to name this --submodule=shortlog or something.

If users like the shortlog mode (or the full mode) very much, perhaps the
current default output, which shows the differences between two commit
object names, can become a --submodule=summary (or --submodule=twoline)
mode later, and the shortlog mode could become the default.

> The remaining differences from the output shown by submodule summary are:
>
> 1) git diff shows only two dots for a fast forward (submodule summary
>    always shows three)
> 2) git diff shows "Submodule" instead of a single '*' in the first line
> 3) git diff doesn't add a newline after each shortlog
> 4) submodule summary prints out the number of shortlog entries, this
>    version does not
> 5) submodule summary can limit the number of shortlog lines, git diff
>    can't do that right now
> 6) When files are replaced by a submodules or vice versa, git diff
>    generates an extra hunk for the deleted/added file and one saying
>    "(new submodule)"/"(submodule deleted)"
>
>> The output format needs to be described better here and also in
>> Documentation/diff-format.txt.
>
> Will do when it is clear which of the 6 differences should be fixed and
> which can stay.

Thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: submodule-summary
  2009-10-14 20:34   ` submodule-summary Junio C Hamano
@ 2009-10-14 21:27     ` Jens Lehmann
  2009-10-14 22:42       ` submodule-summary Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Jens Lehmann @ 2009-10-14 21:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Junio C Hamano schrieb:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> Dscho condensed his initial patch with the interdiff you mentioned,
>> additionally silenced a compiler warning and activated --first-parent.
>> This follows as patch 1/4. Patches 2/4 to 4/4 contain my two bugfixes
>> and the testcase i copied from submodule summary while adapting it to
>> the changes of the output format.
> 
> I think 2 and 3 should be squashed into the first one.  I do not see any
> good reason for keeping initial "oops that was wrong" etched in stone,
> once the review process has revealed obvious bugs and reasonable fixes
> have been given to them.  If the original author re-spun a v2 patch, that
> is the normal thing that happens.

Right, will do.


> I am not happy with the option name --submodule-summary, by the way.
> Naming this option --submodule-summary shows the confusion between this
> series being the _latest_ great invention and this series being the _last_
> great invention.  I'd freely grant the former but would like to avoid the
> latter.
> 
> I have this nagging suspicion that we should leave the door open for later
> addition of --submodule=full that actually gives the patch text for the
> entire aggregated tree, perhaps recursively.  People may want to add even
> more other useful modes that we do not think of right now. It would be
> better to name this --submodule=shortlog or something.
> 
> If users like the shortlog mode (or the full mode) very much, perhaps the
> current default output, which shows the differences between two commit
> object names, can become a --submodule=summary (or --submodule=twoline)
> mode later, and the shortlog mode could become the default.

Good point. (Personally i like the options --submodule=shortlog and
--submodule=twoline. Because IMHO --submodule=summary could make
people expect similar output to git submodule summary, no?).

Thanks for your feedback, will send new patches soon.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: submodule-summary
  2009-10-14 21:27     ` submodule-summary Jens Lehmann
@ 2009-10-14 22:42       ` Junio C Hamano
  2009-10-15 10:34         ` submodule-summary Jens Lehmann
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2009-10-14 22:42 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Git Mailing List

Jens Lehmann <Jens.Lehmann@web.de> writes:

> Good point. (Personally i like the options --submodule=shortlog and
> --submodule=twoline. Because IMHO --submodule=summary could make
> people expect similar output to git submodule summary, no?).

Well, _that_ is something we could fix in "git submodule", isn't it?

Right now, the only way "git submodule" command can summarize the changes
is by showing a left-right shortlog, but it wouldn't be so inconceivable
that somebody may come up with different and equally useful way to show
them, e.g. diffstat, and at that point, we would probably want to have
"git submodule summary --stat" or "git submodule summary --shortlog" (and
the default being --shortlog).

I am _not_ married to the naming "shortlog", by the way, and shortlog is
rather a bad name for it.  Sorry for suggesting it; it is quite different
from the actual "git shortlog" command output (and no I am not suggesting
to make the output similar to shortlog), but rather is more similar to
"log --left-right --oneline".  But I think you got the point.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: submodule-summary
  2009-10-14 22:42       ` submodule-summary Junio C Hamano
@ 2009-10-15 10:34         ` Jens Lehmann
  0 siblings, 0 replies; 14+ messages in thread
From: Jens Lehmann @ 2009-10-15 10:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Junio C Hamano schrieb:
> I am _not_ married to the naming "shortlog", by the way, and shortlog is
> rather a bad name for it.  Sorry for suggesting it; it is quite different
> from the actual "git shortlog" command output (and no I am not suggesting
> to make the output similar to shortlog), but rather is more similar to
> "log --left-right --oneline".  But I think you got the point.

I have no strong feelings about the option names either. What about
"--submodule=short" for the current default git diff output and
"--submodule=left-right-log" for the one resembling the current output
of submodule summary? I really don't know, if there are better proposals
i'll happily use them.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-10-15 10:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12  3:18 What's cooking in git.git (Oct 2009, #02; Sun, 11) Junio C Hamano
2009-10-12  5:14 ` Jeff King
2009-10-12 22:52   ` Junio C Hamano
2009-10-14  4:24     ` Jeff King
2009-10-12  6:23 ` Sverre Rabbelier
2009-10-14 18:29 ` Jens Lehmann
2009-10-14 18:30   ` [PATCH 1/4] Add the --submodule-summary option to the diff option family Jens Lehmann
2009-10-14 18:31   ` [PATCH 2/4] fix indentation depth for git diff --submodule-summary Jens Lehmann
2009-10-14 18:31   ` [PATCH 3/4] fix output for deleted submodules in " Jens Lehmann
2009-10-14 18:32   ` [PATCH 4/4] add tests for " Jens Lehmann
2009-10-14 20:34   ` submodule-summary Junio C Hamano
2009-10-14 21:27     ` submodule-summary Jens Lehmann
2009-10-14 22:42       ` submodule-summary Junio C Hamano
2009-10-15 10:34         ` submodule-summary Jens Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).