git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's cooking in git.git (Jun 2012, #03; Wed, 13)
@ 2012-06-13 23:01 Junio C Hamano
  2012-06-14  8:18 ` lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13)) Matthieu Moy
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-06-13 23:01 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with '-' are
only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'.

Most likely, I'll tag 1.7.11 final this weekend.  It doesn't look
like there is any remaining topic that cannot wait for the next
cycle.  A few small regressions on the master front have been
patched up, and it seems we are good to go.

You can find the changes described here in the integration branches of the
repositories listed at

    http://git-blame.blogspot.com/p/git-public-repositories.html

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

* nd/i18n-branch-lego (2012-06-07) 1 commit
 - Remove i18n legos in notifying new branch tracking setup

Restructure the way message strings are created, in preparation for
marking them for i18n.

* nd/i18n-misc (2012-06-07) 3 commits
 - rerere: remove i18n legos in result message
 - notes-merge: remove i18n legos in merge result message
 - reflog: remove i18n legos in pruning message

Restructure the way message strings are created, in preparation for
marking them for i18n.

* rr/doc-commit (2012-06-08) 1 commit
 - commit: document a couple of options

* hv/remote-end-hung-up (2012-06-11) 1 commit
 - lessen the impression of unexpectedness on remote hangup

* hv/submodule-checkout-nuke-submodules (2012-06-11) 1 commit
 - update-index: allow overwriting existing submodule index entries

* jc/rev-list-simplify-merges-first-parent (2012-06-13) 3 commits
 - revision: ignore side parents while running simplify-merges
 - revision: note the lack of free() in simplify_merges()
 - revision: "simplify" options imply topo-order sort

* jc/ustar-checksum-is-unsigned (2012-06-13) 1 commit
 - archive: ustar header checksum is computed unsigned

* rs/git-blame-mapcar-mapc (2012-06-10) 1 commit
 - git-blame.el: use mapc instead of mapcar

* rs/ipv6-ssh-url (2012-06-13) 1 commit
 - git: Wrong parsing of ssh urls with IPv6 literals ignores port

* vr/use-our-perl-in-tests (2012-06-12) 3 commits
 - t/README: add a bit more Don'ts
 - tests: enclose $PERL_PATH in duoble quotes
 - t: Replace 'perl' by $PERL_PATH

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

* cr/persistent-https (2012-05-30) 1 commit
  (merged to 'next' on 2012-06-01 at c647464)
 + Add persistent-https to contrib

A remote helper that acts as a proxy that caches ssl session for the
https:// transport is added to the contrib/ area.

* jc/fmt-merge-msg-people (2012-06-06) 1 commit
  (merged to 'next' on 2012-06-08 at 7d8f4b6)
 + fmt-merge-msg: make attribution into comment lines

* jc/svn-auth-providers-unusable-at-1.6.12 (2012-06-04) 1 commit
  (merged to 'next' on 2012-06-04 at c4ffe24)
 + git-svn: platform auth providers are working only on 1.6.15 or newer

Regression fix for people with libsvn between 1.6.12 and 1.6.15 on
which we tried to use non-working platform auth providers.

* mm/api-credentials-doc (2012-06-07) 5 commits
 + docs: fix cross-directory linkgit references
  (merged to 'next' on 2012-06-05 at 8e14814)
 + api-credentials.txt: add "see also" section
 + api-credentials.txt: mention credential.helper explicitly
 + api-credentials.txt: show the big picture first
 + doc: fix xref link from api docs to manual pages

* rr/maint-t3510-cascade-fix (2012-06-04) 1 commit
  (merged to 'next' on 2012-06-04 at 4c3368b)
 + t3510 (cherry-pick-sequence): add missing '&&'

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

* nl/http-proxy-more (2012-05-11) 2 commits
 - http: rename HTTP_REAUTH to HTTP_AUTH_RETRY
 - http: Avoid limit of retrying request only twice

I queued only the later two patches from this series, even though they do
not make much sense without the first one that seems to need a bit more
work, so that we won't forget.

* jk/no-op-push-message (2012-05-30) 1 commit
 - improve no-op push output

Rewords the status message of "git push" that pushed only one ref
differently from "Everything up-to-date", to give a bit more help to
people who get the message when their current branch is not pushed.

I had an impression after the discussion thread that a redesign is
coming, but it hasn't happened yet.

* fc/git-prompt-script (2012-06-10) 6 commits
 - completion: warn people about duplicated function
 - completion: split __git_ps1 into a separate script
 - completion: remove executable mode
 - Merge branch 'fc/git-complete-helper' into fc/git-prompt-script
 - tests: add tests for the bash prompt functions in the completion script
 - tests: move code to run tests under bash into a helper library
 (this branch is tangled with sg/bash-prompt.)

The last remaining sticking point is what to do with the duplicated
shell function.  Together with the warning patch at the tip, if we
side port the tip commit from sg/bash-prompt, I think this will be
ready for testing.

* sg/bash-prompt (2012-05-09) 4 commits
 - completion: respect $GIT_DIR
 - completion: use __gitdir() in _git_log()
 - tests: add tests for the bash prompt functions in the completion script
 - tests: move code to run tests under bash into a helper library
 (this branch is tangled with fc/git-prompt-script.)

This is only the "correction" bits taken from the beginning of a larger
series that is to be rerolled.  The first two are tangled with Felipe's
topic so a reroll, if comes, should build on top of them.

* jc/maint-push-refs-all (2012-05-04) 2 commits
 - get_fetch_map(): tighten checks on dest refs
 - fetch/push: allow refs/*:refs/*

Allows pushing and fetching refs/stash.
There still seem to be other bugs hiding (e.g. try pushing twice).

Not ready.

* jc/run-hook-env-1 (2012-03-11) 1 commit
 - run_hook(): enhance the interface to pass arbitrary environment

Not urgent.

Updates run_hook() API to be much less specific to "commit".  It would
only be useful if people start doing more interesting things with hooks.

* jc/split-blob (2012-04-03) 6 commits
 - chunked-object: streaming checkout
 - chunked-object: fallback checkout codepaths
 - bulk-checkin: support chunked-object encoding
 - bulk-checkin: allow the same data to be multiply hashed
 - new representation types in the packstream
 - packfile: use varint functions

Not ready.

I finished the streaming checkout codepath, but as explained in
127b177 (bulk-checkin: support chunked-object encoding, 2011-11-30),
these are still early steps of a long and painful journey. At least
pack-objects and fsck need to learn the new encoding for the series
to be usable locally, and then index-pack/unpack-objects needs to
learn it to be used remotely.

Given that I heard a lot of noise that people want large files, and
that I was asked by somebody at GitTogether'11 privately for an
advice on how to pay developers (not me) to help adding necessary
support, I am somewhat dissapointed that the original patch series
that was sent almost two months ago still remains here without much
comments and updates from the developer community. I even made the
interface to the logic that decides where to split chunks easily
replaceable, and I deliberately made the logic in the original patch
extremely stupid to entice others, especially the "bup" fanboys, to
come up with a better logic, thinking that giving people an easy
target to shoot for, they may be encouraged to help out. The plan is
not working :-(.

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

* jc/apply-3way (2012-06-13) 19 commits
 - apply --3way: tests
 - apply: document --3way option
 - apply: allow rerere() upon --3way results
 - apply: register conflicted stages to the index
 - apply: --3way with add/add conflict
 - apply: move verify_index_match() higher
 - apply: plug the three-way merge logic in
 - apply: fall back on three-way merge
 - apply: accept -3/--3way command line option
 - apply: move "already exists" logic to check_to_create()
 - apply: move check_to_create_blob() closer to its sole caller
 - apply: further split load_preimage()
 - apply: refactor "previous patch" logic
 - apply: split load_preimage() helper function out
 - apply: factor out checkout_target() helper function
 - apply: refactor read_file_or_gitlink()
 - apply: clear_image() clears things a bit more
 - apply: a bit more comments on PATH_TO_BE_DELETED
 - apply: fix an incomplete comment in check_patch()

"git apply" learns to wiggle the base version and perform three-way merge
when a patch does not exactly apply to the version you have.


* nd/exclude-workaround-top-heavy (2012-06-07) 3 commits
 - exclude: do strcmp as much as possible before fnmatch
 - dir.c: get rid of the wildcard symbol set in no_wildcard()
 - Unindent excluded_from_list()

Attempts to optimize matching with an exclude pattern with a deep
directory hierarchy by taking the part that specifies leading path
without wildcard literally.

* jc/bundle-complete-notice (2012-06-04) 1 commit
  (merged to 'next' on 2012-06-05 at ee25a35)
 + tweak "bundle verify" of a complete history

Running "git bundle verify" on a bundle that records a complete
history said "it requires these 0 commits".

Not urgent; probably early post 1.7.11.

* lk/more-helpful-status-hints (2012-06-11) 5 commits
 - fixup! status: better advices when splitting a commit (during rebase -i)
 - status: better advices when splitting a commit (during rebase -i)
 - status: don't suggest "git rm" or "git add" if not appropriate
 - t7512-status-help.sh: better advices for git status
 - wt-status.*: better advices for git status added

Almost there, modulo minor details pointed out by Matthieu.

* jk/no-more-pre-exec-callback (2012-06-05) 1 commit
 - pager: drop "wait for output to run less" hack

On hold for 6 months until ancient "less" goes extinct.

* jk/maint-t1304-setfacl (2012-06-07) 1 commit
  (merged to 'next' on 2012-06-08 at ebba27c)
 + t1304: improve setfacl prerequisite setup

Works around a false test failure caused by a bug in ecryptofs.

Not urgent; probably early post 1.7.11.

* lk/rebase-i-x (2012-06-13) 1 commit
 - rebase -i: teach "--exec <cmd>"

Adds -x <cmd> to "rebase -i" to insert "exec <cmd>" after each
commit in the resulting history.

Will merge to next after 1.7.11.

* vr/help-per-platform (2012-06-06) 1 commit
  (merged to 'next' on 2012-06-08 at f4b2b0b)
 + help: use HTML as the default help format on Windows

Not urgent; probably early post 1.7.11.

* jc/ls-files-i-dir (2012-06-05) 6 commits
  (merged to 'next' on 2012-06-08 at 2b5a256)
 + dir.c: make excluded() file scope static
 + unpack-trees.c: use path_excluded() in check_ok_to_remove()
 + builtin/add.c: use path_excluded()
 + path_excluded(): update API to less cache-entry centric
  (merged to 'next' on 2012-06-05 at 8f35db3)
 + ls-files -i: micro-optimize path_excluded()
 + ls-files -i: pay attention to exclusion of leading paths

"git ls-files --exclude=t -i" did not consider anything under t/
as excluded, as it did not pay attention to exclusion of leading
paths while walking the index.  Other two users of excluded() are
also updated.

Not urgent; probably early post 1.7.11.

* jc/request-pull-match-tagname (2012-06-01) 1 commit
  (merged to 'next' on 2012-06-05 at f0dc420)
 + request-pull: really favor a matching tag

"git request-pull $url dev" when the tip of "dev" branch was tagged
with "ext4-for-linus" used the contents from the tag in the output
but still asked the "dev" branch to be pulled, not the tag.

Not urgent; probably early post 1.7.11.

* db/vcs-svn (2012-06-01) 6 commits
 - vcs-svn: drop no-op reset methods
 - vcs-svn: fix signedness warnings
 - vcs-svn: prefer strstr over memmem
 - vcs-svn: prefer constcmp to prefixcmp
 - vcs-svn: simplify cleanup in apply_one_window()
 - vcs-svn: fix clang-analyzer error

I'd take Jonathan's clean-up offer and keep this on hold until
1.7.11 final.

* jk/version-string (2012-06-03) 3 commits
  (merged to 'next' on 2012-06-05 at b6f7266)
 + http: get default user-agent from git_user_agent
 + version: add git_user_agent function
 + move git_version_string into version.c

Will merge to master early post 1.7.11.

* nd/stream-pack-objects (2012-05-29) 1 commit
 - pack-objects: use streaming interface for reading large loose blobs

Will merge to next after 1.7.11.

* jk/clone-local (2012-05-30) 2 commits
  (merged to 'next' on 2012-06-05 at b819eb5)
 + clone: allow --no-local to turn off local optimizations
 + docs/clone: mention that --local may be ignored

"git clone --local $path" started its life as an experiment to
optionally use link/copy when cloning a repository on the disk, but
we didn't deprecate it after we made the option a no-op to always
use the optimization.

Not urgent; probably early post 1.7.11.

* jk/no-more-asciidoc7 (2012-05-30) 2 commits
  (merged to 'next' on 2012-06-05 at 3f117df)
 + docs: drop antique comment from Makefile
 + docs: drop asciidoc7compatible flag

Not urgent; probably early post 1.7.11.

* nd/stream-index-pack (2012-05-24) 4 commits
 - index-pack: use streaming interface for collision test on large blobs
 - index-pack: factor out unpack core from get_data_from_pack
 - index-pack: use streaming interface on large blobs (most of the time)
 - index-pack: hash non-delta objects while reading from stream

Use streaming API to read from the object store to avoid having to hold
a large blob object in-core while running index-pack.

Will merge to next after 1.7.11.

* js/submodule-relative (2012-06-06) 4 commits
 - submodule: fix handling of superproject origin URLs like foo, ./foo and ./foo/bar
 - submodule: fix sync handling of some relative superproject origin URLs
 - submodule: document failure to handle relative superproject origin URLs
 - submodule: additional regression tests for relative URLs

Makes "git submodule" deal with nested submodule structure where a
module is contained within a module whose origin is specified as a
relative URL to its superproject's origin.

Not urgent; probably early post 1.7.11.

* mm/push-default-switch-warning (2012-06-06) 1 commit
 - push: start warning upcoming default change for push.default

Will merge to next after 1.7.11.

Hopwefully we can have a solidly tested series early in 1.7.12 or
1.7.13 at the latest.

--------------------------------------------------
[Discarded]

* cb/daemon-test-race-fix (2012-04-27) 2 commits
  (merged to 'next' on 2012-04-27 at 84bbcf8)
 + Revert "git-daemon wrapper to wait until daemon is ready"
  (merged to 'next' on 2012-04-24 at d5c30be)
 + git-daemon wrapper to wait until daemon is ready

Reverted from 'next' to replace it with js/daemon-test-race-fix.

* jc/merge-annotated-tag (2012-06-05) 2 commits
 . merge: allow fast-forwarding to an annotated but unsigned tag
 . merge: separte the logic to check for a signed tag

"git merge anno" created a merge commit even when anno is an
unsigned annotated tag that points at a commit that can be fast
forwarded to; this came from a laziness of the implementation of
merging of signed tags in 1.7.9.  People may have different opinion
on making signed and unsigned annotated tag behave differently, but
I tend to agree that it is probably not a good idea.

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

* lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13))
  2012-06-13 23:01 What's cooking in git.git (Jun 2012, #03; Wed, 13) Junio C Hamano
@ 2012-06-14  8:18 ` Matthieu Moy
  2012-06-14  8:20 ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically y
  2012-06-14  8:20 ` y
  2 siblings, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2012-06-14  8:18 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: git, Valentin DUPERRAY, Franck JONAS, Lucien KONG, Thomas NGUY,
	Huynh Khoi Nguyen NGUYEN

Junio C Hamano <gitster@pobox.com> writes:

> * lk/more-helpful-status-hints (2012-06-11) 5 commits
>  - fixup! status: better advices when splitting a commit (during rebase -i)
>  - status: better advices when splitting a commit (during rebase -i)
>  - status: don't suggest "git rm" or "git add" if not appropriate
>  - t7512-status-help.sh: better advices for git status
>  - wt-status.*: better advices for git status added
>
> Almost there, modulo minor details pointed out by Matthieu.

The details I pointed out earlier are already fixed. I went through the
serie again, and suggest two more minor fixups:

fixup! reword message when splitting a commit.
fixup! don't allocate struct wt_status_state dynamically

patches follow.

> * lk/rebase-i-x (2012-06-13) 1 commit
>  - rebase -i: teach "--exec <cmd>"
>
> Adds -x <cmd> to "rebase -i" to insert "exec <cmd>" after each
> commit in the resulting history.
>
> Will merge to next after 1.7.11.

Cool!

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically
  2012-06-13 23:01 What's cooking in git.git (Jun 2012, #03; Wed, 13) Junio C Hamano
  2012-06-14  8:18 ` lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13)) Matthieu Moy
