Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99335D9B2 for ; Fri, 2 Nov 2012 13:41:46 +0000 (UTC) Received: (qmail 86892 invoked by uid 500); 2 Nov 2012 13:41:46 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 86809 invoked by uid 500); 2 Nov 2012 13:41:45 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 86793 invoked by uid 99); 2 Nov 2012 13:41:44 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 13:41:44 +0000 Received: from localhost (HELO mail-vc0-f180.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 13:41:44 +0000 Received: by mail-vc0-f180.google.com with SMTP id fl13so3627484vcb.11 for ; Fri, 02 Nov 2012 06:41:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.180.225 with SMTP id dr1mr1648355vdc.2.1351863703042; Fri, 02 Nov 2012 06:41:43 -0700 (PDT) Received: by 10.52.69.79 with HTTP; Fri, 2 Nov 2012 06:41:42 -0700 (PDT) In-Reply-To: References: <20121102130255.95BE051E11@tyr.zones.apache.org> Date: Fri, 2 Nov 2012 13:41:42 +0000 Message-ID: Subject: Re: [2/3] git commit: Only return X-Couch-Id (rev is available in ETag) From: Robert Newson To: "dev@couchdb.apache.org" Content-Type: multipart/alternative; boundary=bcaec517a990cdfbc104cd834b5d --bcaec517a990cdfbc104cd834b5d Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Yup, it's introduced and removed during the PR, a squash would have been useful here, it makes for silly history. Or a merge, but that requires unblocking a commit hook (though we require that after 1.3 anyway) On 2 November 2012 13:40, Jan Lehnardt wrote: > > On Nov 2, 2012, at 14:37 , Jan Lehnardt wrote: > > > > > On Nov 2, 2012, at 14:02 , jan@apache.org wrote: > > > >> Only return X-Couch-Id (rev is available in ETag) > >> > >> > >> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo > >> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/4edbb93d > >> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/4edbb93d > >> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/4edbb93d > >> > >> Branch: refs/heads/master > >> Commit: 4edbb93d2271ac1eb82f4d2bb072b8bdf6829f85 > >> Parents: 0a64f31 > >> Author: Benjamin Nortier > >> Authored: Fri Sep 21 16:46:46 2012 +0100 > >> Committer: Jan Lehnardt > >> Committed: Fri Nov 2 14:02:48 2012 +0100 > >> > >> ---------------------------------------------------------------------- > >> src/couchdb/couch_httpd.erl | 24 ++++++++++++------------ > >> 1 files changed, 12 insertions(+), 12 deletions(-) > >> ---------------------------------------------------------------------- > >> > >> > >> > http://git-wip-us.apache.org/repos/asf/couchdb/blob/4edbb93d/src/couchdb/= couch_httpd.erl > >> ---------------------------------------------------------------------- > >> diff --git a/src/couchdb/couch_httpd.erl b/src/couchdb/couch_httpd.erl > >> index da47dfc..eb35ff9 100644 > >> --- a/src/couchdb/couch_httpd.erl > >> +++ b/src/couchdb/couch_httpd.erl > >> @@ -692,19 +692,19 @@ send_json(Req, Code, Headers, Value) -> > >> {"Content-Type", negotiate_content_type(Req)}, > >> {"Cache-Control", "must-revalidate"} > >> ], > >> - IdAndRevHeaders =3D case Value of > >> - {Props} when is_list(Props) -> > >> - case {lists:keyfind(id, 1, Props), > lists:keyfind(rev, 1, Props)} of > >> - {{_, Id}, {_, Rev}} -> > >> - [{"X-Couch-Id", Id}, {"X-Couch-Rev", > Rev}]; > >> - _ -> > >> - [] > >> - end; > >> - _ -> > >> - [] > >> - end, > > > > Curious issue: GitHub doesn=92t show this =93-=94 section on > https://github.com/apache/couchdb/pull/32/files > > > > Only on > https://github.com/bjnortier/couchdb/commit/b38374034a57db924a2650038f078= dbe4c61b715 > > > > I based my review on the former. Sorry for accidentally committing this > wrongly. > > > > I have to pop out for a few hours, if anyone feels like reverting this, > I=92d be much obliged. > > > > Thanks to @rnewson for spotting this! > > > nevermind, jumped the gun, this was re-added in > https://github.com/bjnortier/couchdb/commit/fe934a16760dcbf975d9f8b4923ee= e53747bfd25 > > Cheers > Jan > -- > > > Jan > > -- > > > > > >> + IdHeader =3D case Value of > >> + {Props} when is_list(Props) -> > >> + case lists:keyfind(id, 1, Props) of > >> + {_, Id} -> > >> + [{"X-Couch-Id", Id}]; > >> + _ -> > >> + [] > >> + end; > >> + _ -> > >> + [] > >> + end, > >> Body =3D [start_jsonp(), ?JSON_ENCODE(Value), end_jsonp(), $\n], > >> - send_response(Req, Code, DefaultHeaders ++ IdAndRevHeaders ++ > Headers, Body). > >> + send_response(Req, Code, DefaultHeaders ++ IdHeader ++ Headers, > Body). > >> > >> start_json_response(Req, Code) -> > >> start_json_response(Req, Code, []). > >> > > > > --bcaec517a990cdfbc104cd834b5d--