G
G
GLPavel2016-12-21 11:28:21
git
GLPavel, 2016-12-21 11:28:21

Versioning code with hidden comments?

Good afternoon, I’m interested in the question, I want to write code to pick up versioning and hidden comments, it’s understandable about git versioning, although I’m new to working with git, but so far there have been no problems, but about hidden comments and a couple more goodies, not quite. What service? Could you tell ? This kind of comment

// username {{ date #id
// GlPavel {{ 21.11.2016 #24789
random_code
//}}GlPavel

What is this service?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
aol-nnov, 2016-12-21
@GLPavel

but ^Wwhy???
git blame -- path/to/file.c
#24789, as I understand it, the ticket number in the bug tracker? it is necessary to write it in a commit message. one bug - one commit.

I
ivankirshin, 2017-05-15
@ivankirshin

CREATE TEMPORARY TABLE temp1 (id int, reg1 int default 0, reg2 int default 0, reg3 int default 0, reg4 int default 0);
/* Заполнение */
INSERT INTO temp1 (id) VALUES ('1');
INSERT INTO temp1 (id) VALUES ('2');
INSERT INTO temp1 (id) VALUES ('3');
INSERT INTO temp1 (id) VALUES ('4');
INSERT INTO temp1 (id) VALUES ('5');
INSERT INTO temp1 (id) VALUES ('6');
INSERT INTO temp1 (id) VALUES ('7');
INSERT INTO temp1 (id) VALUES ('8');
INSERT INTO temp1 (id) VALUES ('9');

SELECT t.id, coalesce(subquery.reg1, t.reg1), coalesce(subquery.reg2, t.reg2), coalesce(subquery.reg3, t.reg3), coalesce(subquery.reg4, t.reg4)
FROM temp1 t
  LEFT JOIN
  (
    select category, sum(number*(1-abs(sign(region-1)))) as reg1,
                     sum(number*(1-abs(sign(region-2)))) as reg2,
                     sum(number*(1-abs(sign(region-3)))) as reg3,
                     sum(number*(1-abs(sign(region-4)))) as reg4
    from groups JOIN orders USING (id_order)
    WHERE datetime_order >= '$date_start' AND datetime_order <= '$date_end'
    group by category
  ) subquery ON t.id = subquery.category;

DROP TABLE temp1;

It is done through a temporary table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question