@ 2012-06-14  8:20 ` y
  2012-06-14 17:13   ` Junio C Hamano
  2012-06-14  8:20 ` y
  2 siblings, 1 reply; 8+ messages in thread
From: y @ 2012-06-14  8:20 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthieu Moy

From: Matthieu Moy <Matthieu.Moy@imag.fr>

The common

void function() {
	struct wt_status_state *state = calloc(...);
	...
	free(state);
}

is essentially a less efficient, and more error prone way of allocating a
variable on the stack (plus, the calloc should have been a xcalloc).
Replace it with an on-stack variable.

While we're there, also replace the individual initializations of fields
with memset(..., 0, ...).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---

(BTW, I didn't find a way to have both --autosquash-compliant and
meaningfull titles)

 wt-status.c | 49 +++++++++++++++++++++----------------------------
 1 file changed, 21 insertions(+), 28 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index ed28b4f..e65716d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -932,49 +932,42 @@ static void show_bisect_in_progress(struct wt_status *s,
 static void wt_status_print_state(struct wt_status *s)
 {
 	const char *state_color = color(WT_STATUS_IN_PROGRESS, s);
-	struct wt_status_state *state = calloc(1, sizeof(*state));
+	struct wt_status_state state;
 	struct stat st;
 
-	state->merge_in_progress = 0;
-	state->am_in_progress = 0;
-	state->am_empty_patch = 0;
-	state->rebase_in_progress = 0;
-	state->rebase_interactive_in_progress = 0;
-	state->cherry_pick_in_progress = 0;
-	state->bisect_in_progress = 0;
+	memset(&state, 0, sizeof(state));
 
 	if (!stat(git_path("MERGE_HEAD"), &st)) {
-		state->merge_in_progress = 1;
+		state.merge_in_progress = 1;
 	} else if (!stat(git_path("rebase-apply"), &st)) {
 		if (!stat(git_path("rebase-apply/applying"), &st)) {
-			state->am_in_progress = 1;
+			state.am_in_progress = 1;
 			if (!stat(git_path("rebase-apply/patch"), &st) && !st.st_size)
-				state->am_empty_patch = 1;
+				state.am_empty_patch = 1;
 		} else {
-			state->rebase_in_progress = 1;
+			state.rebase_in_progress = 1;
 		}
 	} else if (!stat(git_path("rebase-merge"), &st)) {
 		if (!stat(git_path("rebase-merge/interactive"), &st))
-			state->rebase_interactive_in_progress = 1;
+			state.rebase_interactive_in_progress = 1;
 		else
-			state->rebase_in_progress = 1;
+			state.rebase_in_progress = 1;
 	} else if (!stat(git_path("CHERRY_PICK_HEAD"), &st)) {
-		state->cherry_pick_in_progress = 1;
+		state.cherry_pick_in_progress = 1;
 	}
 	if (!stat(git_path("BISECT_LOG"), &st))
-		state->bisect_in_progress = 1;
-
-	if (state->merge_in_progress)
-		show_merge_in_progress(s, state, state_color);
-	else if (state->am_in_progress)
-		show_am_in_progress(s, state, state_color);
-	else if (state->rebase_in_progress || state->rebase_interactive_in_progress)
-		show_rebase_in_progress(s, state, state_color);
-	else if (state->cherry_pick_in_progress)
-		show_cherry_pick_in_progress(s, state, state_color);
-	if (state->bisect_in_progress)
-		show_bisect_in_progress(s, state, state_color);
-	free(state);
+		state.bisect_in_progress = 1;
+
+	if (state.merge_in_progress)
+		show_merge_in_progress(s, &state, state_color);
+	else if (state.am_in_progress)
+		show_am_in_progress(s, &state, state_color);
+	else if (state.rebase_in_progress || state.rebase_interactive_in_progress)
+		show_rebase_in_progress(s, &state, state_color);
+	else if (state.cherry_pick_in_progress)
+		show_cherry_pick_in_progress(s, &state, state_color);
+	if (state.bisect_in_progress)
+		show_bisect_in_progress(s, &state, state_color);
 }
 
 void wt_status_print(struct wt_status *s)
-- 
1.7.11.rc0.57.g84a04c7

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

* [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically
  2012-06-13 23:01 What's cooking in git.git (Jun 2012, #03; Wed, 13) Junio C Hamano
  2012-06-14  8:18 ` lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13)) Matthieu Moy
  2012-06-14  8:20 ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically y
