Gaza-Israel conflict: What can Israel and Hamas gain?
It took seven days for the war that no-one seemed to want to become the war that no-one seems to know how to stop.
As the first week of July ended there was a sense that the political temperature was rising sharply here but no sign of a sustained confrontation between Israel and Hamas.
The Israeli public had mourned three teenagers kidnapped and murdered as they hitchhiked home from school across the West Bank and Palestinians had grieved for a boy abducted and killed in a grisly act of reprisal as he waited for early prayers at a local mosque.
There was rioting in Arab East Jerusalem and some of the towns of northern Israel with Palestinian populations but it subsided relatively quickly and the rocket fire from Gaza was a background rumble - nothing that Israel's sophisticated Iron Dome anti-missile system couldn't handle.
Israeli air raids at that point were carefully calibrated - training grounds and launching sites in Gaza were attacked. The target list was enough to persuade the Israeli public that Hamas was being punished for the rocket fire but not enough to push the militant group to step up its attacks.
There were even hints that a truce might be possible with both Israel and Hamas using the cautious but optimistic formula that calm from the other side would be met with calm.
Within hours, though, it seemed hostilities began to intensify - and a week later Israeli military sources say they've hit more than a thousand targets in Gaza and that militant groups there have fired more than 500 rockets at Israel. More importantly, the death toll in Gaza has risen to 100 with more than 600 people injured including many civilians.
That possible ceasefire came to nothing not just because of what's happened in the last few weeks, but because broader shifts in the political landscape of the Middle East have created huge pressures on Hamas.
The link between the kidnapping of the three Israeli teenagers and the sudden escalation of hostilities with Gaza is straightforward enough.
Israel blamed Hamas for the abductions and flooded the West Bank with soldiers who rounded up hundreds of Hamas activists. Palestinians saw the arrests as a collective punishment rather than a genuine search for evidence.
The only tool Hamas had at its disposal to respond to the round-up was rocket fire from Gaza - and those arrests were reason enough for that bombardment to intensify.
The broader changes in the Middle East help to explain why a weakened Hamas might see a strategic value in escalating its conflict with Israel.
The organisation has been badly damaged by the twists and turns of the Arab Spring, leaving it with few allies and very little money.
In the past it had the backing of Iran and Syria. But Hamas is an offshoot of the Sunni Muslim Brotherhood and when it sided with Sunni-led rebels opposed to the Alawite Bashar al-Assad and his Shia backers in Tehran, Iran responded by turning off the financial taps. Iran used to donate as much as $20m a month - enough to run the government in Gaza.
That didn't matter as long as Mohammed Morsi of the Muslim Brotherhood was running Egypt. He strongly identified with Hamas and while he closed some tunnels which ran under the Gaza-Egypt border during his time in the presidential palace, others remained open.
Those tunnels brought in weapons of course, but they were used to smuggle in consumer goods too, which Hamas was able to tax.
The new Egyptian government of Abdul Fattah al-Sisi considers the Muslim Brotherhood a terrorist organisation and sees Hamas as being cut from the same cloth.
Many more smuggling tunnels have been closed down, and with them another source of revenue.
In desperation Hamas came to a sort of political reconciliation with its bitter rival Fatah which in its guise as the Palestinian Authority runs the West Bank under Israeli occupation.
So far, though, that link has brought Hamas nothing in the way of concrete benefits and huge differences remain between the rival Palestinian groups.
The renewed rocket fire of course won't solve any of those problems immediately.
But Hamas's military leaders might be calculating that the sight of Palestinian civilians suffering under terrifying aerial bombardment will force the Palestinian Authority to show much greater solidarity and prompt Arab governments to show more support.
Hamas might reason that there were few advantages in keeping the peace whereas once hostilities have started it can demand concessions for agreeing to end them.
For its part, Israel is desperate to stop the rocket fire and to damage Hamas.
To the outside world the Gaza rockets may seem ineffective - partly because many are homemade and partly because they're hopelessly overmatched by Israel's Iron Dome anti-missile defence system.
But Israeli civilians judge the rockets by the intent behind them and not by their military effectiveness. They are grimly familiar with the ritual of running for shelter with their children when they hear a 15-second warning. They expect their government to put a stop to it.
The problem is that there's no easy way of doing that.
Even if you believe in the myth of the accuracy of modern weapons systems you have to accept that air raids are going to kill innocent people.
Israel might argue that it's trying to avoid civilian casualties while Hamas is trying to cause them. But television pictures of civilian dead in Gaza - especially children - will help shape perceptions of Israel round the world.
Israeli sources say militant groups in Gaza probably have 10,000 rockets and they admit they don't know where some of the long range ones are hidden. Finding and destroying them from the air might take a very long time indeed. Civilian casualties would mount, and so would international criticism.
And sending in ground troops doesn't feel like an attractive option either.
First you have to decide what scale of operation you're going to launch - a series of pinpoint commando raids on known weapons dumps? Or a large-scale re-occupation of the whole territory with all the dangers and responsibilities that would bring?
There would be more civilian casualties, making it a tough sell to international opinion. And there would be Israeli military casualties too - potentially making it a tough sell at home.
Israel's government has set the bar for itself very high by talking about putting a stop to the rocket fire for good and not simply settling for a truce of a few weeks or months.
That might be very difficult to achieve. Lots of the rockets in Gaza are workshop weapons. What if Israel staged a huge operation, left declaring it a success and then found home-made rockets raining down a week or a month later?
So Israel has to push on with the campaign without a clear exit strategy in place.
Benjamin Netanyahu's image in the rest of the world might be that of the uncompromising right-winger but his political instinct is probably to triangulate between the conflicting views of the hawks and doves around him.
Short of that elusive permanent stop to the rocket fire it's hard to see what looks like a win from his point of view. At the moment it seems there's not much behind-the-scenes manoeuvring to secure a ceasefire.
Egypt and Qatar are the likeliest mediators. Egypt has contacts with both sides and brokering a solution would raise its diplomatic standing in the Middle East. On the other hand it may be relaxed about seeing Hamas' military potential degraded for a while longer yet.
So it's not difficult to unravel the huge strategic changes and small acts of hatred that conspired to trigger this latest round of hostilities.
But it's very difficult to see what combination of circumstances will eventually bring them to an end.