@ 2012-06-14  8:20 ` y
  2012-06-14  8:20   ` [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit y
                     ` (2 more replies)
  2 siblings, 3 replies; 8+ messages in thread
From: y @ 2012-06-14  8:20 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthieu Moy

From: Matthieu Moy <Matthieu.Moy@imag.fr>

The common

void function() {
	struct wt_status_state *state = calloc(...);
	...
	free(state);
}

is essentially a less efficient, and more error prone way of allocating a
variable on the stack (plus, the calloc should have been a xcalloc).
Replace it with an on-stack variable.

While we're there, also replace the individual initializations of fields
with memset(..., 0, ...).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---

(BTW, I didn't find a way to have both --autosquash-compliant and
meaningfull titles)

 wt-status.c | 49 +++++++++++++++++++++----------------------------
 1 file changed, 21 insertions(+), 28 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index ed28b4f..e65716d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -932,49 +932,42 @@ static void show_bisect_in_progress(struct wt_status *s,
 static void wt_status_print_state(struct wt_status *s)
 {
 	const char *state_color = color(WT_STATUS_IN_PROGRESS, s);
-	struct wt_status_state *state = calloc(1, sizeof(*state));
+	struct wt_status_state state;
 	struct stat st;
 
-	state->merge_in_progress = 0;
-	state->am_in_progress = 0;
-	state->am_empty_patch = 0;
-	state->rebase_in_progress = 0;
-	state->rebase_interactive_in_progress = 0;
-	state->cherry_pick_in_progress = 0;
-	state->bisect_in_progress = 0;
+	memset(&state, 0, sizeof(state));
 
 	if (!stat(git_path("MERGE_HEAD"), &st)) {
-		state->merge_in_progress = 1;
+		state.merge_in_progress = 1;
 	} else if (!stat(git_path("rebase-apply"), &st)) {
 		if (!stat(git_path("rebase-apply/applying"), &st)) {
-			state->am_in_progress = 1;
+			state.am_in_progress = 1;
 			if (!stat(git_path("rebase-apply/patch"), &st) && !st.st_size)
-				state->am_empty_patch = 1;
+				state.am_empty_patch = 1;
 		} else {
-			state->rebase_in_progress = 1;
+			state.rebase_in_progress = 1;
 		}
 	} else if (!stat(git_path("rebase-merge"), &st)) {
 		if (!stat(git_path("rebase-merge/interactive"), &st))
-			state->rebase_interactive_in_progress = 1;
+			state.rebase_interactive_in_progress = 1;
 		else
-			state->rebase_in_progress = 1;
+			state.rebase_in_progress = 1;
 	} else if (!stat(git_path("CHERRY_PICK_HEAD"), &st)) {
-		state->cherry_pick_in_progress = 1;
+		state.cherry_pick_in_progress = 1;
 	}
 	if (!stat(git_path("BISECT_LOG"), &st))
-		state->bisect_in_progress = 1;
-
-	if (state->merge_in_progress)
-		show_merge_in_progress(s, state, state_color);
-	else if (state->am_in_progress)
-		show_am_in_progress(s, state, state_color);
-	else if (state->rebase_in_progress || state->rebase_interactive_in_progress)
-		show_rebase_in_progress(s, state, state_color);
-	else if (state->cherry_pick_in_progress)
-		show_cherry_pick_in_progress(s, state, state_color);
-	if (state->bisect_in_progress)
-		show_bisect_in_progress(s, state, state_color);
-	free(state);
+		state.bisect_in_progress = 1;
+
+	if (state.merge_in_progress)
+		show_merge_in_progress(s, &state, state_color);
+	else if (state.am_in_progress)
+		show_am_in_progress(s, &state, state_color);
+	else if (state.rebase_in_progress || state.rebase_interactive_in_progress)
+		show_rebase_in_progress(s, &state, state_color);
+	else if (state.cherry_pick_in_progress)
+		show_cherry_pick_in_progress(s, &state, state_color);
+	if (state.bisect_in_progress)
+		show_bisect_in_progress(s, &state, state_color);
 }
 
 void wt_status_print(struct wt_status *s)
-- 
1.7.11.rc0.57.g84a04c7


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

* [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit.
  2012-06-14  8:20 ` y
  2012-06-14  8:20   ` [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit y
@ 2012-06-14  8:20   ` y
  2012-06-14  8:23   ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically Matthieu Moy
  2 siblings, 0 replies; 8+ messages in thread
From: y @ 2012-06-14  8:20 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthieu Moy

From: Matthieu Moy <Matthieu.Moy@imag.fr>

The "splitting a commit" is a sub-case of the "rebase" case, hence,
mention rebase like this:

  # You are currently splitting a commit during a rebase.

This makes the message consistant with "editing a commit":

  # You are currently editing a commit during a rebase.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 t/t7512-status-help.sh | 8 ++++----
 wt-status.c            | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 3ce384a..b3f6eb9 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -210,7 +210,7 @@ test_expect_success 'status when splitting a commit' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -290,7 +290,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -359,7 +359,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -433,7 +433,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
diff --git a/wt-status.c b/wt-status.c
index e65716d..c749267 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -886,7 +886,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
 	} else if (split_commit_in_progress(s)) {
-		status_printf_ln(s, color, _("You are currently splitting a commit."));
+		status_printf_ln(s, color, _("You are currently splitting a commit during a rebase."));
 		if (advice_status_hints)
 			status_printf_ln(s, color,
 				_("  (Once your working directory is clean, run \"git rebase --continue\")"));
-- 
1.7.11.rc0.57.g84a04c7

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

* [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit.
  2012-06-14  8:20 ` y
@ 2012-06-14  8:20   ` y
  2012-06-14  8:20   ` y
  2012-06-14  8:23   ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically Matthieu Moy
  2 siblings, 0 replies; 8+ messages in thread
From: y @ 2012-06-14  8:20 UTC (permalink / raw)
  To: git, gitster; +Cc: Matthieu Moy

From: Matthieu Moy <Matthieu.Moy@imag.fr>

The "splitting a commit" is a sub-case of the "rebase" case, hence,
mention rebase like this:

  # You are currently splitting a commit during a rebase.

This makes the message consistant with "editing a commit":

  # You are currently editing a commit during a rebase.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
 t/t7512-status-help.sh | 8 ++++----
 wt-status.c            | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index 3ce384a..b3f6eb9 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -210,7 +210,7 @@ test_expect_success 'status when splitting a commit' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -290,7 +290,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -359,7 +359,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
@@ -433,7 +433,7 @@ test_expect_success 'status: (split first edit) second edit and split' '
 	git reset HEAD^ &&
 	cat >expected <<-\EOF &&
 	# Not currently on any branch.
-	# You are currently splitting a commit.
+	# You are currently splitting a commit during a rebase.
 	#   (Once your working directory is clean, run "git rebase --continue")
 	#
 	# Changes not staged for commit:
diff --git a/wt-status.c b/wt-status.c
index e65716d..c749267 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -886,7 +886,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
 	} else if (split_commit_in_progress(s)) {
-		status_printf_ln(s, color, _("You are currently splitting a commit."));
+		status_printf_ln(s, color, _("You are currently splitting a commit during a rebase."));
 		if (advice_status_hints)
 			status_printf_ln(s, color,
 				_("  (Once your working directory is clean, run \"git rebase --continue\")"));
-- 
1.7.11.rc0.57.g84a04c7


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

* Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically
  2012-06-14  8:20 ` y
  2012-06-14  8:20   ` [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit y
  2012-06-14  8:20   ` y
@ 2012-06-14  8:23   ` Matthieu Moy
  2 siblings, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2012-06-14  8:23 UTC (permalink / raw)
  To: git, gitster

> To: y@imag.fr

Oops, sorry, I tried answering "yes" to the wrong question. Obviously,
this is not my real email address :-(.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically
  2012-06-14  8:20 ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically y
@ 2012-06-14 17:13   ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2012-06-14 17:13 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

y@imag.fr writes:

> From: Matthieu Moy <Matthieu.Moy@imag.fr>
>
> The common
>
> void function() {
> 	struct wt_status_state *state = calloc(...);
> 	...
> 	free(state);
> }
>
> is essentially a less efficient, and more error prone way of allocating a
> variable on the stack (plus, the calloc should have been a xcalloc).
> Replace it with an on-stack variable.
>
> While we're there, also replace the individual initializations of fields
> with memset(..., 0, ...).
>
> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
> ---
>
> (BTW, I didn't find a way to have both --autosquash-compliant and
> meaningfull titles)
>
>  wt-status.c | 49 +++++++++++++++++++++----------------------------
>  1 file changed, 21 insertions(+), 28 deletions(-)

Thanks; much better.

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

end of thread, other threads:[~2012-06-14 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 23:01 What's cooking in git.git (Jun 2012, #03; Wed, 13) Junio C Hamano
2012-06-14  8:18 ` lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13)) Matthieu Moy
2012-06-14  8:20 ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically y
2012-06-14 17:13   ` Junio C Hamano
2012-06-14  8:20 ` y
2012-06-14  8:20   ` [PATCH 2/2] fixup! 38388c8 reword message when splitting a commit y
2012-06-14  8:20   ` y
2012-06-14  8:23   ` [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically Matthieu Moy

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).